0

I have a question and I hope you can help me with it.

I created an aplication that need to store a data in the Android device THAT NOBODY CAN ACCESS apart from me in the source code.

I search for it a I found the FileOutpuStream and FileInputStream solution :

private String file="mydata", data;


FileOutputStream fOut = openFileOutput(file,MODE_PRIVATE);
                fOut.write(data.getBytes());
                fOut.close();

and

FileInputStream fin = openFileInput(file);

My question is where is the file created store ? And is it sure that nobody can access it even if they find the file in their device ?

Kolopox
  • 276
  • 1
  • 4
  • 17

1 Answers1

2

The file is created in the phone's internal memory and only your app can access it.

Pretty sure it's not 100% reliable as it's just a file, you'd better find something else. Rooted android can access to whatever file they want.

EDIT: Read the two first lines of https://developer.android.com/guide/topics/data/data-storage.html#filesInternal

  • Yeah I used this website to find this methode but didn't really understand if it was full secure or not... What do you think of SQLite database ? Can you access the data in a rooted android ? – Kolopox Apr 27 '17 at 09:48
  • Sorry for the late answer, I'm pretty sure you can access it on a rooted android as it is a local database, it will be like a regular file. I don't really know how you could deal with this problem... Maybe access to an online database protected by a password? – Antoine Laborderie Apr 27 '17 at 12:32