React-native: save data in device memory - android

I know about asyncStorage. That's not what i need. I want to save some data locally, so if app will be completely deleted and installed again, it should gain access to the stored data. AsyncStorage data being removed along with app itself.

I think you must use a FileSystem to save files in phone storage. Take a look at this library to handle files: https://github.com/johanneslumpe/react-native-fs. Hope it helps.

I dont think anything an app creates can exist after app deletion. If you think about it, why would you want disk space being used up by an app you deleted. Only option I can think of is storing in the cloud: Google Drive, DropBox, etc. or a server you run and user data connected to an account system.
My experience is with iOS, maybe Android has some option for what you want.

Related

Android Importing exporting sqlite data

So my idea is that i want to make it easy for people to convert over to my android app from someone else's. It seems as though i can import data into my database, correct me if i'm wrong, from a file. However, how can i (or another app available on the market) retreive the data from an app so that they (the user) can move it?
As far as I understand, you want to extract data from an app and use it with you app, isn't it?
That depends os how the app has the data stored, and almost all apps have the data stored in a way that you can't access it if you app don't have permissions to access it, and if that app don't offers a way of getting the data, you will need root permissions to access it, and for that the device must be rooted.
All that assuming that the data is on the device. Right now there are apps that save the data on internet, so you have to connect to the server the app connects and, using the same credentials to log in that the original app does, log and retrieve the data, and for retrieving the data you will need to use the same calls that the original app does. This is not good because at anytime the server calls needed to login or retrieve data can change and your app will be broken.
In other words, is impossible to access other app data in a normal way if that app don't have an API for your app to retrieve data.
Also if the app have an option to export data, then the user can export the data to a file in a common format so your app can open it.

Sqlite Database deleted when I clear data from Application

I have created Sqlite database in app. when I clear data from settings->applications->manage applications the Sqlite db removed. any suggestions to keep sqlite database as it is.
When you press Clear Data from the Android application manager its supposed to remove everything related to the app such as preferences, databases, caches etc the only thing that gets left is the app so when you re-launch it behaves as if it was just installed.
If you want to allow the user to clear the data but keep the database then there should be an option in the menu that removes the shared preferences but doesn't do anything with the database.
Hope this helps.
Android's SQLite is intented for local app data storage. When you opt to wipe your app's data, this data is wiped (as expected).
If you want to persist DB data, look into external storage (eg. the late Parse.com, or MS's Azure). You'll be making network calls, your local data will still be wiped, and you'll need to have a way to link your app back up with the external data post-local-wipe (eg. logging in) but your external data will survive an app data clear.
The "linking up" part can be mitigated as well depending on your use case, eg. Google Play Games' data services is tied to your Google Play id and will resync after an app wipe.
Why would you want to keep the data when the user wants to clear everything.
It is not suggested you keep the db.
I would suggest you use the sd card to store images/text files with the adequate permission from the user.

Persist Database across "Clear Data" in Android?

I am working on an android application which requires a database to store the value from the app.
My requirement is that I need the database not be cleared when the clear data option in the app is done.
Anyone please suggest me the location where the database can be stored so that is not deleted when clear data option is used.
I assume you mean the "Clear Data" from the Preferences->Apps menu.
I recommend you review your reasons for preventing this.
Hitting "Clear Data" would allow the user to reset the application as when newly installed, which really means recover from possible application errors you haven't thought about.
You can store the data into mysql database and use server php to get data from android
Try this link
Does storing on SD Card works for you?

Permanent data that the user can not delete

Hi all: I need to know if there is any way to make Android persistent data that the user can not delete, because if I use SharedPreferences or databases, it is possible that the user can delete all data from the Android menu, Settings - > applications -> Manage Applications -> "application name" -> Clear Data.
If I keep in the external memory also exist the possibility that the user delete or change memory device.
As always, thank you very much and sorry for my English.
Please check out Swarm's Cloud Data system. It provides a system extremely simple API (very similar to SharedPreferences) for set/get operations. Everything is saved to the cloud, and persists per user account.
This is not possible, your application does not have access to such kind of functionality. The only option you have... is storing data into a remote server.
Store it on your cloud app server.
I agree, If you do not want your users to be able to erase your data, you need to store it outside of the device, and access it via the internet.
You can use your own server for this, alternatively, I have used the Skiller SDK for my multiplayer game and noticed that they provide a simple data storage functionality (which frankly, i didn't use) but it seems like it would answers your needs.
Good luck.

Android choose where to install application's data

I'm wondering about one thing : I want to ask the user while first install my application where to save the data which will he receive after the first sync - on sd card or phone memory and let him to move the files if he first decide to store them in phone memory,but after that he decide to move them to sd card. My question is, which is the best way to remember his choice and build my logic depending on that. I was thinking about using SharedPreferences to save users choice :
editor.putBoolean("isSdCard",true);
editor.putBoolean("isPhoneMemory", false);
and after that use this booleans everywhere where I need to get the files, to get first the storage and then get the files.
Any other suggestions which will be a better solution in my case?
I don't know much of your App but if the following things apply to your app I may have another solution.
Your App can be move to the SD-Card entirely.
The data that is downloaded temporary, that means if the user wants to delete it it won't harm the app and the user can reload the data later.
It is not important that the user has access to the data via an external file browser
If this is the case get rid of the option. Options are always distracting the user from the main use of the app. Just set your install location to auto and let the user decide where to put your app. Now save the data to the cacheDir of your app.
The pros of this approach are:
The cache will be located on the SD-Card if the app is on the SD-Card and in internal memory if the app is in internal memory.
Furthermore the data is cleanly removed if the user deletes the App. If data is saved on the SD-Card there is no way to delete this data once the app gets deleted by the user.
The user sees how much memory your app is using in the applications setting panel.
If the user needs memory she can delete all files that are declared as not important by you through the applications setting panel without accidentally deleting important files like settings

Categories

Resources