Okay I'm using LocationClient API but without viewing Maps in my application. All I'm doing is updating current locations to the server. Of course the last 6 hours locations.
1)Should the following permission be there?
<permission
android:name="com.example.myapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
2)should the API key still be there?
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCxXOFev03HX4vr6ZGfd0983noouy3wt0g" />
3)Should I use this permission as well?
<uses-permission android:name="com.example.myapp.permission.MAPS_RECEIVE" />
No, you don't need those permissions if you aren't using maps. You only need location permissions:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
or
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Related
Say I have these permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices. I found that with some permissions like bluetooth you can add the <uses-feature tag and then to that add android:required="false". For example:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- Tells the Play Store that the above two permissions are not required -->
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
However I found no features to declare for any of the permissions I listed in the beginning of this post. So how am I supposed to tell the Play Store that they're not required?
So how am I supposed to tell the Play Store that they're not required?
You don't. No devices will be filtered out based on those permissions.
I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices
No permissions are used directly for filtering out devices. As you noted, some permissions imply features, and you can declare that the features are not required.
I would like to tell the Play Store that these permissions are not
required and are not to be used for filtering out devices.
Don't worry! If your next update/package don't require some permissions, just remove those permissions from the mainfest.xml, and done. If you still have doubt, you can see the number of compitable device models during creation of release in your console.
I found that with some permissions like bluetooth you can add the
<uses-feature tag and then to that add android:required="false".
They are all for feature-based filtering and not for permissions. Because, features might be critical for some apps to work. If an app uses a feature which is not critical for its functionality, required=false might be helpful.
You can use like that:
<uses-permission android:name="android.permission.INTERNET"
tools:node="remove"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"
tools:node="remove"/>
When my Android app is installed on a device set to French, it request access to photos and contacts. The main app does not need or request these. Is there somewhere that I need to change a setting to not request for any language?
Manifest permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
While releasing the apk to play store, I found out that the my app requires the android.hardware.telephony feature but I haven't added it in manifest anywhere. I have also check the merged manifest in android studio and it also does not contain this feature so I think no third party sdk is adding this. What could be the source of this feature?
For reference, I have following permissions declared in the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Also, when I make it optional using below code, the app is available on devices without this feature:
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
So why is required by default without adding it anywhere?
Google Play automatically adds some features, depending on which permissions you have requested.
As you have requested READ_SMS and RECEIVE_SMS permissions, this implies you use the telephony feature. So, Google Play reacts as if you had the following in your AndroidManifest.xml:
<uses-feature
android:name="android.hardware.telephony"
android:required="true" />
When you manually add this and declare it required="false", this tells Google Play that whilst you do ask for the permission, you can handle the case where the user does not have the telephony feature.
This is confirmed via this note in the docs:
Note: Some system permissions implicitly require the availability of a device feature. For example, if your app requests permission to access to BLUETOOTH, this implicitly requires the FEATURE_BLUETOOTH device feature.
The full list of permissions and the feature requirements implied is available here, and includes your situation:
Finally, with your ACCESS_COARSE_LOCATION you are also declaring a feature requirement on android.hardware.location, just for your information.
There's also further detailed information over on the GameDev StackExchange.
One or more of the dependencies / modules / libraries your project is using is adding that requirement to your Android Manifest.
To investigate open your main Android Manifest file in Android Studio, and click on the Merged Manifest tab at the bottom of the page.
This will show you a view of the final merged Manifest, along with sources of each line.
Read more about this here: https://developer.android.com/studio/build/manifest-merge#inspect_the_merged_manifest_and_find_conflicts
HOW TO FIX
If you wish to avoid adding that requirement to your final Manifest, you can use Node Markers in your Manifest to control how the merge works.
Read more about Node markers here: https://developer.android.com/studio/build/manifest-merge#node_markers
e.g. try this:
<uses-feature
android:name="android.hardware.telephony"
android:required="false"
tools:node="replace" />
I'm building an app and I want to send push notifications to the users of this app, so I use the PushBots services.
In their guide, they say to put these permissions in the manifest:
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.example.sampleapp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.example.sampleapp.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive dataf message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
But in the new permission request system, I have to request every single permission.
So now I'm asking these permissions in my app:
-location permissions (I use map activity).
-accounts permissions (PushBots said it is required).
I've tried to run my app, and this is the error I get:
java.lang.IllegalStateException: Application does not define permission com.giladneiger.haerev.permission.C2D_MESSAGE
How can I request a permission for this? There is no option for it, and my app will request so many permissions that the user will lose his patience for it.
What do I have to do with this error?
You should use your package name com.giladneiger.haerev instead of com.example.sampleapp in the lines
I've made an app that determines the location (balloon) and shows it on Google Maps (with roads, city etc) so an active internet is needed.
This works fine when I'm using WiFi but not on 3G. It determines the location and the location-output tot Google Maps is allright (including a balloon) but the Maps (with road, rivers, city etc) will not update.
Hereby my manifest-settings:
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CONTROL_LOCATION_UPDATES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
I solved the problem myself but here's how:
After reading several articles on the net it seems some kind of api key error.
I read there's a difference in debug-key and signed key so I replaced the debug key with the signed api key and that did the trick.
Why wifi worked and 3G not it's not clear te me and really I don't mind because it all works fine now