Is it possible to sync android ormlite across device? - android

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.

Related

When I use a sqlite database as an asset can the database still be used/viewed by another program?

I am working on my capstone and I need to create two programs using two different languages that use a single local database. I am making a chore manager that will be a windows program and an android app. I figure out how to use sqlite for the windows app, but I cannot wrap my head around using an existing database with android studio. I need the app to be able to read existing data and display it and then based on some conditions edit the data.
If I add the database as an asset will the data a user changes using the app be usable by another windows program?
Here's my opinion: "Don't use SQLite for this." Use a regular shared database that you can (securely ...) access from both environments.
SQLite databases are files, accessed through the file-system. They are most commonly used where the data won't be shared, because, like any "shared file" database of aeons past, they are always subject to corruption if someone (or the operating system, or the network ...) does anything wrong. Whereas a conventional client/server database doesn't have these problems because it controls the data while it talks to you.
SQLite is a marvelous tool for storing structured information on a device. I've deployed many dozens of "boutique" websites which store their page-information that way. But, I think, it's not the right tool for this job.

Android App database setup

I am creating an android app, UI/UX and andoid work are finished. I am new to database setup. Can anyone tell me which type of database I should use to store descent amount of data like signup details and app using details. Should I use DBMS or RDBMS or SQlite? help me. Thank you.
In my point of view , you have to use SQLite for android apps.
There are several benefits in SQLite like :
SQLite is embedded into every Android device.
Using an SQLite database in Android does not require a setup procedure or administration of the database.
You only have to define the SQL statements for creating and updating the database. Afterwards the database is automatically managed for you by the Android platform.

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.

Android App: can I use iOS sqlite? If not, how do I create a local database from a database in the cloud (Parse.com)?

I am making an Android version of an iOS app that I already have. I want to use a local database so that the user can use most the app offline.
Initally I thought I could use the sqlite database created by Core Data in Xcode, but as I am reading things online it seems like this is not possible. Is this true? Or is there a good way to export it to something Android could use?
If not, I want to create a local database with values from a database on the cloud(I use Parse.com). How can I do this? The data on the cloud doesn't change very often (maybe twice or thrice a year) if that makes any difference.
This is a good tutorial to handle preloaded databases:
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
Essentially, once you have your precreated database, put it in your assets directory in your apk. Then on first app use, copy this from assets to "/data/data/YOUR_PACKAGE/databases/" directory.
You have to create the database by code in Android, using a DatabaseHelper http://developer.android.com/guide/topics/data/data-storage.html#db. If you want to use your already created database you will have to export it to SQL statements and then "import" them to your application.

Database for new Android Application

I'm starting to build a new Android application which will help me to manage material movements in a warehouse. I would like to use use a database for the following applications:
A table that will be managed from a server (my PC probably) to add or delete new users.
Also, there must be another table that will be managed by users. This table will be used to add or delete materials from the warehouse.
I'm not sure what kind of database to use. I have some knowledge of using MySQL Workbench to create and manage databases. However, I've read the SQLite is better for Android applications. Can you please help me to choose which one will be the best for my application?
Thanks
If the databases run on the android device (which I guess they do not from the description) SQLite is probably the way to go. I like this tutorial but there are millions out there.
If they run somewhere ales (server) you can choose whatever system you are comfortable with since you will have to implement some protocol to communicate between mobile device and server anyway (most people would use HTTP/REST for that, but again, you can do that in a million ways)
SQLite is indeed better for Android applications.
In terms of preloading tables, schemas, and data into a Sqlite database, you can use the SQLiteManager firefox extension to do it.
Or, if you're too lazy to care about what types of database to use, might as well use ORMLite for Android to manage your tables and schemas within your Android application.
As for your server, you'll need to expose the API so that you can do HTTP/RESTful operations on it. You can choose whatever web applications that you prefer.

Categories

Resources