Provide custom text for Android M permission dialog

No, you can’t customize the text of the dialog, but you can provide an explanation before request the permission. Quoting from developer.android.com: Request Permissions If your app needs a dangerous permission that was listed in the app manifest, it must ask the user to grant the permission. Android provides several methods you can use to … Read more

NameNotFoundException when calling getPackageInfo on Android 11

As stated in https://developer.android.com/preview/privacy/package-visibility: Android 11 changes how apps can query and interact with other apps that the user has installed on a device. Using the new element, apps can define the set of other apps that they can access. This element helps encourage the principle of least privilege by telling the system which other … Read more

Android 12 New Bluetooth Permissions

100% working solution : no need any 3rd party plugin manifest code: <!–BLUETOOTH PERMISSION–> <!– Request legacy Bluetooth permissions on older devices. –> <uses-permission android:name=”android.permission.BLUETOOTH” /> <uses-permission android:name=”android.permission.BLUETOOTH_ADMIN” /> <!– Needed only if your app looks for Bluetooth devices. If your app doesn’t use Bluetooth scan results to derive physical location information, you can strongly … Read more

Android Marshmallow: Changing permissions at run time crashes app

It’s because of additional features added from Marshmallow. You need to request from user at runtime. For this use this class which I have made. Then use it whereever required public class AppPermission { public static boolean isMarshmallowPlusDevice() { return Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1; } @TargetApi(Build.VERSION_CODES.M) public static boolean isPermissionRequestRequired(Activity activity, @NonNull String[] permissions, int requestCode) … Read more

Permission denied (missing INTERNET permission?): But permission is given

Did you try giving permission above the application tag? You should take care of order in which tags are defined in Manifest.xml. See structure of Manifest. Edited: <uses-permission android:name=”android.permission.INTERNET” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> <uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” /> <uses-permission android:name=”android.permission.CHANGE_WIFI_STATE” /> <uses-permission android:name=”android.permission.CHANGE_NETWORK_STATE” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> <application …> </application> Details: Order of defining tabs in Manifest: … Read more

Read logs from all apps on android from within an app for android 4.2+

Unless you rooted you cannot do this since Jelly Bean. See this Android bug report and this related discussion. Quote: The change is that third party applications can no longer get the read logs permission, however every app can read the logs containing only the lines they have written, without needing any permission. Keep in … Read more

Boot BroadcastReceiver does not work on Xiaomi devices

I searched around the web and found a solution, I’ve decided to answer my own question. Follow the same code given in the question. In Xiaomi devices, you just have to add your app to Autostart list, to do so, follow these simple steps given below: Open Security app on your phone. Tap on Permissions, … Read more