I have the following permissions explicitly requested in my manifest.
I would like to optimize store visibility by switching as many as possible of them to implicit 'uses-feature' declarations. I will also handle this additionally in code checking for features before I access them.
Internet access is the only thing that's truly required for my app, other features I can enable/disable conditionally based on hasFeatures().
Question:
Which of these permissions can I change?
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.android.vending.BILLING" />
<permission android:name="com.appName.supportmapfragment.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.appName.supportmapfragment.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
Set required to 'false' if your app doesn't require something to run:
To control filtering, always explicitly declare hardware features in
elements, rather than relying on Google Play to
"discover" the requirements in elements. Then, if
you want to disable filtering for a particular feature, you can add a
android:required="false" attribute to the declaration.
http://developer.android.com/guide/topics/manifest/uses-permission-element.html (in the right-hand sidebar)
The documentation has this example:
<uses-feature android:name="android.hardware.camera" android:required="false" />
Related
I am using the CrossGeeks Geofence plugin found here:
https://github.com/CrossGeeks/GeofencePlugin
Using the documentation on the home page and the sample found here to build a test app:
https://github.com/domaven/xamarin-plugins/tree/master/Samples/Geofence
I encounter this error when I try to start monitoring a region:
{System.NullReferenceException: Object reference not set to an instance of an object.
at Plugin.Geofence.GeofenceImplementation.RequestMonitoringStart () [0x00000] in <793ebe419a94494388f459127f8240ff>:0
at Plugin.Geofence.GeofenceImplementation.StartMonitoring (Plugin.Geofence.GeofenceCircularRegion region) [0x00061] in <793ebe419a94494388f459127f8240ff>:0
at GeoFenceApp.MainPageViewModel.StartStopMonitoring () [0x00027] in C:\Users\ctodd\source\repos\GeoFenceApp\GeoFenceApp\MainPageViewModel.cs:87 }
The CrossGeofence object itself is not null and neither is the _myRegion object:
screenshot of cross geofence object
screenshot of region object
I believe I am initialising things correctly according to the documentation and the sample.
I'm using the following permissions, even though I believe only fine_location, coarse_location, read_gservices and boot_completed are necessary:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
A google api key is necessary in the sample because a map is being displayed, but I don't need to display a map. Do I still need this key to access location services?
After the permissions, I'm really not sure what is causing the error, as I've tried to follow the documentation.
I'm setting up permission in Manifest file
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS" />
But unfortunatly I can't get SMS permissin, after I setted up application, I should go to security property of smartphone and set it by myself. What the reason, is it reason of MI restrictions or I must set somthing else in 6 version of Android. This worked on previos version on this smartphone.
From Android marshmallow you need to give run time permission.
Add below given code in your launch activity onCreate() method.
String permission = Manifest.permission.READ_SMS;
if (ContextCompat.checkSelfPermission(getContext(), permission) != PackageManager.PERMISSION_GRANTED){
permissionList.add(permission);
if (!ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), permission)){
requestPermissions(new String[]{permission}), SMS_PERMISSION);
}
}
I have been reading many questions on stackoverflow and I can't quite figure this problem out. I have an app that has a call feature but I still want tablets to access it. The app works on tablets if I manually install it via USB but it will not show up on the market place. I know that there are other questions regarding this issue but I am also asking if there are any other permissions I have that will not work on tablets.
Here is my manifest..
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<!-- End of copy. -->
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
I originally just had <uses-permission android:name="android.permission.CALL_PHONE"/>
But I recently added..
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
Will this solve the problem of the tablet not being able to make calls and have it listed on the tablet marketplace?
Also, are there any other permissions that I have listed that I need to add android:required="false" to?
Also, this is how I am calling in the code...
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + markPhone));
startActivity(callIntent);
Change your code to call using ACTION_DIAL not ACTION_CALL:
try {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber));
startActivity( intent );
} catch ( Exception e ) {
// no dialer activity found...
}
then you can completely remove these:
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
from your Manifest, as your app is no longer need them.
I'm new developer on android. What I needed in purpose to use com.android.internal.telephony? Downloading ? Special permissions ?
You have to add the following lines in your Manifest, inside of the application tag:
<uses-feature android:name="android.hardware.telephony">
</uses-feature>
Also particular features require special Permissions, for example sending and receiving sms requires:
<uses-permission
android:name="android.permission.RECEIVE_SMS" >
</uses-permission>
<uses-permission
android:name="android.permission.SEND_SMS" >
</uses-permission>
I'm currently working images using
mBitmap = BitmapFactory.decodeFile(filePath);
ExifInterface exif = new ExifInterface(filePath);
My permissions are:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
I thought I needed a read storage permission to get the files from the gallery. Why can I access files from my Gallery without this permission?
If it helps, I'm using the ACTION_SEND intent filter to start the activity via a "Share" dialog.
Edit: Just to clarify, my application works perfectly. I thought I would need a special permission to read files from the SD card (such as images). Is this not the case?
this is
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />