[android-developers] Re: sqlitedatabase

2011-10-27 Thread lbendlin
Please use your favorite search engine before posting here. http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to andro

[android-developers] Re: SQLiteDatabase exception on query

2011-08-04 Thread Zsolt Vasvari
SQLite exceptions are extremely helpful and almost always spell out the exact problem. On Aug 4, 3:49 am, Mobileschizo wrote: > Why is this causing an exception? > > String[] col = new String [] {"id"}; > String sel =  "firstname=? AND lastname=?"; > String[] selArgs = new String[] {"John", "Smit

[android-developers] Re: SQLiteDatabase error: SQL logic error or missing database

2011-06-03 Thread Hank
I think the error has something to do with selection and selectionArgs, cause if I remove them there is no problem On Jun 3, 1:15 pm, Hank wrote: > I tried the other query method and it also fails. > > I added five rows into the table before querying and there are no > problems with adding > > On

[android-developers] Re: SQLiteDatabase error: SQL logic error or missing database

2011-06-03 Thread Hank
I tried the other query method and it also fails. I added five rows into the table before querying and there are no problems with adding On Jun 3, 12:42 pm, Edam wrote: > Most of your code looks very similar to mine (which works 100% ok). > The bit where you select the data is different, mine lo

[android-developers] Re: SQLiteDatabase error: SQL logic error or missing database

2011-06-03 Thread Edam
Most of your code looks very similar to mine (which works 100% ok). The bit where you select the data is different, mine looks like:- return db.query(true, "table_name", cols, KEY_ROWID + "=" + rowId, null, null, null, null, null); I'm not sure what the difference is

Re: [android-developers] Re: SQLiteDatabase

2011-04-15 Thread Android K
Thanks for the replies. ContentProvider worked for me. On Fri, Apr 15, 2011 at 11:16 AM, lbendlin wrote: > You can use an application object to hold the reference to the database. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. >

[android-developers] Re: SQLiteDatabase

2011-04-15 Thread lbendlin
You can use an application object to hold the reference to the database. -- 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

Re: [android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-24 Thread Dianne Hackborn
Your data is always on internal storage. Moving to SD card only moves your .apk to the SD card. On Wed, Mar 23, 2011 at 2:09 PM, Robert wrote: > Hmmm I've been thinking about using a database to store a lot of > data (several MB in text format). Is the sqlite db moved to the SD > card when

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread lbendlin
you could save the images to database blobs, but why go through the effort? Keep the images in a image folder, and only store the reference in the XML or the database. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread lbendlin
you move it with a standard file copy operation. Like you already do when you copy the db from the (read only-ish) apk to the working flash. on the SD card there's a preferred place to put that kind of stuff , /Android/Data//files , but you can put it whereever you want -- You received thi

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread Robert Copelan
Thanks Dianne and lbendlin. Hmmm.. how would I "manually" move it? The move would have to be under app control since I could not expect that the typical person using the program would be able to do it at the filesystem level. SInce the APK moves then that probably includes any asset files so m

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread lbendlin
Initially the database stays in main flash memory when you decide to move the application to SD card, as the (writable) database is considered part of the data. However nothing stops you from manually moving the database to SD card, independent of what the user decides for the program location.

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread DanH
Yes, but then you're not storing an image. And whatever you are doing you're doing rather inefficiently. (And if XML would work, JSON would be a better choice in about 95% of cases.) On Mar 23, 3:18 pm, Jonathan Foley wrote: > That's not entirely true, one could base64 encode the image bytestre

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread Robert
Hmmm I've been thinking about using a database to store a lot of data (several MB in text format). Is the sqlite db moved to the SD card when the app is moved or is it always on the internal memory? I'd rather not leave a big table on the phone's internal memory. Right now I have this data in

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread Jonathan Foley
That's not entirely true, one could base64 encode the image bytestream and store it in xml, alternatively one could store the image files themselves and just store their path in the xml file. Jonathan On Mar 23, 3:59 am, DanH wrote: > Well, you can't put images in XML. > > If this is really

Re: [android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread Dianne Hackborn
Um, no. A database doesn't have anything to do with security. An XML file is not intrinsically tied to The Internet. You probably do not want to use a database. A database is good for situations where you have structured data with relatively lots of items where you want to do queries against th

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-23 Thread DanH
Well, you can't put images in XML. If this is really a "formatted document" in one single byte stream the most logical choice would be a flat file. On Mar 22, 4:46 am, -Ernest wrote: > Hello guys, > Thanks for making android a wonderful platform. > Me and my mate are writing a project and its an

[android-developers] Re: SQLiteDatabase or XML(saving)?

2011-03-22 Thread harsh chandel
database if security is invloved if on xml on internet On Mar 22, 2:46 pm, -Ernest wrote: > Hello guys, > Thanks for making android a wonderful platform. > Me and my mate are writing a project and its an android app. > Yesterday i finish my third book about programing for > the android platform "

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-26 Thread Nathan
The preceding test was with SQLiteDatabase.setLockingEnabled(true), the default. With SQLiteDatabase.setLockingEnabled(false), the reading thread is not starved. Behavior seemed similar to when a transaction was not used. And my tests run successfully. I may be getting lucky and/or my tests are no

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-26 Thread jotobjects
Thanks for that report. Did your transaction test also have the enable locking set? That may have had a worst case exclusive locking effect (SQLite does not use exclusive write locks until commit time normally). FAQs 5 and 6 at this link provide more info - http://www.sqlite.org/faq.html#q5 Ho

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-26 Thread Nathan
>Database engines > usually isolate parallel transactions for multiple clients. Don't count on SQLite doing this. Any locks are on the entire database file - only one transaction can be in progress. I do have some data based on some tests I've run. Having a cursor open does not lock the database

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-22 Thread jotobjects
Interesting. Thanks for that link. It is a reasonable "speculation" (guess) that the enable locking method has "something" to do with the various threading options. In addition to thread safe operation there is the question of how multiple processes (different JVMs) inter-operate with the same S

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-21 Thread Nathan
On Jan 21, 4:22 pm, jotobjects wrote: > > It doesn't make any sense to me that you have to turn locking on > (whatever that means) if you are using transactions.   You probably don't if you are using one thread. I think the setLocking is about making the the SQLite *code* thread safe, and not

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-21 Thread jotobjects
On Jan 21, 12:09 pm, Nathan wrote: > I put a transaction > around a long series of small updates and it was reduced to a few > seconds.  This was a situation where you would think a transaction > would improve correctness, but degrade performance slightly. That is not so surprising since with

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-21 Thread Nathan
On Jan 21, 11:08 am, jotobjects wrote: > You might want to look into the transaction paradigm/pattern: > > http://developer.android.com/reference/android/database/sqlite/SQLite... > > Transactions are the well understood way to get consistent results > with multiple readers and writers.  Exactly

[android-developers] Re: SQLiteDatabase lifecycle and threads

2010-01-21 Thread Nathan
>From the interface methods on SQLiteDatabase, it seems very much like it is intended for one instance of SQLiteDatabase per open database, and that you share it between threads. You can apparently even set locking enabled. = public void setLockingEnabled (boolean lockingEnabled)

[android-developers] Re: SQLiteDatabase table

2009-08-03 Thread janardhan
hey Jeff Sharkey, pls can u send the code for login application using sqlite databse On Aug 4, 9:55 am, Jeff Sharkey wrote: > You should really look at using SQLiteOpenHelper; it automatically > helps with initial database creation and any upgrade paths. > > j > > > > On Tue, Jul 28, 2009 at 7:3

[android-developers] Re: SQLiteDatabase table

2009-08-03 Thread janardhan
hey boomerbubba, pls can u send the code for login application using sqlite databse On Aug 3, 9:03 pm, boomerbubba wrote: > SELECT EXISTS(SELECT * FROM sqlite_master WHERE type = 'table' AND > Name = 'MyTableName'); > > returns 1 or 0 for True or False > > Substute your own table name for MyTabl

[android-developers] Re: SQLiteDatabase table

2009-08-03 Thread Jeff Sharkey
You should really look at using SQLiteOpenHelper; it automatically helps with initial database creation and any upgrade paths. j On Tue, Jul 28, 2009 at 7:35 PM, jayaram wrote: > > Hi, >     I've an SQLiteDatabase mydb.db.   I want to check whether a > particular table named 'table1' exists or

[android-developers] Re: SQLiteDatabase table

2009-08-03 Thread boomerbubba
SELECT EXISTS(SELECT * FROM sqlite_master WHERE type = 'table' AND Name = 'MyTableName'); returns 1 or 0 for True or False Substute your own table name for MyTableName. On Jul 29, 7:07 am, jay ram wrote: >     I'm working with SQLiteDatabase. I need to find out whether a table > named 'table1

[android-developers] Re: SQLiteDatabase on SDCard possible?

2008-11-26 Thread plusminus
Got it, seems like SQLiteOpenHelper works only with dbs in the data- folder of the app. This does it: SQLiteDatabase.openDatabase("/sdcard/my.db", null, SQLiteDatabase.CREATE_IF_NECESSARY); On 26 Nov., 21:53, plusminus <[EMAIL PROTECTED]> wrote: > Changed topic to expressive title. --~--~---