0

anyone cannot have the access to it or cannot modify the file .

why i am saving my information in the file t.

so , can anyone extend their help.

Thanks in advance.

  • Might be a duplicate of http://stackoverflow.com/questions/21179975/how-to-hide-folder-in-sdcard-programmatically-in-android – Sripathi May 19 '14 at 05:57

4 Answers4

2

I would suggest instead of putting inside the text file. You can encrypt the content which needs to stored in the text file and store it inside DB.

If you want to store 1 store as 2 in DB. while retreving from DB convert 2 to 1.

So even if user has access to DB they wont be able to get the encryption logic which you have written

2

If you want to hide file in Android or any Linux based system just add . as prefix to folder or file name.(This will prevent Android's media scanner from reading your media files and including them in apps like Gallery or Music.)

Use below code:-

public void hideFile(File file){
    File dstFile = new File(file.getParent(), "." + file.getName());
    file.renameTo(dstFile);
}
duggu
  • 37,851
  • 12
  • 116
  • 113
  • But it is not directly invisible (e.g. the Samsung stock file manager has an option to display such files and folders). So you cannot ever be sure that the user will not see the files, especially if the user uses different apps to access files on sdcard. – user3647469 May 19 '14 at 06:32
0

just rename your file to ".r" instead of r , and file is hidden since its name begin with "." so use as below FILE *licenseFile = fopen(LICENSE_LAUNCH_TIME_FILE_PATH, ".r");

Hope it will your problem and One thing the file is shown in some specific app which can display hidden file

tizbn
  • 1,907
  • 11
  • 16
0

It doesn't matter where you store the lic file on the device a determined user can open up any file sdcard ( a root user can open any file in your system). the best way is to create a simple webserivce to record user time and check back later Or store the data in sdcard in encrypted file ( but if remember user can always delete file ). If you are serious licensing try some topics like "google cloud backend for android ", "google app engine" etc, of course it will add more effort but you will have more flexible and future ready application.

nizammoidu
  • 2,074
  • 1
  • 14
  • 14