Android Question Background location access not declared

D

Deleted member 103

Guest
Hi,

my app was not approved by google because of this policy (see thread title) .

But I am not aware that where I need background location access.
This is the app manifest:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="29"/>
<uses-feature android:name="android.hardware.location.gps"/>
<supports-screens android:xlargeScreens="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="false"
    android:anyDensity="true" />)
    'android:requiresSmallestWidthDp="500"
'SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:largeHeap, "true")
'Neu ab SDK-29
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
'End of default text.


'Einstellung für Adaptive-icon
SetApplicationAttribute(android:icon, "@mipmap/ic_launcher")
CreateResource(mipmap-anydpi-v26, ic_launcher.xml,
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/background"/>
    <foreground android:drawable="@mipmap/foreground"/>
</adaptive-icon>
)

AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.WRITE_SETTINGS)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.READ_PHONE_STATE)

'************ AppCompat components ************
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#607D8B</item>
        <item name="colorPrimaryDark">#455A64</item>
        <item name="colorAccent">#607D8B</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
)

'************ Required for Maps ************
AddApplicationText(
<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
)
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />
)
'End of Required for Maps

'************ Crashlytics components ************
'Google Play Services Base - Always required when using Google Play Services or Firebase:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

'Firebase Analytics
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

'Crashlytics components
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)
'End of Crashlytics components

'GooglePlayBilling - In App Purchases
CreateResourceFromFile(Macro, GooglePlayBilling.GooglePlayBilling)
'End of GooglePlayBilling

'************ File Provider ****************
'E-Mail senden ab Android 6+
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <external-files-path name="name" path="" />
)
'Ende of File Provider

and these are the permission:

and this is my code with which I ask the permission:
B4X:
Private Sub CheckAndRequestPermission
    If Not(Starter.rp.Check( Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)) Then
        Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
    End If

    If Not(Starter.rp.Check( Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)) Then
        Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
    End If
End Sub

Sub Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result = False Then
        Select Permission
            Case Starter.rp.PERMISSION_ACCESS_FINE_LOCATION
                Msgbox2Async(Starter.Language.Value("ACCESS_FINE_LOCATION"), Starter.Language.Value("PermissionDenied"), "OK","","",Null, False)

            Case Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE
                Msgbox2Async(Starter.Language.Value("WRITE_EXTERNAL_STORAGE"), Starter.Language.Value("PermissionDenied"), "OK","","",Null, False)
        End Select
    End If
End Sub

In Main->Activity_Resume is this code :
B4X:
Sub Activity_Resume
...
    If Starter.rp.Check( Starter.rp.PERMISSION_ACCESS_FINE_LOCATION) Then
        If Not(Starter.GPS1.GPSEnabled) Then
            ToastMessageShow(Starter.language.value("msgEnableGpsDevice"), True)
            StartActivity(Starter.GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
        Else
            CallSub(Starter, "StartGPSAndTimer")
        End If
    End If
...
End Sub

and in Starter-Service:
B4X:
Sub Service_Create
...
    GPS1.Initialize("GPS1")
    GPSPathPreviuous.Initialize
...
End Sub

Public Sub StartGPSAndTimer
    If Not(GPS_On) Then
        GPS1.Start(GPSMinTime, GPSMinDistance) 'Listen to GPS with no filters.
        GPS_On = True
    End If
End Sub

I don't know what to change now.
 
D

Deleted member 103

Guest
I don't see any significant difference between the two lists.

The 'fine location' is listed in both cases.
Thanks Erel!
I also don't understand what Google wants, sometimes everything is OK, and sometimes it's no more.
I sent an email to Google on Friday, now I have to wait what they say.
 
Upvote 0
D

Deleted member 103

Guest
That's the current answer from Google.
As you can see from my app permission (see post # 20), the "ACCESS_BACKGROUND_LOCATION" permission is not asked.
How should I delete this permission if I don't know where it is?
 
Upvote 0
D

Deleted member 103

Guest
These permissions are displayed in the Google console:


and that is the content of AndroidManifest.xml :
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The background permission is not there.
Show them the screenshot with the list of permissions. It looks like a mistake.

This is what Google documentation says about the permission:
  • If you don't need location access in the background, remove it.
    If your app targets Android 10 (API level 29) or higher, remove the ACCESS_BACKGROUND_LOCATION permission from your app's manifest. When you remove this permission, all-the-time access to location isn't an option for the app on devices that run Android 10.
Maybe the answer is here: "please request to remove background usage and reach compliance".
 
Upvote 0
D

Deleted member 103

Guest
Hi Erel,
Unfortunately I can write whatever I want to Google, Google doesn't understand anything, it's like speaking against a wall.
You just get an automated response and that's it.
I've already sent the permission list, it didn't matter, they don't want to understand.
 
Upvote 0
D

Deleted member 103

Guest
After I made this setting, the app update was approved by Google.
As I understood it, is it possible that the app can be removed from Google?
 
Upvote 0
D

Deleted member 103

Guest
Only Google can answer such question, especially as I don't know German...
Should I translate this text into Italian for you?
just kidding.
I have to wait again what the support writes.
 
Upvote 0
D

Deleted member 103

Guest
Hi,

Yesterday I had the option “Does your app access location in the background in APKs or app bundles targeting Android 9 or older?” applied and the app was approved.
I didn't understand why, but maybe you don't always have to understand everything.

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