android-permissions

Android Permission denial in Widget RemoteViewsFactory for Content

橙三吉。 提交于 2019-11-28 23:29:18
I have a widget which I am trying to use to display information from my app's local database inside of a listview. I'm using the RemoteViewsService.RemoteViewsFactory interface to load my list's contents. If I run the block of code which reloads the list in the onDataSetChanged method. the app crashes with the following message: 11-01 16:40:39.540: E/ACRA(27175): DataDisplay fatal error : Permission Denial: reading com.datadisplay.content.ContentProviderAdapter uri content://com.datadisplay.provider.internalDB/events from pid=573, uid=10029 requires the provider be exported, or

java.io.filenotfoundexception open failed eacces (permission denied) on device

我与影子孤独终老i 提交于 2019-11-28 21:27:56
The following code which consists of downloading a file from a server and save it in the storage works fine when the device has an internal storage. But when I tried it with a device with no internal storage, only with external storage I get the following exception. java.io.filenotfoundexception open failed eacces (permission denied) public void downloadFile(String dlUrl, String dlName) { int count; HttpURLConnection con = null; InputStream is = null; FileOutputStream fos = null; try { URL url = new URL( dlUrl ); con = (HttpURLConnection) url.openConnection(); con.setDoInput(true); con.connect

When do I need android.hardware.location.gps and android.hardware.location.network?

核能气质少年 提交于 2019-11-28 18:51:27
问题 Google is informing by email of changes to the Android location permissions: We’re making a change on October 15th, 2016 that will affect apps targeting API version 21 (Android 5.0, Lollipop) or higher that use ACCESS_FINE_LOCATION but don't explicitly have the "android.hardware.location.gps" uses-feature. Going forward, these apps will be available to install on devices that don't have GPS hardware. In most cases this won't be an issue since Wi-Fi and Cell-ID based location provides high

If I have ACCESS_FINE_LOCATION already, can I omit ACCESS_COARSE_LOCATION?

只谈情不闲聊 提交于 2019-11-28 18:30:46
I have a GPS app that already requests ACCESS_FINE_LOCATION permission in the manifest, now I want to add a library (MoPub) that requires ACCESS_COARSE_LOCATION . Am I correct in assuming that ACCESS_FINE_LOCATION is enough, and I can leave out ACCESS_COARSE_LOCATION from my manifest? https://developer.android.com/guide/topics/location/strategies.html#Permission Note: If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the ACCESS_FINE_LOCATION permission, because it includes permission for both providers. (Permission for ACCESS_COARSE_LOCATION includes

How do I use adb grant or adb revoke?

落花浮王杯 提交于 2019-11-28 16:26:25
问题 The Android documentation contains the following description of the adb grant and adb revoke commands. grant <PACKAGE_PERMISSION> Grant permissions to applications. Only optional permissions the application has declared can be granted. revoke <PACKAGE_PERMISSION> Revoke permissions to applications. Only optional permissions the application has declared can be revoked. Can anybody please give an example of the correct syntax to use them? I assume that would be a permission like android

Listing permissions of Android application via adb

↘锁芯ラ 提交于 2019-11-28 16:11:26
Using adb, how can I find out the which permissions an Android application requires? Because I want to display the permissions of multiple applications on different devices, viewing them in Google Play or Settings > Applications manager requires too much manual work. I just wanted to combine Jason's and Juuso's answers together and notice that the former lists permissions that were granted , while the latter lists permissions that were requested (including ones that were granted). To see only permissions that were granted (but omitting ones that were requested but not granted) use adb shell

How does storage access change on Android 6?

不问归期 提交于 2019-11-28 16:04:53
Background Android had a lot of changes as to how to handle the SD-card and storage in general: API 3 - you get all access, no permission needed API 4-15 - you need to use WRITE_EXTERNAL_STORAGE, and you get all access. API 16-18 - if you wish only to read, use READ_EXTERNAL_STORAGE API 19-20 - you can't read or write to secondary external storage (SD-card), unless your app is a system app, or you have root. API 21-22 - in order to access the SD-card, you need to ask the user for permission, and use the DocumentFile API instead of the File API. This raied a lot of questions, as I've written

The method checkSelfPermission(Context, String) is undefined for the type ContextCompat

你说的曾经没有我的故事 提交于 2019-11-28 13:42:48
Context context; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Context context = (Permission) this; // In an actual app, you'd want to request a permission when the user // performs an action // that requires that permission. if (Build.VERSION.SDK_INT >= 23) { getPermissionToReadUserContacts(); } } // Identifier for the permission request private static final int READ_CONTACTS_PERMISSIONS_REQUEST = 1; // Called when the user is performing an action which requires the app to // read the // user's

SMS Messages of a particular number not showing up on other devices Android

老子叫甜甜 提交于 2019-11-28 12:58:48
问题 I am using the Telephony.Sms library to load in received and sent sms messages for the app I am working on. When I set the query selection to null (the third item in the query), it will show all the sent and received sms messages on the different types of phones I have been testing on. Cursor c = cr.query(Telephony.Sms.CONTENT_URI, null, null, null, null); But when I set it to a particular number, on the Samsung S9 phone running on API 27 it is not showing any sms messages. On the Nexus

Get application names with specific permission

拟墨画扇 提交于 2019-11-28 12:43:53
I want list of all applications installed on the device which use a specific permission like INTERNET. i am using this code , but not able to retrieve results , please help . private ArrayList<String> getInstalledApps(Context context) { ArrayList<String> results = new ArrayList<String>(); PackageManager packageManager = context.getPackageManager(); List<PackageInfo> applist = packageManager.getInstalledPackages(0); Iterator<PackageInfo> it = applist.iterator(); while (it.hasNext()) { PackageInfo pk = (PackageInfo) it.next(); if (PackageManager.PERMISSION_GRANTED == packageManager