Posts

Showing posts from April, 2014

Unable to get system library for project

Image
You may not able to build your android project because android adt cannot find the system library for project. And following compile errors may occur due to that problem. The type java.lang.Object cannot be resolved. To solve the problem open build path for the project, and in Android tab select different project build target.

SQLite For Android Source Codes

public class SQLiteHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "my_database.db"; // TOGGLE THIS NUMBER FOR UPDATING TABLES AND DATABASE private static final int DATABASE_VERSION = 1; // NAME OF TABLE YOU WISH TO CREATE public static final String TABLE_NAME = "my_table"; // SOME SAMPLE FIELDS public static final String UID = "_id"; public static final String NAME = "name"; SQLiteHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + UID + " INTEGER PRIMARY KEY AUTOINCREMENT," + NAME + " VARCHAR(255));"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w("LOG_TAG", "Upgrading database from version " + oldVersion + " to " + newVersion + ",