i want to make and folder and all directory undeletable by user:
basically my app has large files and i want to play it from external sd card now problem is that most user delets them by mistake how can i prevent it
i also tried hiding foler by giving prefix . but its now working i name file .myfile but still i am able to view this file any idea ???..
Rather than populating a folder on the user's device, you could use an expansion file. http://developer.android.com/google/play/expansion-files.html
Related
Well, I tried to search in google and SO, but didn't find much mainly because I am not sure what should be my search word. So, if anybody thinks this question is too generic and should be searched first, please help me providing some useful link.
What I want is, to have two buttons in my App which should download sample.csv and sample.php (I want to attach this file inside my App) file and save it to user directory, preferably in "download" folder or somewhere user can access easily.
I found this page by searching but here they demonstrates saving File on Internal Storage in App's folder only. Now I am confused whether this App's folder is accessible by browsing or not (I can't find my app's folder in my Samsung Note 2).
Another question pops up in my mind is, whether I have to read those sample files and create new file to save, or I can simply put a link and download the sample files I provided (more like HTML link)? Or may be I can just upload those sample files in my web server as zipped and give a link to dload?
Apology for my long email, but I am confused where to start.
Thanks,
You can not access your app's internal directory. However, what you can do is to use InputOutputStream to copy your file from the internal directory to your desired folder, and then delete the file from the app's directory. Try searching for copying files and you'll find multiple links.
I have an android application I am developing in Java.
I need it to load a text file so it can read what is in the text file and get values from it.
However, everything I have read so far has been directing me to use resources and package it up with the application.
However this means if I want to change the text file, I have to reinstall the application, which is not what I want.
I need to end up with the .apk file and the .txt file in the same folder on my android phone so I can change the .txt file and the app reads in the text file in its directory.
Can anyone help?
No, you do not want to end up with the .apk and the .txt file in the same folder.
You want to end up with the .txt in some place that's always the same and that you know about.
You can deploy the initial .txt via the ressources (aka: package it and copy it to the sd for example) and later download a new version (or copy something to the device via usb).
Then inside your app check if the file exists and open it with standard Java. There's plenty of source around for that.
I need to store and read objects in Android, these Object must be available until they are manually deleted through the app.
Since I cannot use the assets folder for this,
How could I store objects in an hide folder to access them in future?
Well, you can keep them in your app specific directory in SD card. If you want the content inside your directory should not be scanned by mediascanner (so that they will not appear in Gallery etc), you need to keep a ".nomedia" file in that directory.
for example, create a directory called "mytestapp" in sdcard, and keep a ".nomedia" file there, along with the files you want to store
I'd like to take a few zip files - file1.zip file2.zip file3.zip etc. and create an APK file which contains them and when installed simply copies them to a specified directory on the sd card of the phone.
Can this be done in just a few lines of code? I really appreciate any input. Thank you.
Anything you put in res/raw is available as a resource you can work with once your app is installed. I'm curious why you want to move zip files to the device without having a "real" app to go with them.
I am creating android application which contains DB that needs to be hidden(not able to access by the user)in the SD Card. Can anyone tell me how to do this?
Any file stored on the SD card is accessible both by applications running on the phone, and by users who have mounted the SD card (both while it's in the phone and otherwise).
You can change the file properties to make it 'hidden', but it will still be easily found. There is no way to make a file on a public partition like an SD Card 'secure' in the manner you describe - users will always be able to copy, delete, and potentially change the file.
The best solution to your problem is to look into ways to encrypt your database to record it securely. You won't be able to prevent users from deleting or copying the file, but you should be able to make it difficult for them to read data from it or modify its contents.
For an easy solution, just prefix the db file with a . (like .dbfile). This will hide the file on Linux based systems, including android.
I am assuming that you want to hide the file to prevent users from accidentally deleting/changing it.
SD cards cannot be secured in the fashion you seek.
just name the file start by ."Dot"... ".myFolder/.myfile"
You can create a folder whose name starts with a dot(.) example (.dbfiles) android See these folders as configuration folder and do not show content of these folder in applications like gallery,music player...You can see these folders with advance file explorer like Es File explorer
Sdcard you cant't! Internal app data partition is the place for you.