liveoverflow Bot ,
@liveoverflow@bird.makeup avatar

Need an Android expert.
I have declared the following activity. When another app exports a file on Android 10, my app shows up as an option.
But Android 11 or later it always uses the default Files app, never shows my app as an option. Anybody know why?

image/png
image/png

warlockk87 Bot ,
@warlockk87@bird.makeup avatar

@liveoverflow Have you checked the configuration of the app that exports files? In Android 11 the package visibility feature was added, and in some pocs I built I had that type of problems: https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9. You should check the Android Manifest for that config.

liveoverflow OP Bot ,
@liveoverflow@bird.makeup avatar

@warlockk87 thanks for sharing. in this case the app actually has QUERY_ALL_PACKAGES

xezrunner Bot ,
@xezrunner@bird.makeup avatar

@liveoverflow Does it not show up in the hamburger menu of that Files picker?

liveoverflow OP Bot ,
@liveoverflow@bird.makeup avatar

@xezrunner ahh that is a good pointer. I do see two other apps there.

luca020400 Bot ,

@liveoverflow I'm pretty sure the default file manager was locked down to "only system" apps in some Android version not so long ago, that would be it?

liveoverflow OP Bot ,
@liveoverflow@bird.makeup avatar

@luca020400 could definitely be the case, but do you have a source?

luca020400 Bot ,

@liveoverflow https://developer.android.com/training/data-storage/shared/documents-files#create-file
Says it uses the "system file picker"
I'll search for the actual AOSP code, but I think it's related to the MANAGE_DOCUMENTS protected permission.

luca020400 Bot ,
liveoverflow OP Bot ,
@liveoverflow@bird.makeup avatar

@luca020400 But MANAGE_DOCUMENTS was apparently introduced in API 19, and in API 29 it still worked. Seems to be a change to API 30.

Also I tried the provider, but it doesn't show up in the chooser either.

luca020400 Bot ,

@liveoverflow The provider makes it show up in the documents UI (file picker), I'll keep looking, but I clearly remember that changing to only allow the system to provide the handler for those actions (for security/UX)

liveoverflow OP Bot ,
@liveoverflow@bird.makeup avatar

@luca020400 I see another app that has such a provider to show up in the system file picker. Though mine doesn't show up yet. But that's a good pointer I will investigate :)

luca020400 Bot ,

@liveoverflow well if they managed to get it working, it's either target SDK or something different in the manifest.
Nothing a quick look with apktool won't solve

liveoverflow OP Bot ,
@liveoverflow@bird.makeup avatar

@luca020400 I want to get it to work on default latest target SDK though. Also I'd like to read the documentation lol
How is anybody able doing Android development T_T

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine