public static long getLogOfflineId(final String geocode) {
            if (StringUtils.isBlank(geocode)) {
                return -1;
            }

            return withAccessLock(() -> {

                init();
                try {
                    final SQLiteStatement logIdStmt = PreparedStatement.OFFLINE_LOG_ID_OF_GEOCODE.getStatement();
                    synchronized (logIdStmt) {
                        logIdStmt.bindString(1, geocode);
                        return logIdStmt.simpleQueryForLong();
                    }
                } catch (final Exception e) {
                    //ignore SQLiteDoneException, it is thrown when no row is returned which we expect here regularly
                    if (!(e instanceof SQLiteDoneException)) {
                        Log.e("DataStore.hasLogOffline", e);
                    }
                }

                return -1L;
            });
        }
if returned id is < 0 then there is no offline log for given geocode
main/src/main/java/cgeo/geocaching/storage/DataStore.java