I have created database in external storage using a particular application and created tables using the same application.Now i want to access the data from that database from a new android application, So do i have to use content providers or else i can directly access the database without using content providers? Please help!
listView.setOnItemClickListener(new OnItemClickListener() { private static final int DATABASE_VERSION = 5; private static final String UID = "_id"; private static final String STEP = "Steps"; private static final String ImagePath = "Image_Path"; private static final String AudioPath = "Audio_Path"; @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method stub Message.message(KitchenData.this, "Click List Item Number"); SQLiteDatabase db = openOrCreateDatabase("/mnt/sdcard/Kitchen_Data.db", MODE_MULTI_PROCESS, null); try { String CREATE_TABLE = "CREATE Table " + li.get(position) + "("+ UID + " INTEGER PRIMARY KEY AUTOINCREMENT ," + STEP+ " VARCHAR(255) NOT NULL ,"+ImagePath+" VARCHAR(255) NOT NULL,"+AudioPath+" VARCHAR(255) NOT NULL); "; db.execSQL(CREATE_TABLE); pos=li.get(position); }catch(SQLException e) { Message.message(KitchenData.this,"Errors in creating table "+e); }