How to lock and unlock a folder in android - android

I am just starting with Android. And my boss told me to find some good way to lock/unlock a folder with password in Android. Does anybody know how to implement this.
Any help will be greatly appreciated.
Thank you

In Android you only have "one user", (you have root too, but here doesnt count), so you cant lock a folder, because its your self. But if you are use one file with permisson to write, other app cant write. And if you want make something that you only open with a pass, like a FoldeGuard, you can make a file, that have your information with some Formatter, and You are the only person that can open that file, you can too asociate the file with you app and open automatically your app. So the simple way for me is, make a BD, that there you have all information you need and put password in the bd, or make a file that you asociate your app, and later when you open a file and put the pass you extract all information for a folder... I hope that ideas help you :)

Related

In terms of usability, what is the best way to export a file?

I have an android app which allows the user to gather research data. I want to export the gathered data as an excel file. So the user can work with the data on a desktop computer.
The question is, what is the best way in terms of usability to offer file export to the user?
On idea was to start the email client with the excel file as attachment. But if you have to send this email to yourself just to get the files seem kind of a workaround.
The second idea is to store the file in the android file system. But is there a commen folder for something like that? Like the "Documents" folder in windows? I dont want the user to search too long for his file. And is this really best practice?
The common way, is using the shared intent system and allowing the user to pick which app "he" or "she" wants to use to share the file. You can also save it to the android file system just as easily. There is no common folder which everyone should use. But if you want ease of accessibility for the file, create a new sub-directory under the top-level directory on the device. Use this method to get a reference to the top-level, Environment.getExternalStorageDirectory(). You must have the android.permission.WRITE_EXTERNAL_STORAGE permission declared in your app Manifest. The sub-directory name should be something obvious to that user that the data inside belongs to your app. Furthermore, display a toast that indicates to the user where the file is stored to make it even easier for them.

How to attach a picture from android gallery into my note app?

I'm developing a simple note app, some kind of diary but I need a function where I click on the "attach" button so I could attach files from internal and external memory from the phone, the files would be pictures and maybe, if possible, video and wav files, all of them together with the text file on the note app, and I would need to save all this in a database, so I would like to know if that is possible and how do I do it , I read about sharing files from apps to apps on android developer site but I got confused, so I would like someone to help if possible, btw sorry for my bad English I'm not a native English speaker and it's my first time asking here, so I would be glad of somebody could help with this.
Hi Leonardo Medina Lango,
You do not need to save whole file in your app's folder. Save only file path to your sqlite database. If you that files in your cloud than sync sqlite database with your cloud server from background service.

Android : use the explorer?

I want to allow the user to choose a file in the explorer. (Specifically a PDF file only)
I searched a little, but I don't arrive to find something in the developer doc Android.
There is nothing to do it easily ?
For example, I want something like GMAIL uses when the user wants to join a file to a mail.
Thx for help,
Sadfully, you have to write an fileexplorer yourself or us an external fileexplorer (which isn't always present). As I've got the same problem the last days, this might help you: https://stackoverflow.com/a/25724970/3960095. It's a filebrowser in a Fragment. Feel free to use it :)

android file browser preference

I have been trying to find a way to have a preference option where you can select a zip file from a file browser. How can I implement that in an app?
I also want to use the openrecoveryscript to flash that zip using TWRP recovery.
I can't seem to find any clear and definite answer.
I am also assuming my app will need root privileges to do all this. How do I implement that?
Any help would be appreciated. Thanks.

configure an android application

Guys, I need an android application that can be configured by the user. In java, we are using properties file to configure the applications. Any idea about the same in android..
Thanks in advance
I can guess you need preferences.
You can use SharedPreferences or PreferenceActivity (this article will be a good start).
If you want your files that can beaccessed from outside you should have some xml file in your resource folder or you can also sed a file along with your application and store iton external memory as andorid do not provide you feature of acessing private datas, toa ccess private datas u need content providers that will be overhead as in your case..
hence better, u bundle a xml file along with you app, which at deployment need to save a copy at sd card and once its there everytime you should check for that file..
this way user will be able to chnge the contents without even running the program, also other application will be able to access youir file
hope this helps

Categories

Resources