Android Question "Open Street Map viewer - GPS" not work

Lakhtin_V

Active Member
Licensed User
Longtime User
I'm trying to test the Android example Open Street Map, but it throws an error. So far I can not find any working variant with the display of the map and markers.

ResponseError. Reason: , Response: Access denied. See https://operations.osmfoundation.org/policies/tiles/
ResponseError. Reason: , Response: Access denied. See https://operations.osmfoundation.org/policies/tiles/
zoom level changed : 3
java.lang.OutOfMemoryError: Failed to allocate a 2359308 byte allocation with 940080 free bytes and 918KB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:843)
at android.graphics.Bitmap.createBitmap(Bitmap.java:820)
at android.graphics.Bitmap.createBitmap(Bitmap.java:787)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:81)
at anywheresoftware.b4a.objects.B4XCanvas.Initialize(B4XCanvas.java:54)
at it.OpenMa.cvmap._drawgridontile(cvmap.java:830)
at it.OpenMa.cvmap._addtile(cvmap.java:689)
at it.OpenMa.cvmap._createtiles(cvmap.java:1202)
at it.OpenMa.cvmap._fviewzoominout_click(cvmap.java:2041)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5215)
at android.view.View$PerformClick.run(View.java:21196)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5603)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:177)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5603)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
Caused by: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:588)
at libcore.io.IoBridge.recvfrom(IoBridge.java:552)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:149)
at java.io.BufferedInputStream.read(BufferedInputStream.java:234)
at java.io.DataInputStream.readByte(DataInputStream.java:75)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:344)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
... 8 more
Caused by: android.system.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:189)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
... 19 more
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
 

DonManfred

Expert
Licensed User
Longtime User
I don´t see how it is related to GPS.
You are running out of memory
 
Upvote 1

Lakhtin_V

Active Member
Licensed User
Longtime User
I use the example in its purest form, without modification. Tiles appear on the screen then become striped (white screen) then crash. There may be a problem with the servers where the requested tiles are cached. I hope the example should work even if it is not possible to determine the real GPS coordinates. It is important for me to display any area of the map and put markers on it. The actual location of the device is not important to me.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
not to mention apparent abuse of openstreetmap's services, which could affect the rest of us.
 
Upvote 0
Top