android-developer-api

Android - How to check if Developer option is enabled

落花浮王杯 提交于 2019-11-30 22:10:16
How can I check if the user has developer option enabled on its device? (not with adb comunication active, or debug USB active, I need to know only if Developer Option are enabled). I've tried this solution: How to check programmatically whether app is running in debug mode or not? but it doesn't work for me. Thanks in advance try this: int adb = Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0); You should use getInt or another in Settings.Global with DEVELOPMENT_SETTINGS_ENABLED Edit : Below API 17, it is the same but with Settings.Secure

SecurityException: Permission Denial: reading (only on emulator)

核能气质少年 提交于 2019-11-29 01:19:12
I have two activities in my app, MainActivity calls ImagePicker, which has a GridView laying out all the images in the phone gallery, where I use a ContentResolver to get the cursor. It worked fine on my phone when I tested it but crashed every time instantly on emulator. Here's the error log: java.lang.SecurityException: Permission Denial:reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=5934, uid=10060 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() I do have permission written in manifest, as shown below: <uses

SecurityException: Permission Denial: reading (only on emulator)

删除回忆录丶 提交于 2019-11-27 15:47:05
问题 I have two activities in my app, MainActivity calls ImagePicker, which has a GridView laying out all the images in the phone gallery, where I use a ContentResolver to get the cursor. It worked fine on my phone when I tested it but crashed every time instantly on emulator. Here's the error log: java.lang.SecurityException: Permission Denial:reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=5934, uid=10060 requires android.permission.READ

java.util.zip.ZipException: duplicate entry

余生颓废 提交于 2019-11-26 14:46:44
I have been battling this error all day in Android Studio. Project was imported from an eclipse solution. I have been trying to implement all fixes that are listed for similar posts, nothing is working. I am an Android beginner. I will be happy to provide any further information. Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. java.util.zip.ZipException: duplicate entry: com/google/zxing/BarcodeFormat.class Please help!! Should I just try to get it to run in Eclipse? // Top-level build file where you can add configuration options common to all sub-projects/modules.

java.util.zip.ZipException: duplicate entry

断了今生、忘了曾经 提交于 2019-11-26 04:01:31
问题 I have been battling this error all day in Android Studio. Project was imported from an eclipse solution. I have been trying to implement all fixes that are listed for similar posts, nothing is working. I am an Android beginner. I will be happy to provide any further information. Error:Execution failed for task \':app:packageAllDebugClassesForMultiDex\'. java.util.zip.ZipException: duplicate entry: com/google/zxing/BarcodeFormat.class Please help!! Should I just try to get it to run in