Real phone, Android Gingerbread, I deploy my app to the phone, trigger file selection, file chooser shows up, I navigate to the folder I want, tap on the file, voila, file loaded.
Android emulator, Android Oreo, I deployed my app, I uploaded the file using adb to "\scard\Download", I triggered file selection, file chooser showed up, I navigated to "Downloads", I clicked, I double clicked on the file -- nothing happened (i.e. file chooser was still on the screen).
I killed my app, so now the file was present before app was launched, I deployed my app again, still same behaviour.
I launched adb shell
, I checked permissions of the file, just in case I set +r
for user, group, others, still I cannot select the file.
My app has WRITE_EXTERNAL_STORAGE
permission set in manifest, besides it looks like I cannot select/choose the file in chooser (not read in my app). I don't have any experience beside my phone (Gingerbread) so I am not sure if something was changed in later version in file chooser.
Anyway, what am I missing -- what is needed to actually select/choose the file in Android Emulator?
If this matters, I use Visual Studio 2017, C#/Xamarin.
Following @CsabaFarkas tip this is what I did. I launched Android Virtual Machine Manager (from Android Studio, because VS failed on me), there I set up the virtual image with Google Play present. I started emulator, I set up my account, I executed Google Play and downloaded some file manager.
Then when file selection is triggered, from the file chooser menu I selected newly installed file manager, and there I selected the file. File is selected (I can double click on it) and my app reads it.
As for the step with installing android image using GUI manager I guess it can be done using command-line as well, only knowing what to install. In my case it was probably:
system-images;android-27;google_apis_playstore;x86