What could prevent a custom application from setting up a SQLite database? - android

I have an application that generates a database and defining tables on installation. Well.. it is supposed to. Thing is: this application has failed and continues to fail to setup the SQLite database on a random selection of computers. So far 8% of the computers fail to install the SQLite database my app requires to function.
Now I am not a database guy so I don't have the knowledge to understand what could be going on in the background. I just wanted to see if somebody has had this problem and if they found a solution, or if there is a prerequisite for a computer to install an SQLite database from an app such as .NET Framework or CLR.
Thank you for your time.

Related

How to use Pre populated Database with the real device

I have made my database using greendao and Have been testing it on the emulator so far. It was working so perfectly. And there was no memory leak and any error whatsoever .
But now I am stuck to just one single point. and that is how do I use this
pre-populated database in the application on the real device. How can I push my database into real device?
Some one suggest me to put my database file in the assets folder and later on Application start just copy it into device.
The suggestion was good, but it is not helping me as there comes the error when I run my application for the first time , but after that it goes forward But then greendao is unable to get the database it find.
The error I got at first run is as under.
can not open database
Buton second run it goes forward and there in next activity I am getting data in list using greendao , but it is not finding that database.
Please tell me :
1) How can I push my pre papulated database into the device to be use by greendao methods.
2) What is a way that is supported in all devices.
Please share me the code. Its been a long I am trying to get over this. But nothing is helping me out.
I made a simple dictionary demo for Android, which manipulates prebuilt database in assets folder with GreenDAO 3.x.
All you have to do is extended the DevOpenHelper class that GreenDAO generates.
Here is the project link: Sawloih.

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 Database Copy Appears Corrupted When Generated by Device and not Emulator

First I want to say thanks to everyone that reads this. Stackoverflow is an amazing site and you guys help me out with answers everyday in the form of questions already submitted. You all rock!
My problem:
I'm working on a database app that I'd like to back up the database at certian points so I can save the data I've collected in database over time, during development. So to save the database to accessible memory I've followed this page:
How can I pull databases off my android onto my desktop?
..and the above code is working great in the emulator (I can use DDMS to pull the copy of the database to my PC and view it using SQLite Database Browser). However when I run it on an actual device, SQLite Database Browser can't read it. To extrapolate, the copy is being created just fine on the SD card, but when I copy to my PC from my device and view it, I get nothing, SDB can't understand it or something. However when I use an emulator, I can copy it off using DDMS and view all the tables just fine with SDB.
Using WinMerge to compare the two raw database files (one generated by the device, one generated by the emulator both running the same code) I can see there are formatting differences, but nothing that looks corrupted, but I'm not 100% sure. The android metadata and SQL sequence tables appear to be in there (albeit in different orders), as well as my custom table.
Do you guys have any suggestions on how to debug this? I'm not sure where to start since it seems to work perfectly on the emulator. Also, I've run the emulator at the same android release (2.3.3) as the device, so I'm am pretty sure they are using the same SQLite engine.
Thanks,
Matt
I'd try opening this database with different SQLite clients.
If that doesn't work, the next step may be to try finding an SQLite database file validator and/or to run the standard SQLite client in debug mode (but to be honest, I don't even know if those two last options are even possible).

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