Android Question Some android devices out of reach after adding google maps support

EduardoElias

Well-Known Member
Licensed User
Longtime User
Hi there!

When I add the a google map in my application, following the tutorial for MapFragment, several android tablets are not compatible anymore.

If I use B4A I can inject the application on the tablet and it work just fine. The problem is with Play Store. I have no clue what to do.

Below the exact manifest I am using for the application.

Removing everything related to the MapFragment, #additionalJar
and applying this:

RemovePermission(android.permission.ACCESS_COARSE_LOCATION)
RemovePermission(android.permission.ACCESS_FINE_LOCATION)

I can get the compatibility with these tablets back again

I am fine if I could install the app in the tablet and this functionality is not available for them, and will work with all the rest. There is an important brand in my country that resell some Chinese ones with this problem, so it is frequent to find customers wanting to use it.

B4X:
'This code will be applied to the manifest file during compilation.

'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14"
        android:targetSdkVersion="14"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<supports-screens android:largeScreens="true"
    android:xlargeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddApplicationText(<activity android:name="anywheresoftware.b4a.objects.preferenceactivity"/>)
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false"/>)
AddManifestText(<uses-feature android:name="android.hardware.bluetooth" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.usb.accessory" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.usb.host" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.FAKETOUCH" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.LOCATION" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.location.GPS" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.location.NETWORK" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.WIFI" android:required="false"/>)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>)
AddManifestText(<uses-feature android:name="android.hardware.touchscreen" android:required="false" />)
AddManifestText(<uses-feature android:name="android.permission.WAKE_LOCK" android:required="false" />)
AddManifestText(<uses-feature android:name="android.permission.ACCESS_FINE_LOCATION" android:required="false" />)
AddManifestText(<uses-feature android:name="android.permission.ACCESS_COARSE_LOCATION" android:required="false" />)
'RemovePermission(android.permission.ACCESS_COARSE_LOCATION)
'RemovePermission(android.permission.ACCESS_FINE_LOCATION)
RemovePermission(android.permission.VIBRATE)
RemovePermission(android.permission.BLUETOOTH_PRIVILEGED)
RemovePermission(android.permission.BLUETOOTH_ADMIN)
RemovePermission(android.permission.WAKE_LOCK)
AddApplicationText(<meta-data
 android:name="com.google.android.geo.API_KEY"
 android:value=" "/>
 <meta-data android:name="com.google.android.gms.version"
   android:value="@integer/google_play_services_version" />
   )
AddActivityText(main, <intent-filter >
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.HOME" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>)
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
You can see the list of "features" derived from the permissions when you upload the APK to Google Play. Have you made all of them optional?

adding these lines:

RemovePermission(android.permission.ACCESS_COARSE_LOCATION)
RemovePermission(android.permission.ACCESS_FINE_LOCATION)

and uploading the app made it compatible to more than 2k devices

it is weird, since I can upload the app via B4a bridge and it works just fine on these devices.

I was using these permissions because google maps (followed the last tutorial)

What can be done to have the google maps that require this permissions and not have the google play restrictions?

Thank you
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
it is weird, since I can upload the app via B4a bridge and it works just fine on these devices.
Not weird at all. The "features usage" filter is only relevant to installations from Google Play.

What can be done to have the google maps that require this permissions and not have the google play restrictions?
You can see the list of "features" derived from the permissions when you upload the APK to Google Play. Have you made all of them optional?
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
Erel said:
You can see the list of "features" derived from the permissions when you upload the APK to Google Play. Have you made all of them optional?

Erel, not sure what to do. You can see on the first post my manifest file and I have added these lines:
AddManifestText(<uses-feature android:name="android.permission.ACCESS_FINE_LOCATION" android:required="false" />)
AddManifestText(<uses-feature android:name="android.permission.ACCESS_COARSE_LOCATION" android:required="false" />)

and many others like this with the intent to pass the store filters.

but it only really works if I add:

RemovePermission(android.permission.ACCESS_COARSE_LOCATION)
RemovePermission(android.permission.ACCESS_FINE_LOCATION)

but in this case, I cant use the google map fragment, since it is required to work

Please I am not understanding what you mean to made optional

Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…