sqlite

Get Geopoints from SQlite DB

房东的猫 提交于 2020-01-16 15:42:40
问题 I created an SQlite database to store on it all latitudes and longitudes to display them in map. For the add of the values i didn't encouter any problem, i used this code: CoordBD CoordBd = new CoordBD(this); Coordo coordo = new Coordo(36.869686,10.315642 ); CoordBd.open(); CoordBd.insertCoordo(coordo); But i don't know how to insert them one by one in map, i usually/manually make this: GeoPoint point2 = new GeoPoint(microdegrees(36.86774),microdegrees(10.305302)); pinOverlay.addPoint(point2)

What is wrong with my query

删除回忆录丶 提交于 2020-01-16 14:54:19
问题 I am trying to query the database using CursorLoader this is the query that comes out from the loader 11-24 17:33:21.507: E/ACRA(32418): Caused by: android.database.sqlite.SQLiteException: near ")": syntax error (code 1): , while compiling: SELECT _id, contact_id, photo_uri, data1, lookup FROM view_data data WHERE (1) AND (( (mimetype=? OR mimetype=?) AND data1 like ?%)) ORDER BY lookup what is wrong near ")" that i don't see ? - this is why my query arguments look like Uri AUTO_COMPLETE

Cryptic SQLite console output in Objective-C

本秂侑毒 提交于 2020-01-16 14:39:06
问题 When running my program to query the iPod library of my iPhone, I get the following output in the console: CPSqliteStatementPerform: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0 I have disabled everything that outputs to the console so it isn't as if I am having an error with NSLog. What is going on here and how can I fix it. I'll include the overall class

How to Export Web SQL to a .CSV File

别来无恙 提交于 2020-01-16 12:10:07
问题 I am writing an app that will run in an webkit browser. I need it to take the data locally stored on the device and export it in a .csv format. Is this possible using javascript? It would have to be done in browser. Php isnt an option. Thanks 回答1: You can do this, but you will need to serialize your javascript to csv by hand. You will also need to decide what CSV dialect to use. Below is one (untested) possibility that shows the general pattern you must use. function csvQuoteCell(cell,

SQLite how to use integer for storing price value

心已入冬 提交于 2020-01-16 11:26:05
问题 I am using real type to save price value in SQLite database but it does not return correctly value. If I save a few values like 1.01 it will return 4.029999999999999 . I have read that best way to save prices in SQLite is to use integer type But I don't know how to use it. How to store and retrieve prices in this case? Here code how I retrieve price now: Cursor cursor = null; double totalPrice = 0; try { cursor = mDB.rawQuery("select " + Expense.PRICE + " from " + Expense.TABLE_NAME + " where

SQLite transaction behaviour using greendao

ε祈祈猫儿з 提交于 2020-01-16 11:25:46
问题 I am using greendao as ORM library in my Android project and have problems understanding the behaviour of transactions. greendao offers an API runInTx(Runnable r) . My question is, how will two calls of this method from different Threads will be handled? Thread 1 public void thread1() { DaoManager.INSTANCE.getDaoSession().runInTx(new Runnable() { doQueries(); doInsertsAndUpdates(); } } Thread 2 public void thread2() { DaoManager.INSTANCE.getDaoSession().runInTx(new Runnable() { doQueries();

Inserting a data into SQLite (using FMDB) doesn't work on device?

£可爱£侵袭症+ 提交于 2020-01-16 10:56:03
问题 I am a newbie here. I am not able to insert any data into my SQLite database when running on my device. I am using the below piece of code to connect SQLite. It works perfect in my simulator but doesn't work on my iPad device. Can anyone help please? Thank you. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@

Inserting a data into SQLite (using FMDB) doesn't work on device?

妖精的绣舞 提交于 2020-01-16 10:53:40
问题 I am a newbie here. I am not able to insert any data into my SQLite database when running on my device. I am using the below piece of code to connect SQLite. It works perfect in my simulator but doesn't work on my iPad device. Can anyone help please? Thank you. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@

how to deal with encrypted sqlite database in iPhone?

烂漫一生 提交于 2020-01-16 09:05:05
问题 I have an encrypted version of an sqlite database and also I have the KEY but honestly I have no idea about using it or how to get the data from the encrypted database? I guess the solution somewhere in the open function? if(sqlite3_open([_dbPath UTF8String],&database)==SQLITE_OK); Can anybody help me?? 回答1: The core SQLite database implementation does not itself provide encryption support. There does however exist a number of extensions for adding encryption to SQLite. Some of these encrypt

how to deal with encrypted sqlite database in iPhone?

陌路散爱 提交于 2020-01-16 09:04:06
问题 I have an encrypted version of an sqlite database and also I have the KEY but honestly I have no idea about using it or how to get the data from the encrypted database? I guess the solution somewhere in the open function? if(sqlite3_open([_dbPath UTF8String],&database)==SQLITE_OK); Can anybody help me?? 回答1: The core SQLite database implementation does not itself provide encryption support. There does however exist a number of extensions for adding encryption to SQLite. Some of these encrypt