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.
Related
I'm working on a project using android studio and moodle.
One of the objectives of the mission is to get data from moodle into an archive and get that archive into an SD card to access the data into the mobile without internet connexion.
The client wants the data on the SD card, not te be read by anyone.
So I thought of multiple solutions:
Creating a key on the RAR archive
Encrypting the archive
Encrypting each file within the archive (and the archive ?)
But I still don't know how to pass the data to the android safely. And if those solutions which I thought are good because you need to decrypt it with android later. The best would be that it could be done without internet.
I'm not familiar with moodle, but I assume it is a web app? If so, the easiest way to handle the data securely would be:
Download the file from the web app over HTTPS
Use the Android Jetpack security libraries to store the file on the SD card
Here is an article (from the Google Android Security team) that shows how to generate keys and store encrypted files using Jetpack: https://medium.com/androiddevelopers/data-encryption-on-android-with-jetpack-security-e4cb0b2d2a9
It abstracts away a lot of the crypto work for you.
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.
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.
I'm looking at this page, which explains how to use a database in the local Android project (in Assets), to populate the application standard database (managed by Android, in data/...) like this. In this way all the data in the assets database are readable in the apk freely, right?
This is not a good way to store data if in the database there is personal info or certificates.
What is the best way store big info data in assets db and personal data in res/xml or res/values? Is there a recommended way to store personal data?
APK files in Android are world-readable by default, so storing sensitive data in there is not a good idea. On JellyBean and later, the app can be forward-locked (aka 'app encryption') which will ensure that your private assets cannot be read by other applications. This is done automatically for paid apps.
The best way would be to not store the data in the APK but download it on first install. You can use Google Play expansion files, which require authentication to download or come up with your own solution.
You could store them in some encrypted form and then decrypt them on first run, but then you will have key management issues.
As luck would have it I was reading about this today. The Android Dev guide suggests that you use internal storage for private data as it is inaccessible to other apps or the user. See http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
I hope that helps.
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.