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
5
votes
3 answers

How can I get the MAC address from an Android device with Android 11?

We are using NetworkInterface.getHardwareAddress() to get the MAC address, but as we can see from MAC address availability changes in Android 11, now it will not be used for Android 11. Is there a solution to this or any guideline?
Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
5
votes
2 answers

Android 11 - window.setDecorFitsSystemWindow doesn't show screen behind Status and Navigation Bars

I'm trying to update my App to Android 11. Many Screens of my App were Designed with App Content behind the StatusBar. I Updated my gradle to Android 11 and started updating the Window code to get the No Limit behavior also for Android 11 Devices. I…
Distra
  • 2,260
  • 2
  • 14
  • 23
5
votes
2 answers

Android 11. ContentResolver.query return empty cursor

I have implemented the selection of contacts from the phone book in my application. In order for the intent with action PICK to work on android 11, I added this to my manifest:
5
votes
0 answers

Android 11 5G fetching Cell Parameters

I am trying Android 11 on network type 5G on new Android studio preview release. My aim is to fetch Cell Info details. However , the method getAllCellInfo() returns an empty/null list on emulator. All emulators priori to Android 11 do return a valid…
Richa
  • 66
  • 3
5
votes
1 answer

Android 11 Media store - cannot record new videos on relative path. It works with Environment.DIRECTORY_MOVIES path but not not with sub folder

My code runs perfect on any Android lower then Android 11. On Android 11 (specifically on Pixel2 & Pixel3 emulator and real devices) the file descriptor fail to find the file after inserting it to the media store. If I change the relative path on…
kfir
  • 635
  • 8
  • 27
5
votes
1 answer

How is QUERY_ALL_PACKAGES enforced?

Android 11 (target 30) introduces Package visibility restrictions. They added the QUERY_ALL_PACKAGES that allows bypassing these restrictions, and only specific apps are allowed to use it. The protection level for this permission is NORMAL, and so I…
dors
  • 5,802
  • 8
  • 45
  • 71
5
votes
0 answers

cordova.file.getExternalCacheDir() returns null in android 11 emulator

I am trying to test my hybrid app with android 11 emulator provided in android studio. But, on requesting filesystem, the cordova file plugin is returning null values in externalRootDirectory. In my code, I have checked this value to initialize app…
Subham
  • 51
  • 4
5
votes
0 answers

setGravity method is no-op - when called on text toasts

In the official android docs, it is mentioned that the setGravity method on toasts will be no-ops, when called on text toasts - with apps targeting Android Build.VERSION_CODES#R, My own understanding from above is the text toasts with setGravity…
AADProgramming
  • 6,077
  • 11
  • 38
  • 58
5
votes
0 answers

jobScheduler throttling specifications Android 11 (api 30)

I'm developing an app which heavily relies on jobScheduler to perform multiple tasks in the background. As of the next api version (android11, api 30), the documentation (and in the developer preview) states: JobScheduler will throttle runaway…
Nissim
  • 6,395
  • 5
  • 49
  • 74
5
votes
5 answers

How to get file path given a tree URI on Android 11?

We only get a tree URI when a user selects a folder using the storage access framework. The docs mention that starting Android 11, we can use raw file paths to access files. I need this so that I can use an existing native library. But I can't find…
Ganesh Bhambarkar
  • 930
  • 1
  • 8
  • 9
5
votes
3 answers

Is AsyncTask deprecated now with the existence of AsyncTaskLoader?

To the best of my knowledge, AsyncTaskLoader not only has all the capabilities of AsyncTask but also incorporates best practices such as avoiding duplicate threads and premature death built-in. Is there any justification for using AsyncTask anymore,…
AlanSTACK
  • 5,525
  • 3
  • 40
  • 99
4
votes
2 answers

Android 11 SYSTEM_ALERT_WINDOW behaviour changes with SurfaceView

Some time ago with Android 11 SYSTEM_ALERT_WINDOW draw-over-applications touch behaviour was limited with a number of exceptions. Interactions within your app. Accessibility windows Input method editor (IME) windows Assistant windows Completely…
Arturs Vancans
  • 4,531
  • 14
  • 47
  • 76
4
votes
1 answer

Intent.FLAG_ACTIVITY_REORDER_TO_FRONT not working in android 11

I need to bring the app from background to foreground when push notifications arrives. This code works fine on versions prior to 11. @Override public void onMessageReceived(RemoteMessage remoteMessage) { ... Intent intent = new Intent(this,…
Aramillo
  • 3,176
  • 3
  • 24
  • 49
4
votes
5 answers

Android 11 not fetching path for file

I have been working to fetch file path from storage till now, For example file path is /storage/emulated/0/Download/NTL_ANDRODI_DOGMA_SYSTEMS_SRL_A_SOCIO_UNICO_TEST NEW.afgclic After android 11 it's unable to fetch FilePath. After giving…
4
votes
2 answers

How to fetch files inside hidden folder using Media Store API on Android 11

I need to fetch data inside WhatsApp folders on External Storage. As i am targeting API Level 30 i am no longer able to access WhatsApp folders on External Storage. I have implemented Storage Access Framework and got Android/media folder Uri and…