Sync local storage with online database, swift, xcode - android

I got a problem. I have to develop an iOS application that access to a simple xml online database and that store those data in a local storage remaining synchronized with it. I have a Parse account if that can help. (The application should work on Android too, so an universal solution would be great).
In simple terms, the user doesn't access the network sometimes, so I have to keep a local copy of the database that is online and, whenever it access the network, I have to check the version of the database online, and if newer download it and update the local copy. Which kind of local storage should I use? Which kind of online storage should I use? (Xml was just an idea) Can I use parse for this? Is there an online storage suitable for android too?
Thank you!

We are using sqlite android and ios. Using sql from server side. Webservice for connection.

Related

Android save custom data in APK

I have developed (Offline) Android app in which i have to save some employee's data into Local SQLITE database, when i send the apk into another andoird phone the data in the database dose not appear due to local storage of both the devices is different.
My goal is to send the data with the apk file to who ever i send the apk. How can i achieve the goal ?
The problem is i do not have the idea of how to do it, or never have done this kind of project before.
Please guide me.
If Your database is read only - You can use raw folder of project for Your SQLite database file, than, after .apk was installed, copy it, for example to external storage. But if You need changes in database and synchronized data on all devices - You should use only one server-side database.

How to get backup of the CouchDB locally in android device?

I am not much familiar in CouchDB. I have used CouchDB to store the documents (images, audio & video files) which user has uploaded from Android app. Those documents were stored locally in his mobile not in server. We provide an option to update the software with new couchDB which is hold HTML and some uploaded files. Now my problem is while updating the app, I need to get backup of old CouchDB and store it any place. After update completed copy the documents from old to new then delete the backup of couchDB.
Please anyone guide me to achieve this. Is any other possible to achieve without getting backup?

Sample data stored locally with a PhoneGap based app on Android

We had initially planned on developing a native app for Android but PhoneGap is looking like a better option.
One thing we need to have is when the user installs the app, they need to have local access to a sample of the data in our back end database but have it stored locally. On the native app we had planned that when the user installed the app, the installation process would also trigger a retrieval of a chunk of the data in the back end database so that they could make basic usage of the app without relying on an internet connection all the time.
This data will include JPG files and perhaps some audio files. Will HTML5's local storage address this requirement?
short answer: YES
That's what makes phonegap awesome, you may create a database in to store the persisting data details (name & path)
When you run your application, you will test the connection, if there is no connection you can refer to the local files through your database else if there is connection you may download the new data, save them to the local database and then delete them from the local storage (Sdcard & database).
to find more check the phonegap's file docs
Just to add to what T.Baba has said, yes it is very possible, and I have recently built a webapp with PhoneGap and jQuery Mobile that does just that.
I used localStorage to contain all the data, and in particular localstoragedb. I haven't stored any images and/or audio files in localStorage and wouldn't recommend it anyway as most devices will limit the space to 5MB, but PhoneGap does give you access to APIs which will allow you to save files on the user's device. You can also of course bundle the files with the app and access them accordingly.
Indeed it is. Phonegap is best option for that.

Backup local sqlite database in Adobe Air mobile projects to Cloud

I am having an application with local sqlite database in an Adobe Air application for Android and iOS.
I would like to give the user the ability to backup and restore the local database. Since on iOS you cannot just save a backup file on the file system/SD card, I am thinking of backing it up to dropbox or to some other place.
It would be great of someone could give me some pointers and code sniplets about the best practises for this problem.
Thanks!
Check out the Dropbox Api section. You can use it to save files exactly as you've described in android without too much difficulty. They provide some good resources.

Usage of databases in android application

I have a large data that I have to use in my first android application, could any one guide me the best way to achieve this?
Is there something like embedded database in android framework?
Can i keep my database on my custom server and provide web service to my application?
Which one of the above is better, since I can offer the user to purchase the application and keep the data locally on his device in compressed format.
Thanks
You can ship an android application with the database file in the res/raw folder, and then programmatically copy the file onto SD Card. I personally compress my database file into a zip and uncompress it on first run.
Android has support for SQLite databases which is a very efficient, embedded, crossplatform database. Would recommend this.
Using a remote server might not be a good idea, since signal on wireless networks is often slow and unreliable.
See this answer for me details.
Ship an application with a database
But if the file size of the compressed database is >1MB then you'll need to download it from a webserver and store it locally (Android has a 1MB file size limit on internal files/resources)
Here are some brief thoughts.
Android has SQLite, you could use that for storing and accessing data.
But there are restrictions on such file sizes of 1mb.
I'd recommend setting up a simple web server that can accept GET requests.

Categories

Resources