Code example for SQLiteDatabase

Methods: compileStatement

0
    private void insertDefaultHostsSources(SQLiteDatabase db) {
        // fill default hosts sources 
        SQLiteStatement insertStmt;
        String insertHostsSources = "INSERT OR IGNORE INTO " + Tables.HOSTS_SOURCES
                + "(url, last_modified_local, last_modified_online, enabled) VALUES (?, ?, ?, ?)"; 
        insertStmt = db.compileStatement(insertHostsSources);
 
        // http://winhelp2002.mvps.org/hosts.htm 
        insertHostsSource(insertStmt, "http://winhelp2002.mvps.org/hosts.txt");
 
        // http://hosts-file.net 
        insertHostsSource(insertStmt, "http://hosts-file.net/ad_servers.asp");
 
        // http://pgl.yoyo.org/adservers/ 
        insertHostsSource(insertStmt,
                "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext"); 
 
        // AdAway's own mobile hosts 
        insertHostsSource(insertStmt, "http://adaway.sufficientlysecure.org/hosts.txt");
    } 
Contextual code suggestions in your IDE  Get Codota for Java