Re: Help! Ant Android Studio gurus out thyere?
DickyAus wrote:
Oops, Ant should be Any.
When I go 'bush' for a photo trip I travel light. To secure my daily photos I use my Samsung A5 (2017), an Orico USB hub and some large capacity USB sticks. I have always used the built in facilities to handle the copying of files from SD Card to USB sticks. A clunky interface, but it works.
Since we are in lock down I thought I would amuse myself and write an App to automate the process and make life that bit easier.
Extensive searches of the web led me to try two approaches - USB Manager and Media Manager interfaces. Shown below is how far I got: (sorry about the poor quality of the photo)

I have two SD cards in my EM1.2 they show up as devices as shown above
Through USB manager I can see some info and through Media Manager I can see other things. But nowhere can I see everything I really want - I really need access to the USB devices file directory structures I can drill down through to select files and destinations for backups. Both managers return some sort of path or Directory file, but I can't find any way to use them. In the first photo the first four lines are derived from Media Manager and the last three from USB manager. The A5 is limited by Android 8 SDK 26.
To make matters worse I can't connect to the USB hub and to the computer to debug at the same time. Alas, with an AMD PC the emulator doesn't work either.
If anyone knows how the access USB media file structures by JAVA code I would really appreciate a few pointers.
Dicky.
PS. The first photo shows some numbers on the paper to the right of the phone. The lower number pair is my blood pressure when I started writing the App, the one above it shows what it was when I got Media Manager working, and the one above that is what is was when USB Manager was working.
I've never needed to browse the file structure from an app, so I'm just guessing and Googling. Does Storage Access Framework help? I also found this on stackoverflow, which gives a couple of links: https://developer.android.com/guide/topics/providers/document-provider.html .