Re: [android-developers] SQLite DB location on Windows PC
If you are running the app on the emulator it is stored within the filesystem that is stored within the emulator device image. If you are running the app on a physical device it is in fact stored on the device at the location you have shown. On Tue, Sep 3, 2013 at 6:49 PM, Phil Gibbs javabike...@gmail.com wrote: Just for curiosity, where exactly is the database that can be accessed via adb shell ie; /data/data/packagename/databases/database name. Must be in a file somewhere, but where? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Michael Banzon http://michaelbanzon.com/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] SQLite DB location on Windows PC
Not sure what you are asking... you have listed the correct path to your database files... So, unless you can be more clear, you have answered your own question... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Tue, Sep 3, 2013 at 10:49 AM, Phil Gibbs javabike...@gmail.com wrote: Just for curiosity, where exactly is the database that can be accessed via adb shell ie; /data/data/packagename/databases/database name. Must be in a file somewhere, but where? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] SQLite DB location on Windows PC
Just for curiosity, where exactly is the database that can be accessed via adb shell ie; /data/data/packagename/databases/database name. Must be in a file somewhere, but where? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] SQLite db shared between activities
Hello! I'm curious why the SQLite db requires a Context object, and what I should do to share the same instance of a db object between many activities? Should I initialize it in the first activity and use it across the application, or may be any activity should reinitialize the db with itself as db context? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] SQLite db shared between activities
22.02.2011 13:32, ydm пишет: I'm curious why the SQLite db requires a Context object, The database class doesn't - SQLiteOpenHelper (subclass) does, to get the location of the database file. and what I should do to share the same instance of a db object between many activities? Should I initialize it in the first activity and use it across the application, or may be any activity should reinitialize the db with itself as db context? If you're not going to implement a private content provider (which is one way), I'd use a simple singleton, keeping a reference to one and only SQLiteOpenHelper subclass object, initialized with the application context. -- Kostya -- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] SQLite db shared between activities
I agree with Kostya. I used singleton pattern in my application. Initialize instance of db class in subclass of Application.Now i can use same object through out application. On Tue, Feb 22, 2011 at 4:16 PM, Kostya Vasilyev kmans...@gmail.com wrote: 22.02.2011 13:32, ydm пишет: I'm curious why the SQLite db requires a Context object, The database class doesn't - SQLiteOpenHelper (subclass) does, to get the location of the database file. and what I should do to share the same instance of a db object between many activities? Should I initialize it in the first activity and use it across the application, or may be any activity should reinitialize the db with itself as db context? If you're not going to implement a private content provider (which is one way), I'd use a simple singleton, keeping a reference to one and only SQLiteOpenHelper subclass object, initialized with the application context. -- Kostya -- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] sqlite db readonly when setting uses-sdk android:minSdkVersion=8 /
Hi All, I have run into a weird issue. I work with a database located on / sdcard/ and for some reason whenever I add uses-sdk android:minSdkVersion=8 / to the manifest sqlite opens the db as read only. It gets a bit weirder too. The below code opens the db and checks if the db is readonly, which returns false: db = SQLiteDatabase.openDatabase(/sdcard/test.db3, null, SQLiteDatabase.OPEN_READWRITE); Log.i(LOGTAG, Database status: + db.isReadOnly()); but if I try to write any data it bombs with: INFO/Database(6576): sqlite returned: error code = 8, msg = prepared statement aborts at 24: [INSERT INTO tags(type_id , tag) VALUES(?, ?);] ERROR/Database(6576): Error inserting type_id =1 tag=TestTag ERROR/Database(6576): android.database.sqlite.SQLiteException: error code 8: attempt to write a readonly database If I remove the uses-sdk tag from manifest everything works fine. I verified this behavior on the emulator and NexusOne running 2.2.1. Is this a known issue? Is there a workaround? Any help will be greatly appreciated. Thanks Raf -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] SQLite DB: insert VERY slow
I need to insert 1000 rows into SQLite DB. Each row has 12 columns, text and numbers, none is big. It takes literraly minutes to insert all 1000 items. I use SQLiteDatabase.insert to insert each row. What can I do to improve this performance? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] SQLite db limitations for Android app
Store it on the SDcard On Wed, Jun 9, 2010 at 3:10 PM, iThinkSimple ithinksimpl...@gmail.comwrote: Our Android application will read data from our own SQLite db which is around 3GB in size. What is the maximum storage limit for db that is specific to a single app? (The specs say that the device's internal memory supports 256MB, so does it include storing the app's db? If yes, then, is there an optimal way to store DBs of apps that are huge in size? ) Thanks in advance!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] SQLite db limitations for Android app
Our Android application will read data from our own SQLite db which is around 3GB in size. What is the maximum storage limit for db that is specific to a single app? (The specs say that the device's internal memory supports 256MB, so does it include storing the app's db? If yes, then, is there an optimal way to store DBs of apps that are huge in size? ) Thanks in advance!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] SQLite DB, Cursors, CursorIndexOutOfBoundsException problems!! Help!
Hi all, I just wrote my own DbAdapter by modifying the example DbAdapter in Notepad tutorial. The problem came when I tried to fetch data from the Database using my DbAdapter. I got : android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1. Below is a snippet of my code that I was trying to play around with the DB: //rep,index are both some random integers that I'm trying to store in a row ex_rowId = mDbHelper.createExSet(rep, index, 1); if(D) Log.d(TAG, rowid that was used for insertion: + ex_rowId); Cursor c = mDbHelper.fetchExRow(ex_rowId); if(c == null) Log.d(TAG, HOLY-cursor null); //a cursor's lifecycle is automatically taken care of startManagingCursor(c); int repIndex = c.getColumnIndex(BtDbAdapter.KEY_EX_REP); if(D) { Log.d(TAG,HOLY-column rep index: +repIndex); Log.d(TAG,HOLY_column count: +c.getColumnCount()+ row count: +c.getCount()); } int i=0; for(;ic.getColumnCount();i++) { Log.d(TAG,Column names: +c.getColumnName(i).toString()); } int repCount = c.getInt(repIndex); if(D) Log.d(TAG, HOLY-rep count: +repCount); In summary, the code above first creates a new row, which stores some values into a row. Then it fetches the same row by using the returned row id. At last I am trying to retrieve the values from the cursor. Below is the debug print log: 04-14 19:14:11.896: DEBUG/BluetoothChat(710): rowid that was used for insertion: 3 04-14 19:14:11.906: DEBUG/BluetoothChat(710): HOLY-column rep index: 1 04-14 19:14:11.906: DEBUG/BluetoothChat(710): HOLY_column count: 4 row count: 1 04-14 19:14:11.906: DEBUG/BluetoothChat(710): Column names: _id 04-14 19:14:11.916: DEBUG/BluetoothChat(710): Column names: repetition 04-14 19:14:11.916: DEBUG/BluetoothChat(710): Column names: ex_timestamp 04-14 19:14:11.916: DEBUG/BluetoothChat(710): Column names: ex_unique 04-14 19:14:11.916: DEBUG/AndroidRuntime(710): Shutting down VM 04-14 19:14:11.916: WARN/dalvikvm(710): threadid=3: thread exiting with uncaught exception (group=0x4001da28) 04-14 19:14:11.916: ERROR/AndroidRuntime(710): Uncaught handler: thread main exiting due to uncaught exception 04-14 19:14:11.926: ERROR/AndroidRuntime(710): android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java: 172) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 84) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at com.example.android.BluetoothChat.BluetoothChat $1.handleMessage(BluetoothChat.java:325) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at android.os.Handler.dispatchMessage(Handler.java:99) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at android.os.Looper.loop(Looper.java:123) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at android.app.ActivityThread.main(ActivityThread.java:4203) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at java.lang.reflect.Method.invokeNative(Native Method) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at java.lang.reflect.Method.invoke(Method.java:521) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 04-14 19:14:11.926: ERROR/AndroidRuntime(710): at dalvik.system.NativeStart.main(Native Method) 04-14 19:14:11.936: INFO/Process(76): Sending signal. PID: 710 SIG: 3 04-14 19:14:11.936: INFO/dalvikvm(710): threadid=7: reacting to signal 3 04-14 19:14:11.966: INFO/dalvikvm(710): Wrote stack trace to '/data/ anr/traces.txt' 04-14 19:14:15.696: DEBUG/dalvikvm(370): GC freed 43 objects / 2112 bytes in 94ms 04-14 19:14:20.766: DEBUG/dalvikvm(150): GC freed 4543 objects / 253432 bytes in 161ms 04-14 19:14:24.676: INFO/Process(710): Sending signal. PID: 710 SIG: 9 04-14 19:14:24.706: ERROR/JavaBinder(76): !!! FAILED BINDER TRANSACTION !!! As anyone can see, the row count is 1 ! Therefore I am not exactly sure what the bug is. Part of my DB code is also shown below: public static final String KEY_EX_ROWID = _id; public static final String KEY_EX_REP =
[android-developers] SQlite Db problems
hai developers, i want to know how to store the images in SQLite database in android.and also how to retrieve it. anyone give the samplecode or any URL give me to develop my application. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] SQlite DB
Hi All, I have been working on one application where it has to access the number of missed calls. i am facing the problem that the before the database of missed call get updated, the DB getting accessed so getting the old value. I am setting one Listener that will be called when the call ends, and i am reading the DB but still the DB has not yet upadated. Some times the DB is getting updated before i read the value but sometime not. Please post solution. Is there anything like i can wait till the DB update. Or just the delay kind of thing, i can give before reading the DB. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] SQLite db issue : no such column
Hi all, just to start I'm working on my application for the android challenge for 2 months. Tutorial has been done successfully and another thing I'm a C/C++ developper. I'm stuck with this issue for 1 week, I have done many thing but I can't find the error ! Maybe the error is so big that I can't see it, well if someone see ;) Here is my code : public static final String KEY_NAME = name; public static final String KEY_TYPE = type; public static final String KEY_FILTER = rfilter; public static final String KEY_ROWID= _id; private static final String DATABASE_CREATE1 = create table things (_id integer primary key autoincrement, + name text not null, type integer not null, rfilter integer not null);; private static final String DATABASE_NAME = data; private static final String DATABASE_TABLE = things; private static final int DATABASE_VERSION = 2; private SQLiteDatabase mDb; private final Context mCtx; public ThingDbAdapter(Context ctx) { this.mCtx = ctx; } public ThingDbAdapter open() throws SQLException { try { mDb = mCtx.openDatabase(DATABASE_NAME, null); } catch (FileNotFoundException e) { try { mDb = mCtx.createDatabase(DATABASE_NAME, DATABASE_VERSION, 0, null); mDb.execSQL(DATABASE_CREATE1); } catch (FileNotFoundException e1) { throw new SQLException(Could not create database); } } return this; } public void close() { mDb.close(); } public long createNote(String name, int type, int rfilter) { ContentValues initialValues = new ContentValues(); initialValues.put(KEY_NAME, name); initialValues.put(KEY_TYPE, type); initialValues.put(KEY_FILTER, rfilter); return mDb.insert(DATABASE_TABLE, null, initialValues); } public boolean deleteNote(long rowId) { return mDb.delete(DATABASE_TABLE, KEY_ROWID + = + rowId, null) 0; } public Cursor fetchAllNotes() { return mDb.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_NAME, KEY_TYPE, KEY_FILTER}, null, null, null, null, null); } public Cursor fetchNote(long rowId) throws SQLException { Cursor result = mDb.query(true, DATABASE_TABLE, new String[] { KEY_ROWID, KEY_NAME, KEY_TYPE, KEY_FILTER}, KEY_ROWID + = + rowId, null, null, null, null); if ((result.count() == 0) || !result.first()) { throw new SQLException(No note matching ID: + rowId); } return result; } public boolean updateNote(long rowId, String name, int type, int rfilter) { ContentValues args = new ContentValues(); args.put(KEY_NAME, name); args.put(KEY_TYPE, type); args.put(KEY_FILTER, rfilter); return mDb.update(DATABASE_TABLE, args, KEY_ROWID + = + rowId, null) 0; } As you can see I respect totaly the Notepad tutorial. And I'm having this error : SQLException no such column rfilter. Why is the rfilter column missing. I have created this column previously !! Please help a desperate C/C++ programmer :) Kind Regards, Olivier K. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---