Android 10: What are my options to save files on external storage into a directory called “/sdcard/my-app/”

In Android Q direct File access is disabled by default for the apps outside their private folders. Here few strategies you can use in your case: Use the manifest option requestLegacyExternalStorage to have the old behavior but it won’t work anymore with Android R, so it’s really a short term solution; Save your files using … Read more

Is there an API to detect which theme the OS is using – dark or light (or other)?

Google has just published the documentation on the dark theme at the end of I/O 2019, here. In order to manage the dark theme, you must first use the latest version of the Material Components library: “com.google.android.material:material:1.1.0-alpha06”. Change the application theme according to the system theme For the application to switch to the dark theme … Read more

How to directly download a file to Download directory on Android Q (Android 10)

More than 10 months have passed and yet not a satisfying answer for me have been made. So I’ll answer my own question. As @CommonsWare states in a comment, “get MediaStore.Downloads.INTERNAL_CONTENT_URI or MediaStore.Downloads.EXTERNAL_CONTENT_URI and save a file by using Context.getContentResolver.insert()” is supposed to be the solution. I double checked and found out this is true … Read more

Is adb remount broken on android api 29?

I started the emulator with emulator -avd Pixel_3a_XL_API_29 -writable-system -no-snapshot-load I found many ppl encounter emulator freeze and unable to start the android if you try $ adb root $ adb disable-verity $ adb reboot <— By now emulator is freezed Then you can try this $ adb root $ adb shell avbctl disable-verification <— … Read more

“Unknown bits set in runtime_flags: 0x8000” warning in Logcat on Android Q emulator

I bring a stone to the building. I retrace the code for the error message. It is at line 345 in the C ++ file dalvik_system_ZygoteHooks.cc At a minimum, if (runtime_flags! = 0) then the error message will be printed. 0x8000 also corresponds to the USE_APP_IMAGE_STARTUP_CACHE flag (see line 157). The test on the USE_APP_IMAGE_STARTUP_CACHE … Read more