android-11

How to hint content manager chooser to open directly on a selectable position with ACTION_OPEN_DOCUMENT_TREE

筅森魡賤 提交于 2021-02-10 21:20:41
问题 When you use ACTION_OPEN_DOCUMENT_TREE to pick the permission to a path where to store files in Android 11, the default Android content manager by default opens on a recently used path and the button "USE THIS FOLDER" for some reason doesn't even appear at all, even if this path is an accessible path, unless the user manually move through paths to go to a suitable position (or returns in the path opened by default moving through directories if this is a selectable position). E.g. Assume the

Media not found on android 11 while trying to open file using ACTION_VIEW

不问归期 提交于 2021-01-29 08:08:46
问题 I have a method that I am using to open file from my application and it is all working fine till android 10 but when I try to open file in android 11 using google photos, it does not open it and shows Media not found toast. I am trying to open in any external app. Here is my method that I am using: private void openFile(String url) throws IOException { // Create URI StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.setVmPolicy(builder.build()); Uri uri = Uri

Not Working corss-application activities with taskAffinity in Android 11

一笑奈何 提交于 2021-01-28 20:24:49
问题 I have two application, App A and App B, now I want to start an activity in App B from App A, the launchmode of this Activity is “singleTask”. The order: Activity X (App A) ———> Activity Y (App B) ———> Activity Z (App B, launchMode=“singleTask”) As default AndroidManifest config, there will be two App shown in the Task Manager, I hope users can only see App A label in Task Manager, so when they switch between tasks they don’t click App B. Before Android 11(Android R), I use the attribute

Write permissions not working - scoped storage Android SDK 30 (aka Android 11)

北战南征 提交于 2021-01-27 20:32:12
问题 Anyone else finding scoped-storage near-impossible to get working? lol. I've been trying to understand how to allow the user to give my app write permissions to a text file outside of the app's folder. (Let's say allow a user to edit the text of a file in their Documents folder). I have the MANAGE_EXTERNAL_STORAGE permission all set up and can confirm that the app has the permission. But still every time I try val fileDescriptor = context.contentResolver.openFileDescriptor(uri, "rwt")?

What does QUERY_ALL_PACKAGES permission do?

冷暖自知 提交于 2021-01-27 05:06:31
问题 Android R Preview 1 introduced a new permission called QUERY_ALL_PACKAGES. The documentation for the permission says the following: Allows query of any normal app on the device, regardless of manifest declarations. Has anyone worked out what this actually does? I've tried running the following on the emulator image, and the permission had no effect on either of them: packageManager.queryIntentActivities(intent, 0) packageManager.getInstalledPackages(0) 回答1: They cover this more now that DP2

What does QUERY_ALL_PACKAGES permission do?

回眸只為那壹抹淺笑 提交于 2021-01-27 05:06:21
问题 Android R Preview 1 introduced a new permission called QUERY_ALL_PACKAGES. The documentation for the permission says the following: Allows query of any normal app on the device, regardless of manifest declarations. Has anyone worked out what this actually does? I've tried running the following on the emulator image, and the permission had no effect on either of them: packageManager.queryIntentActivities(intent, 0) packageManager.getInstalledPackages(0) 回答1: They cover this more now that DP2

can't control the initial directory where the SAF UI should start

為{幸葍}努か 提交于 2021-01-07 06:34:40
问题 I'm trying to save a text file using SAF (Storage Access Framework) but I can't control where it should be saved, I used this method from the Documentation as follows: private void createFile(Uri pickerInitialUri) { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("text/*"); intent.putExtra(Intent.EXTRA_TITLE, "new.txt"); // Optionally, specify a URI for the directory that should be opened in // the system file picker when

How to create folder (Android R - Api 30)?

故事扮演 提交于 2021-01-01 10:23:12
问题 Read that Android 11 has scoped storage, but I can't find any information, how can I create and use folder in /storage/emulated/0/ ? Old methods works only on api 29 and below :( 回答1: On Android 11 the restrictions in Android 10 concerning access to external storage are much less. Environment.getExternalStorageDirectory() is readable again and Environment.getExternalStoragePublicDirectory(...) is writable for folders like Environment.DIRECTORY_DOCUMENTS and so on. The Android OS is very picky

How to create folder (Android R - Api 30)?

限于喜欢 提交于 2021-01-01 10:23:06
问题 Read that Android 11 has scoped storage, but I can't find any information, how can I create and use folder in /storage/emulated/0/ ? Old methods works only on api 29 and below :( 回答1: On Android 11 the restrictions in Android 10 concerning access to external storage are much less. Environment.getExternalStorageDirectory() is readable again and Environment.getExternalStoragePublicDirectory(...) is writable for folders like Environment.DIRECTORY_DOCUMENTS and so on. The Android OS is very picky

SpeechRecognizer not available when targeting Android 11

本秂侑毒 提交于 2020-12-26 07:55:23
问题 While testing an application after increasing the targetLevel to 30, I found that the SpeechRecognizer is not available any more, i.e. SpeechRecognizer.isRecognitionAvailable() always return false. If I set the targetLevel back to 29, without changing anything else, it is available again. This happens on a real device (Pixel 3a) and the emulator. It doesn't seem to be a behaviour change. The only requirement mentioned by the Recognizer API is the Manifest.permission.RECORD_AUDIO I also found