I would like to maintain single sqlite DB for two applications. I have seen other links and this was helpful Share SQLite database between 2 android apps?
But still when I declare the shared user ID and shared context, I could not achieve it.
In my first app- SQLite is created with few tables.
In my second app=- I would to create tables in the same DB which I created in first app
And also in few posts, I read that this can be achieved through remote Database.
Please can some one suggest me good tutorial where I can have some idea on how to proceed?
I would recommend what you've asked about - which is using a remote database.
Check out this: how to use free cloud database with android app?
Look into a hosted database in the cloud. Quite a few of them will let you get started for free. I know IrisCouch lets you get going for free and it's very easy. http://www.iriscouch.com/ The nice thing about CouchDB is you can do all your work via HTTP - which isn't too hard from an Android device.
Related
I'm really new to programming apps - so this question might sound a bit strange:
I'm trying to program an app in android studio, where people can upload different things (basically strings and links put together in some kind of "package") and other peoble can then decide what "packages" they want to add inside their app. However after downloading, this data should be stored on their device and not just in the memory of the phone so that they can use it after restarting the app (and also if theres no internet connection). Do you have any idea what would be the best way to store this data both on the phone and in a database and how to synchronize the data on the phone with the selected data from the database. I really dont want to know how to do this exactly but would rather like some basic ideas and maybe you could tell me what kinds of stuff i should learn in order to succeed and what kind of database would be best here (firebase, MYSQL,..)?
Thanks a lot,
Andi
First of all you should decide what DB you are going to use.
In my opinion all RDBMs are good, but using Sqlite in order to achieve best performance on android devices is a good idea.
In your case you need server-side DB and application too.
(Depend on the scenario and framework you use can be different (sql,mysql,PostgreSQL,oracle,...)).
About how to sync local database with server-side you can download new DB from server and replace it with previous one, if you need previous user data you can have 2 different table and update one by downloading it from server, and save id or any identical row from specific package that already saved by user.
These are some question has been already answered in Stackoverflow
java - How to update table in sqlite?
java - SQLite in Android How to update a specific row
Create SQLite database in android
If you are talking about local databases. Go for Realm or look up a good ORM on github (Object relational mapping, you dont have to write SQL queries explicitly) .
I would suggest Realm which is very fast and user friendly.
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.
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.
I am programming an app that will store a database locally and would like it to be able to update the database from a remote online database when changes have been made. I do not need to be able to write back to the remote database from the app. I am also trying to keep porting to IOS an option. How do i do this? thanks
This is a very general question, so the best I can do is give you a general answer. You can do this quite easily. Just use an HttpUrlConnection on your android app to pull data from the server and then update your database on the phone with the data you got from the server. If you want to get really fancy you can use a SyncAdapter, but that might be overkill for you needs.
I am working on an application which has large amount of data in a database. I know that it wont be feasible for me to package this huge database along with the app. I can only think of setting up a central database, so that the app can access it. I am new to android. I thought about using web-services or a http webpage request.
any suggestions for this?
thanks,
Naveen
Of course, be familiar with the topics outlined in the Data Storage Developer's Guide.
http://developer.android.com/guide/topics/data/data-storage.html