Android: is it safe to remote download sqlite database - android

I followed instructions on http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ and succesfully inserted sqlite database on android device so user doesnt have to download data to start doing somethnig. Problem is I don't know if this trick will work on all Android devices. Does anybody have any bad experience relating to version of device, version of database or something to think again about this method? Would it be a problem if user moved app on SC card?

I have used a preloaded SQLite database in my Android applications without any problems.
I don't see any reason why doing this would be incompatible with certain devices as long as your SQLite database is compatible with the version that Android ships with. Android ships with SQLite version 3.4.0 per the android.database.sqlite package description in the Android website.
Hope this helps.

I had problems with this because my database was too large for many devices. You have to either save to external storage or download your database on-the-fly. The biggest disadvantage to storing your database in the APK is that you essentially double the size of your app at runtime.

Related

Sqlite 3.8 with pre-Lollipop APIs

I have a pre-populated database that i'm trying to copy from assets folder.The database uses a few WITHOUT ROWID tables which according to sqlite.org work only with SQLite version 3.8.2 (or later versions).
According to this SQLite 3.8 is not supported on pre-20 APIs and on those cases i get a "malformed database schema" exception when trying to copy the database.So, is there a way to use SQLite 3.8 on older APIs?
The simplest thing, by far, is to get rid of WITHOUT ROWID.
It is possible to package an independent copy of SQLite with your app. SQLCipher for Android is one such packaging. However:
This adds a few MB to the size of your app, eliminating any savings that you are getting by avoiding ROWID
If for some reason you do not want to use SQLCipher for Android, implementing this yourself is a lot of work

Android publish database for uploading and downloading file

This application will be my first application that I am planning publish. I wrote application and it works on emulator with database. Users file(xls,doc,img) input will convert to byte and uploaded as BLOB. I used SQLITE for database. The problem I have is how would I publish this application with database. As I search I saw something called cloud-based database. Do I have to use it or are there any easy way to do it? We are going to keep at most 1 GB data.
The application will work on Android and in future it will be on IOS.
Thanks in advance.
You can use this good component to ship your app with a preinstalled database https://github.com/jgilfelt/android-sqlite-asset-helper

Dragging and Dropping a SQLite database between projects

I see a sqllite database in another application, why can't I just just drag and drop from that application to mine in the eclipse environment? that way I can use data already in that database?
Android doesn't do too well with using an sqlite database file directly. Generally the way to go around it is to package an sqlite database as a resource and on first create of the app to load that resource and then connect to it and then copy all the data out of it. The downside of this is you are essentially doubling all your data.
If you are the publisher of the other app then you can list the database as a shared database to share between your apps.
Share SQLite database between 2 android apps?
Noone has written an Eclipse plugin that does that. You can write one if you feel it is both useful and worth your time.

How do I view my sqlite tables in my android app?

I'm working on an app that uses sqlite to store data and I need/would like to view the tables in the app to be sure things are being added correctly and the content exists. How do I review the tables and their data being used in my app.
I'm using a Nexus 7 with 4.4 on it for testing the app.
You have basically two choices.
Run the app in the emulator, then "pull" the db to your dev machine and use a tool such as SQLite Expert Personal 3 to view the db.
Create your db in the external storage instead of internal. Then you can use your USB connection to "pull" the db.
I guess I can add (3): add code to dump your tables to the log file.
I don't know this can solve your problem or not but installing THIS plugin into eclipse help me a lot to view database table and content inserted.

Sqlite plugin for Eclipse: debug sqlite database on Android device live

I want to debug database on android device. My application is very heavy and I do too much insertion queries and other stuff so running on emulator is hell slow so I am debugging it on Android phone.
But I could not debug database, like in Iphone you can see even insertion made into database. I want to see the current situation of database without rooting my phone and pulling it from my phone and then opening it into some 3rd party software.
Is there any way to debug Android database on mobile phones without rooting and pulling database out?
There is tool sqlite3 but the problem is that when you connect to shell it shows you ugly data and furthermore if database is not created running any query actually creates database in database folder so you would never knew that your database was not created by your logic.
I hope you understand what I am looking for.
I had the very same problem and after a search I found this one SQLiteManager plugin for Eclipse which is a plugin for eclipse allowing you to see and browse your data strait from SQLite DB
To use this it's easy, start you emulator, browse the emulator files in the DDMS view then
go to data > data > com.your.package > databases > your_database_name.db (note the db extension is mandatory)
and a new tab will appear with your data!
It won't work on a real device (maybe on a rooted one?)
Hope it will work for you :)
There is information on how to connect eclipse to a sqlite database here. Another alternative is using this Firefox add-on to manage your sqlite database.
I'm still looking into it myself but there is MOTODEV Studio for Android, requires free registration.
See the next simple, single JAR file.
on google code

Categories

Resources