android-permissions
Android manifest POST_NOTIFICATIONS missing import
Just add this import: import android.Manifest
Permission denied in Android Emulator Device File Explorer
/sdcard is a symlink to /storage/emulated/0. You should therefore be able to see external files for your app in /sdcard/Android/data/<your app>.
How to detect Bluetooth state change using a broadcast receiver?
AS far as permissions go, to detect the state change of bluetooth you need to add this to your AndroidManifest.xml. <uses-permission android:name=”android.permission.BLUETOOTH” /> An example receiver would look like this, you add this code to where you want to handle the broadcast, for example an activity: private final BroadcastReceiver mReceiver = new BroadcastReceiver() { public … Read more
What’s the difference between ACCESS_NETWORK_STATE and INTERNET?
From the documentation: ACCESS_NETWORK_STATE: Allows applications to access information about networks INTERNET: Allows applications to open network sockets. In short, the INTERNET permission lets you use the internet, whereas ACCESS_NETWORK_STATE will just give you information about the network, such as whether you are connected to a network at all. You can use either one without … Read more
Ask permission for push notification
UPDATE 2022 The way we request permissions on Android has changed drastically with Android 13. Please see other answers below that mention the same. As answered here, you don’t need permissions for push notifications. Actually the push notification permission lie in the normal category permission like Internet permission, not in dangerous category permission. You don’t … Read more
Android 11 users can’t grant background location permission?
Credits for the answer to @Stephen Ruda I have run into the exact same problem. I agree that this is an issue for any developer who needs background location permission. I would like to add additional notes for other readers: (1) On API 30+ you will first need basic location permissions before asking for background … Read more
Request Location Permissions from a service Android M
You can not request permission via a service, since a service is not tied to a UI, this kind of makes sense. Since a service context is not an activity the exception you are getting makes sense. You can check if the permission is available in a service and request the permission in an activity … Read more