Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.database.sqlite.SQLiteDatabase;

public class Main {
    public static final String TABLE_APK = "fdroid_apk";
    private static final String CREATE_TABLE_APK = "CREATE TABLE " + TABLE_APK + " ( " + "id text not null, "
            + "version text not null, " + "repo integer not null, " + "hash text not null, "
            + "vercode int not null," + "apkName text not null, " + "size int not null, " + "sig string, "
            + "srcname string, " + "minSdkVersion integer, " + "maxSdkVersion integer, " + "permissions string, "
            + "features string, " + "nativecode string, " + "hashType string, " + "added string, "
            + "compatible int not null, " + "incompatibleReasons text, " + "primary key(id, vercode)" + ");";
    public static final String TABLE_APP = "fdroid_app";
    private static final String CREATE_TABLE_APP = "CREATE TABLE " + TABLE_APP + " ( " + "id text not null, "
            + "name text not null, " + "summary text not null, " + "icon text, " + "description text not null, "
            + "license text not null, " + "webURL text, " + "trackerURL text, " + "sourceURL text, "
            + "suggestedVercode text," + "upstreamVersion text," + "upstreamVercode integer,"
            + "antiFeatures string," + "donateURL string," + "bitcoinAddr string," + "litecoinAddr string,"
            + "dogecoinAddr string," + "flattrID string," + "requirements string," + "categories string,"
            + "added string," + "lastUpdated string," + "compatible int not null,"
            + "ignoreAllUpdates int not null," + "ignoreThisUpdate int not null," + "iconUrl text, "
            + "primary key(id));";

    private static void createAppApk(SQLiteDatabase db) {
        db.execSQL(CREATE_TABLE_APP);
        db.execSQL("create index app_id on " + TABLE_APP + " (id);");
        db.execSQL(CREATE_TABLE_APK);
        db.execSQL("create index apk_vercode on " + TABLE_APK + " (vercode);");
        db.execSQL("create index apk_id on " + TABLE_APK + " (id);");
    }
}