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 :)
Related
As part of an app I'm writing, I need an ability to look for specific files, like .doc or .rtf, from within the app. After finding them, the app will store their adress or something like that, so that they could later be opened when necessary. The app wouldn't open them itself, it will use a different app for that. So, all I'm looking for is a way to browse for those files from within my app.
As i understand you need to find files with given extension. For this approach you can use FileFilter. Check this answer.
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.
I've done my fair share of searching for tutorials and guides online, but the only stuff I have found is from 2007 and out of date.
I wanted to know how to open a file from within my current application. For instance, if I click a "Browse" button, it will start another activity of a default file browser on the device (I don't have to implement my own, right?). Obviously I would need it to return the file so I could parse through it as I pleased.
I figured it would be some for of Intent binded to the the button, but I'm now sure.
Bad news - there is not a native "file selector". Good news - this guy made one so you don't have to.
Use Environment.getExternalStorageDirectory() instead of hard-coding the directory path to the SD card. There also seems to be a problem with getting the exact SD card directory using Android 3.0 and 3.1. I have a test app that reads and writes fine in Android 2.3.3 but the same piece of code doesn't work anymore (see https://stackoverflow.com/questions/6545478/android-3-1-sd-card-emulation).
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 :)
I would like to let user pick directory and save downloaded file (my app downloads file).
I know that some tools (for example, ES File Explorer) provide such intent-filters.
see http://www.estrongs.com/en/support/developers.html. I start activity for result and then get selected folder as a result.
Also, I know that there are no "select folder" intent standards (I can't use the same intent with other tools). Do you know other tools to support such functionality ? I would like to let user use his tool, not ES File Manager.
Also, does Astro provide such intent filters? I can't find this info on their page. (I think astro is the most used file manager for android)
I've recently come across something that might potentially help here:
http://www.openintents.org/en/node/159
It has a demo application showing how it can interact with third party applications as a file/directory picker.
That said, I have not tried it yet. I stumbled across this question as I am still looking for other options.
Edit: actually, it looks very similar to your ES File Manager link. Perhaps it is merely a clone.
Here is complete Android library: https://github.com/lemberg/directory-selector-dialog-preference
It can be used either as DialogFragment or as DialogPreference. I am it's author so don't hesitate to ask any questions.