Langsung ke konten utama

Postingan

Menampilkan postingan dari September, 2016

How to use External SQLite DB in Android

In this Post, I will explain how to import and use External SQLite DB in Android. You can import and use SQLite database with the extensions like .db, .db3,sqlite and sqlite3. The External DB is created with some desktop applications like SQLite Browser , SQLite Converter and so on. After Generating the DB paste that into your App's assets folder. Code: DBHelper.class Create a class named as DBHelper extending with SQLiteHelper . Paste the following code in that class. public class DBHelper extends SQLiteOpenHelper { Context context; String DB_PATH; String divider = "/"; String DB_NAME; public DBImporterExporter(Context context, String DB_NAME) { super(context, DB_NAME, null, 1); this.context = context; this.DB_NAME = DB_NAME; DB_PATH = divider + "data" + divider + "data" + divider + context.getPackageName() + divider + "databases/"; } public boolean isDataBaseExists() { Fi