I am looking at migrating a native Android project from an SQLite database to an ORM. I have considered what I believe to be the fastest current contenders - DBFlow (based on SQLite) and Realm.
Therefore, out of curiosity, does anyone know what sort of data format Realm is using? Having read their documentation, this is seems to be a pretty closed subject and I could not find anything on the matter.
From their site - Realm is not an ORM on top of SQLite. Instead it uses its own persistence engine and their source code is open for java.
https://github.com/realm/realm-java
Related
Advise on which database on Android Studio and Kotlin
I am struggling on developing an app using Kotlin using Android Studio.
The app will have 50-100 keys/ids (lines) with each row containing ~10 pieces of data (name, dates, etc.), that can be searched through and the results shown on the app.
As I would like this to be fairly simple, what database should I be using? XML, SQLite, MySQL, etc?
Are there any simple examples that I could use please?
Really appreciate any help.
If you're looking for an offline/local database, you can use room DB instead of SQLite to avoid usage of too much boilerplate code to convert SQL queries and data objects.
You can check this link
https://developer.android.com/training/data-storage/room
I have an Android app with a somewhat complex database (18 tables). The app currently uses OrmLite to map and manage database objects. I'd like to migrate the app incrementally to use Room. I've read about steps to migrate an existing SQLite app to Room, which involves replacing SQLiteOpenHelper with Room's SupportSQLiteOpenHelper. However, I don't think I could easily replace that within the OrmLite framework. Does anyone know if it's possible for OrmLite and Room to coexist in the same runtime, accessing the same SQLite database file? What steps would I need to take to ensure the database is not corrupted between the two frameworks, other than the obvious transfer of entity classes from OrmLite to Room?
Thank you.
I am considering using ORMLite for persistance in an android app. A requirement is to be able to sync the underlying android SQlite database across multiple android devices.
Is this possible with ORMLite? And how?
You can directly copy the database file over to another device and it will work if you didn't change the schema.
I wouldn't recomment that though. Instead you could load the Object tree from your db using ORMLite, copy it over, and write it back to the db with ORMLite. You might want to look into SyncAdapters too.
Why we use ORMLite, if we already have Sqlite in Android ?
Is there any specific reason behind the ORMLite to use over SQLite in Android?
ORMLite is an open source software framework that provides lightweight object relational mapping (ORM) between Java classes and SQL databases.
ORMLite has two .jar files : ormlite-core.jar (275KB) and ormlite-android (50KB) libraries
Pros :-
1.)use for complicated database operations
2.)no need to remember to SQL queries
3.)prefer for big size application
Cons :-
1.) unnecessarily increase size of application
2.) little bit slow with compare to greenDao(another ORM)
To choose your ORM in android, also look at these links:
Bench marking ORMs in Comparison of SQLite
Comparison of GreenDao and ORMLITE
I am not sure if anyone has ever tried this. I am currently storing attributes in a sqlite database on android. What I want to do next is to retrieve these data and apply Machine learning algorithms implemented by Weka. Weka can indeed take data from databases using JDBC. But can this be done with android? The SQLite database in android doesn't seem to be a normal SQLite databse.
I have read this http://weka.wikispaces.com/How+do+I+connect+to+a+database%3F, but it doesn;t help much.
Thank you
I do not think there is a ready implementation for Weka to read the data from sqlite on Android, because the helper class mainly depend on JDBC which is not available for android.
I can think of two options to achieve this:
Query the sqlite database on Android and create Weka training instances programatically on the fly. This solution might be more suitable for online training and when you have large dataset.
Export the training data from sqlite as csv file and pass the file to Weka for training.
It seems that WEKA won't work on Android without changes. J48, for example, requires the java.lang.Cloneable interface, which is not available in Android.
This is a weka port to android project here.
Hope it will help you.