Questions tagged [android-11]

For questions regarding programming in Android 11 (a.k.a., Android R), the primary 2020 version update for the Android OS.

Google released the Preview version of Android 11. Android 11 features [link][1]

https://developer.android.com/preview

796 questions
0
votes
1 answer

Use resolveActivity To Check if Intent Can Be Handled

I am trying to disable the camera launch button in my app if the camera intent cannot be handled by the device. I am targeting Android R (11). The code that I have so far is this val packageManager: PackageManager =…
Alex Lowe
  • 783
  • 3
  • 20
  • 43
0
votes
1 answer

SecurityException when calling getNetworkCapabilities on Android 11

I'm getting this exception even if I have ACCESS_NETWORK_STATE permission granted. Caused by: java.lang.SecurityException: at android.os.Parcel.createExceptionOrNull (Parcel.java:2385) at android.os.Parcel.createException (Parcel.java:2369) at…
Raluca
  • 41
  • 5
0
votes
3 answers

Cannot pass filepath to MediaRecorder in Android 11

I am passing filepath to MediaRecorder for creating video file. File(filePath).exists() returns false, but MediaRecorder fails with IOException, java.io.FileNotFoundException: /storage/emulated/0/DCIM/XXX/XXX0001.mp4: open failed: EEXIST (File…
Harish Vats
  • 662
  • 6
  • 21
0
votes
1 answer

Webview not call any callback when run on app dual in android 11 (samsung device)

i have a problem with webview when my app run as app dual in android 11 (samsung device). When i load a url like:mWebView.loadUrl("https://google.com") I had to set a WebViewClient and override some method like: onPageStarted, onPageFinished,…
Viet Tran
  • 1
  • 1
0
votes
2 answers

Widget can't start a service on device boot on Android 11 until some activity is launched

val startServiceIntent = TestService.getServiceIntent(context).let { PendingIntent.getService(context, 0, it, PendingIntent.FLAG_UPDATE_CURRENT) } val views = RemoteViews(context.packageName, R.layout.layout_app_widget).apply { …
0
votes
0 answers

ActivityManager: Foreground service started from background can not have location/camera/microphone access

When my app starts service from background there occurs log in the Logcat: ActivityManager: Foreground service started from background can not have location/camera/microphone access. And I am okay with that because it is known restriction in Android…
0
votes
1 answer

Facing trouble with image picker in release apk(Flutter)

The image picker works fine in the debug apk but crashes in the release apk. The picker opens the gallery to select the image but when I tap on it, throws the following exception PlatformException(already_active, Image picker is already active,…
0
votes
0 answers

Can't access to /Android/data even though targeting Android 10 on Android 11 and requestLegacyExternalStorage is set

I'm trying to read/write to /Android/data and /Android/obb folders in my app on Android 11. I already know it is impossible when targeting Android 11, so I wrote the following in build.gradle: compileSdkVersion 29 buildToolsVersion "29.0.3" …
0
votes
0 answers

What's the alternative for SystemProperties class methods and it's usages in java or kotlin?

I want to save the system settings for example if the user enabled glove mode or not. Currently, I am using SystemProperties.java class's set and get methods. But in android 11 I can't use these methods because the class itself is marked hidden and…
Bajrang Hudda
  • 3,028
  • 1
  • 36
  • 63
0
votes
1 answer

What is the difference between "storage/emulated/0" and "storage/caf-999"

Updated my Android version to 11 and found this What is the difference between "storage/emulated/0" and "storage/caf-999"
David
  • 1
  • 1
0
votes
0 answers

How to save pdf file in downloads directory for android api level 29 and above

I created a pdf file using itext pdf library and saving the generated pdf file in downloads directory. But it's not getting saved in devices running android api level 29 and above, error given below for the same. E/SQLiteDatabase: Error inserting…
0
votes
1 answer

Location permission prompt not showing in MIUI 12.1.4 Android 11

I'm having a problem in location permission prompt in MIUI 12.1.4 Android 11. It is not showing if there's PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION. Also, I console log the result and it gave me this ... …
0
votes
1 answer

Cannot use WifiP2pManager.setDeviceName on Android 11 (Wi-Fi Direct)

My team and I are working with Wi-Fi Direct technology on Android devices. Until now, the used devices were on Android 8, 9 and 10. We were able to change the Wifi P2P device name of the devices via the WifiP2pManager.setDeviceName…
0
votes
1 answer

E/MediaRecorder: setOutputFormat called in an invalid state: 32 on Android 11

Never saw this error, it started to appear on Android 11 when starting a video recording from automatically started foreground service when a device just booted (BOOT_COMPLTED broadcast) E/MediaRecorder: setOutputFormat called in an invalid state:…
0
votes
0 answers

How to make Gallery app on Andorid 10 + 11 show image saved to external storage

So I have the following code: fun saveMediaToStorage(bitmap: Bitmap, context: Context) { val filename = "${System.currentTimeMillis()}.jpg" var fos: OutputStream? = null if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { …
Idan Damri
  • 196
  • 10