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

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?

Related

How to create a large Offline data repository android app?

I am creating an Android app for my teachers. It will be a completely offline app containing videos and documents relating to mechanical engineering. It is a data repository app. What is the best way to store these data(around 2-3Gb or may be more) in the app?
You can consider storing the files in cache that way those files wont be seen by user in the file manager and you can access them easily.
File.createTempFile(filename, null, context.cacheDir)
This is how you can store it and then you can store their names or path in Room database.
You can refer to the official documentation for that:
https://developer.android.com/training/data-storage/app-specific#internal

How to publish a specific file?

I have an android app where I embed in assets folder a CSV file about 1MB. This file contains 20.000 records of data and it's for read-only. Until now whenever I need to add/remove some records I publish a new apk with the updated CSV. This happens about once per week and usually, the app has no other changes.
I'm thinking of another way to update the CSV file in the user's device.
One option is the app to download the file from some CDN.
Is it possible through play-store to upload there just the file and somehow to be pushed to the user's devices? I'm not sure if Android App Bundle can be used in my scenario.
You can host the csv file on server. If you find its too hassle to build and manage you custom server, you can use Firebase Storage. And even better and efficient solution would be to parse the file, insert it into in Firebase Realtime Database and when updated, user will only get the update portion

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.

Android Assets database security issues?

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.

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.

Categories

Resources