Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android where to save personal data?

I have a dilemma, i need save some security data on my Android device, this data is login information to personal cabinet, so can you please, give me an advice where is better to save this info into simple txt file(but what about security?) or maybe is there analog of MySQL DB in Android platform(and how i can access it)?

like image 611
vladimir Avatar asked Sep 06 '25 04:09

vladimir


2 Answers

The best way to store personal data in Android application is using shared preferences with mode private, so that nobody can access that data other than your application. for more details see Android developers tips about shared preferences here.

like image 59
Shridutt Kothari Avatar answered Sep 09 '25 01:09

Shridutt Kothari


AFAIK you cannot run MySQL on a android device but you can use SQLite (tutorial). You could even try using SQLCipher to store it in a encrypted database. Although I'm told it's not too hard to extract the access key from your APK.

When you store you password, make sure you encrypt it (even if you are encrypting the database). Storing passwords as plain text is rarely a good idea ;)

Whatever you do, do NOT store it in a text file!

like image 35
ingh.am Avatar answered Sep 09 '25 02:09

ingh.am