I see that there are many options for ORM tools:
Any good ORM tools for Android development?
But do any of them help you to create Content Providers quickly?
If not, what tools exist?
you can also have a look at CPOrm on github: https://github.com/Wackymax/CPOrm
It will create the database and content provider for you and handles all of the boiler plate code for common database operations via the content provider.
Try MOTODEV Studio for Android.It has a Database Management feature to conveniently view and edit SQLite databases on emulated devices.
You might want to look at this project: https://github.com/groupme/ProviderOne
It claims ability to generate "all you need" just from DB file
Related
I have an Android app where I use a SQLIte DataBase. I am using the app and the DB is already big. Now I want to give this app with its DB to my coworkers. Where and How to put the DB for release? I have the DB in my phone but I need it in assets folder. I was trying but it doesn't work. I tried to copy the DB directly however I read that Android compress files in that folder. Please, any solution, thank you in advance.
http://blog.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
Visit this link. It contains the easiest and well described answer for your question.
You can use emulator Like GenyMotion and any other emulator. Run your app on emulator then just go to Android Studio->Tools->Android Device Monitor Then select the emulator and in the file Explorer you can find your db file . and then export from the device and export to your desktop. here you can give it to any one.
You can use your own SQLite database by adding it to assets folder. The best way is to use Android SQLiteAssetHelper. Better than reinventing the wheel.
Here the excerpts from its readme:
An Android helper class to manage database creation and version
management using an application's raw asset files.
This class provides developers with a simple way to ship their Android
app with an existing SQLite database (which may be pre-populated with
data) and to manage its initial creation and any upgrades required
with subsequent version releases.
It is implemented as an extension to SQLiteOpenHelper, providing an
efficient way for ContentProvider implementations to defer opening and
upgrading the database until first use.
Rather than implementing the onCreate() and onUpgrade() methods to
execute a bunch of SQL statements, developers simply include
appropriately named file assets in their project's assets directory.
These will include the initial SQLite database file for creation and
optionally any SQL upgrade scripts.
i just want to know how to get the android loacal-app Contact' database,i want to check the raw_contact or data table with terminal.what tools i need or what is the orders?Thanks.
From what I understand from your question you want to use a CLI tool to inspect the Android contact's database. AFAIK the database itself should be located in
/data/data/com.android.providers.contacts/databases/contacts2.db
But could possibly change depending on the manufacture?
As far as using a local tool on your Ubuntu install you'd first need to get the platform SDK to use ADB to pull the database off your device then use a local tool to manipulate or examine the database. Note:Your device will need to be rooted to pull the database.
For example on the SQLite website they provide a binary for Linux to inspect databases. It can be located here: http://www.sqlite.org/download.html but I'm sure there are a couple more floating around due to SQLite being an open standard.
Hope this answers your questions.
I'm working on a project on mobile RDF databases for Android. Therefore I'm looking for open source databases to include in my Android project. However, it's difficult for me to find mobile versions of existing RDF databases.
What I've found so far:
Jena TDB database
Oracle Berkeley database
Unfortunately I haven't found mobile versions of Sesame, Virtuoso, AllegroGraph, etc.
Does anyone know some other RDF databases for Android?
I'm not an Android developer, so perhaps I'm overlooking something, but Sesame comes as a collection of maven modules, each a separate Java jar file. You can pick and choose the jar files you need and as far as I'm aware, you should be able to use them on Android straightaway. I don't think there's any need for a separate "mobile version", is there?
I am taking a look to Triple Place.
a light weight and flexible Triple Store for Android. It uses a
indexing structure similar to the one in Hexastore. TriplePlace uses
TokyoCabinet as persistent storage system.
You can find a brief presentation of its features here.
You can use SQLite to store RDF data and make queries for the triples, but SPARQL couldn't be done. Here is a good reference:
http://infolab.stanford.edu/~melnik/rdf/db.html
I would also take a look at 4store.
Some of my users are reporting that they cannot correctly open sqlite databases created in Android using sqlite jdbc or other tools like sqlite browser (http://sourceforge.net/projects/sqlitebrowser/).
Here is an example database with the problem:
http://pocket-for-android.1047292.n5.nabble.com/Desktop-Version-Screenshots-Work-In-Progress-tp4383220p4456017.html
This sqlite db was created on a HTC Sensation, running Android 2.3.3 and Sense 3.0.
The exact problem is that if you look at the file in a text editor you can see a bunch of tables being created but if you try and run "select * from groups;" you will get an SQLException: file is encrypted or is not a database.
I have tried using "select sqlite_version;" to see if it is a versioning issue - the sqlite browser says 3.6.18.but different tools give me different version numbers... not sure what is going on with that.
I should also point out that my app copies the db directly from the device (/data/data/com.citc.wallet/databases/wallet.db) onto Dropbox.
Any help would be really appreciated.
The solution was that the zentus project is not working with the latest versions of SQLite.
Fortunately someone is keeping a fork maintained here: http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC
All I had to do was replace the jar with the xerial one and it all worked. Xerial sqlite jdbc is in my opinion the best way of connecting to SQLite in Java (I tried several of the libs).
I am also getting the same problem.
But once I have changed the database name it resolved.
So, just try it by creating new database
I have an Android app that has been already developed using SQLite.
The DB is quite large (over 100 Megs) so it can be deployed only on the SD card.
The data inside the DB is sensitive so for this reason we need to encrypt the DB.
The default SQLite binary on the phone does not allow encryption or to add a plug in (extensions).
I manage to compile the SQLite using NDK with the encryption extension (I am calling this SQLiteS - from secure) but I still need to figure out how to copy the Sqlite API and bind it to the new SQLiteS binary.
The idea is to not change the already developed code using the SQLite default API excepting the package name.
Any idea of how can I accomplish this ?
Tryp getting a native jdbcsqlite driver onto Android.
which makes sqlite3_* calls(JNI).
Use the aapt tool to link the library(sqliteS) into the .apk file.
Also, you can change the sqlite3_* names(in SQLiteS.so you built) so that it doesnt refer to sqlite.so file provided by android.
Let me know the solution.
I know this is not an answer for your question, but you could try the (free, open source) H2 database. It supports data file encryption as well. There are some disadvantages however, for example some operations are quite a bit slower. You would need to use the JDBC API because the SQLite / Android database API is not yet supported. Disclaimer: I'm one of the H2 committers.
Use sqlCipher. SQLCipher is an open source extension to SQLite that provides transparent 256-bit AES encryption of database files.
See http://sqlcipher.net/