Android Question OSMDroid and SDK 23+ or something...

Magma

Expert
Licensed User
Longtime User
Well there is an old Greek "saying"...
"when something works don;t touch it !"

Well i want it to update the thing (app) with the permissions requests at the startup
+ i wanted to updated with new maps...

So was the wrong timing or something... now i am getting only squares at osmdroid... am i missing something - anyone works ok ?

a. The default folder for osmdroid and mapnik tiles is \osmdroid\tiles\mapnik ?
b. This is my manifest:
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: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="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"/>)
'End of default text.
AddReceiverText(eu.dgconsulting.appupdating.newinst2,
  <intent-filter>
  <action android:name="android.intent.action.PACKAGE_REPLACED" />
    <data android:scheme="package" />
  </intent-filter>)
  AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.CALL_PHONE)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS) 
AddPermission("android.permission.FOREGROUND_SERVICE")
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ANSWER_PHONE_CALLS)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.RECORD_AUDIO)
AddPermission(android.permission.CAMERA)
AddPermission("android.permission.READ_PHONE_STATE")

'************ Google Play Services Base ************
AddApplicationText(
   <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
    <meta-data
  android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************

AddApplicationText(
<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
)

and these are my runtime requests ... am i right or not ?
B4X:
Dim rp As RuntimePermissions

        aaver=phone.SdkVersion
        If aaver>22 Then
            For Each permission As String In Array(rp.PERMISSION_CALL_PHONE,rp.PERMISSION_ACCESS_FINE_LOCATION,rp.PERMISSION_CAMERA,rp.PERMISSION_READ_EXTERNAL_STORAGE,rp.PERMISSION_WRITE_EXTERNAL_STORAGE,rp.PERMISSION_RECORD_AUDIO,rp.PERMISSION_READ_PHONE_STATE)
                rp.CheckAndRequest(permission)
                Wait For Activity_PermissionResult (permission As String, Result As Boolean)
                If Result = False Then
                    Log(permission)
                    ToastMessageShow("not giving..rights - go alone at system settings.. to give", True)
                    Activity.Finish
                    'ExitApplication
                    Return
                End If
            Next
            
            If File.ExternalWritable=False Then
                '   OSMDroid requires the use of external storage to cache tiles
                '   if no external storage is available then the MapView will display no tiles
                Log("WARNING NO EXTERNAL STORAGE AVAILABLE")
                ToastMessageShow("give rights!", True)
            End If
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…