0

I'm building a toolkit to carry out Root management related functions (not managing root access, but simplifying some system functions), and one of them replaces various system binaries with custom versions that the user chooses. I'm having a bit of difficulty however, in the actual invoking the stock file browser built into 5.1/6.0. I cannot seem to get it to work. Does anyone have a simple piece of example code that shows how to invoke said file browser, and load the chosen file's absolute directory into a variable? Thanks! :3

Alison E.E.
  • 196
  • 7
  • 2
    Android does not have a "stock file browser". The closest thing is `ACTION_OPEN_DOCUMENT`, and there the user chooses a piece of content from various document providers. You get a `Uri` back, as there is requirement for the content to actually be a file. – CommonsWare Jan 27 '17 at 00:08
  • There is a stock file browser build into Android 6.0+ (and select branded 5.1 ROMs). It can be invoked by the user by opening Settings>Storage & USB>"Explore". It contains basic functions such as creating new folders, copying or moving files, and opening files with recognized extensions, or files that have a default app assigned to them. It is, as I said present in AOSP builds of 6.0 and select branded versions of 5.1, and is an extended version of the Downloads app. Not to mention many ROMs/builds come with built in stand-alone file managers, which would also count, and would work if invoked. – Alison E.E. Jan 27 '17 at 00:15
  • Ah, OK, my apologies. I keep forgetting that they buried that in there. You'd have to trace through the Settings code and see what they have tied to that option. – CommonsWare Jan 27 '17 at 00:32
  • No hard feelings, they did pick a very convoluted place to put the launcher. I don't have the source for AOSP 6.0 downloaded at the moment, would it be enough to make a copy of the `SecSettings.apk` from my AOSP installation and decompile it? I've done this to modify graphics in the app when making custom ROMs before, but I have never actually tried to find the .XML or .JAVA files inside of one before, and admittedly don't know whether or not they would be present. – Alison E.E. Jan 27 '17 at 01:28
  • I'd just [browse the source online](https://android.googlesource.com/platform/packages/apps/Settings) (or [the GitHub mirror](https://github.com/android/platform_packages_apps_settings)), plus [use an OpenGrok](http://xref.opersys.com/). – CommonsWare Jan 27 '17 at 01:33
  • Thanks, I hadn't realized there was a GitHub mirror, I had always assumed it was relegated to the Android developer site. With that, I'll come through it and try to find the function that opens the FM, thanks again! – Alison E.E. Jan 27 '17 at 01:42

0 Answers0