Android Question problems with googlemaps example: marked location not centered

toby

Well-Known Member
Licensed User
Longtime User
I've followed the instructions as precisely as I could when building the example app which is attached; all you need is to set your api key.

I noticed that the map shown is always the same regardless the location of the marker. Try set the marker to anywhere in Australia and it would be out of sight. The map should center around the marker. What I did were wrong? How to achieve that?

Secondly, I want the app to zoom in automatically so that street names are visible. What I should do?


Unfiltered Logs:
Logger connected to: asus ASUS_Z00AD
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Making Creator dynamically
--------- beginning of system
Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006a@[email protected]' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006a/DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Google Play services client version: 11020000
Google Play services package version: 12673013
Failed to ensure directory: /storage/MicroSD/Android/data/b4a.example/cache
Local module descriptor class for com.google.android.gms.googlecertificates not found.
Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006d@GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006d/GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
-1 received
Starting remote logger. Port: 35352
After accept
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
[29804] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
SetAppTypeFace- try to flip, app = b4a.example
Typeface getFontPathFlipFont - systemFont = default#default
SetAppTypeFace- try to flip, app = b4a.example
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 35352
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
After accept
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Making Creator dynamically
Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006a@[email protected]' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006a/DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Google Play services client version: 11020000
Google Play services package version: 12673013
Failed to ensure directory: /storage/MicroSD/Android/data/b4a.example/cache
Local module descriptor class for com.google.android.gms.googlecertificates not found.
Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006d@GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006d/GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
-1 received
writer error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1991)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2025)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:373)
at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
at java.lang.Thread.run(Thread.java:818)
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
[29905] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
SetAppTypeFace- try to flip, app = b4a.example
Typeface getFontPathFlipFont - systemFont = default#default
SetAppTypeFace- try to flip, app = b4a.example
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 35352
Render dirty regions requested: true
Validating map...
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
After accept
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Making Creator dynamically
Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006a@[email protected]' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006a/DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Google Play services client version: 11020000
Google Play services package version: 12673013
Failed to ensure directory: /storage/MicroSD/Android/data/b4a.example/cache
Local module descriptor class for com.google.android.gms.googlecertificates not found.
Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006d@GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006d/GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory

toby
b4a 7.80, windows 10, hp 15 bw008ca, asus zenfone 2
 

Attachments

  • b4a.googlemaps.zip
    9.6 KB · Views: 237

DonManfred

Expert
Licensed User
Longtime User
B4X:
Sub MapFragment1_Ready
    gmap = MapFragment1.GetMap
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    gmap.MyLocationEnabled = Result
    Dim m1 As Marker = gmap.AddMarker(10, 30, "test")
    m1.Snippet = "This is the snippet"

    ' New
    Dim campos As CameraPosition
    campos.Initialize(10,30,15) ' Lat, lon, zoom
    gmap.AnimateCamera(campos)
    
    
    
End Sub
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Thanks to DonManfred, now the map centers around the marker at right zoom level.

The only problem I have is the marked location is a few hundred kms away from the correct spot. The attached example demonstrates that problem (the intended location is the white house, washington DC, USA). I'm now at loss to know to do next. Could someone kindly point me to the right direction?

Logger connected to: asus ASUS_Z00AD
--------- beginning of main
[24483] Initialize library(version: 5.0.7a_y.48167 RELEASE)... successfully.
SetAppTypeFace- try to flip, app = deedeemobi.googlemap
Typeface getFontPathFlipFont - systemFont = default#default
SetAppTypeFace- try to flip, app = deedeemobi.googlemap
Typeface getFontPathFlipFont - systemFont = default#default
Starting remote logger. Port: 35757
Render dirty regions requested: true
Validating map...
After accept
Initialized EGL, version 1.4
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
Enabling debug mode 0
*** Debugger waiting for connection (0) ***
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Making Creator dynamically
--------- beginning of system
Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006a@[email protected]' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006a/DynamiteModulesB_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
Google Play services client version: 11020000
Google Play services package version: 12673013
Failed to ensure directory: /storage/MicroSD/Android/data/deedeemobi.googlemap/cache
Skipped 46 frames! The application may be doing too much work on its main thread.
Deprecation notice: In a future release, indoor will no longer be supported on satellite, hybrid or terrain type maps. Even where indoor is not supported, isIndoorEnabled() will continue to return the value that has been set via setIndoorEnabled(), as it does now. By default, setIndoorEnabled is 'true'. The API release notes (https://developers.google.com/maps/documentation/android-api/releases) will let you know when indoor support becomes unavailable on those map types.
Background sticky concurrent mark sweep GC freed 41130(3MB) AllocSpace objects, 30(1620KB) LOS objects, 11% free, 22MB/25MB, paused 2.155ms total 118.537ms
turboImageDecoder took 1.92ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.89ms to decode 256x256 (1x downscale)
turboImageDecoder took 10.17ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.53ms to decode 256x256 (1x downscale)
Local module descriptor class for com.google.android.gms.googlecertificates not found.
turboImageDecoder took 1.99ms to decode 256x256 (1x downscale)
turboImageDecoder took 5.71ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.60ms to decode 256x256 (1x downscale)
Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
turboImageDecoder took 2.13ms to decode 256x256 (1x downscale)
DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@[email protected]@app_chimera@m@0000006d@GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000006d/GoogleCertificates_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
turboImageDecoder took 2.36ms to decode 256x256 (1x downscale)
turboImageDecoder took 2.17ms to decode 256x256 (1x downscale)
turboImageDecoder took 13.79ms to decode 256x256 (1x downscale)
turboImageDecoder took 3.41ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.84ms to decode 256x256 (1x downscale)
turboImageDecoder took 3.55ms to decode 256x256 (1x downscale)
turboImageDecoder took 7.80ms to decode 256x256 (1x downscale)
turboImageDecoder took 9.88ms to decode 256x256 (1x downscale)
turboImageDecoder took 5.42ms to decode 256x256 (1x downscale)
turboImageDecoder took 4.50ms to decode 256x256 (1x downscale)
turboImageDecoder took 7.99ms to decode 256x256 (1x downscale)
turboImageDecoder took 6.16ms to decode 256x256 (1x downscale)
turboImageDecoder took 5.60ms to decode 256x256 (1x downscale)
turboImageDecoder took 2.55ms to decode 256x256 (1x downscale)
turboImageDecoder took 3.06ms to decode 256x256 (1x downscale)
turboImageDecoder took 2.05ms to decode 256x256 (1x downscale)
turboImageDecoder took 2.11ms to decode 256x256 (1x downscale)
turboImageDecoder took 2.04ms to decode 256x256 (1x downscale)
turboImageDecoder took 2.13ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.54ms to decode 256x256 (1x downscale)
turboImageDecoder took 3.10ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.94ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.82ms to decode 256x256 (1x downscale)
turboImageDecoder took 1.57ms to decode 256x256 (1x downscale)
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Solution: use google map with fused location provider. I have no idea why the other example works for me, but not this one. My app needs FLP anyway.
 
Upvote 0
Top