ge0rg / aprsdroid

APRSdroid - Geo-Location for Radio Amateurs
https://aprsdroid.org/
GNU General Public License v2.0
504 stars 96 forks source link

an issue about offline map #373

Open bg1fpx opened 4 months ago

bg1fpx commented 4 months ago

I uploaded two files -- aprsdroid.map & config.aprs -- into the root folder of my smartphone (Android 11). aprsdroid.map CAN'T be loaded, but config.aprs can be loaded successfully. I want to know why? Thanks for a reply.

penguin359 commented 4 months ago

Where did you get these files? Can you attach them to this ticket or provide a link to review them?

bg1fpx commented 4 months ago

1/ map file

https://download.mapsforge.org/maps/v5/asia/china.map

2/ config file

"config.aprs" is an old backup file I saved two year ago.

3/ When I select "aprsdroid.map", the app show "Error loading map file", and subsequently the app crashed. I have to reinstall the app.

gunnardave commented 4 months ago

1/ map file

https://download.mapsforge.org/maps/v5/asia/china.map

2/ config file

"config.aprs" is an old backup file I saved two year ago.

3/ When I select "aprsdroid.map", the app show "Error loading map file", and subsequently the app crashed. I have to reinstall the app.

The map error is probably due to the version. APRSdroid I think still requires maps based on version 3 of the Mapsforge library, which is depreciated. The map you're trying to use I think is version 5.

Most people I assume must use online Google maps so don't notice but a few of us still rely on the offline option. I archived V3 maps for North America but those are getting long in the tooth.

penguin359 commented 4 months ago

From an initial triage while loading the map, I see this potentially-related error on logcat:

E FileSystemTileCache: could not create directory

While attempting to Load a profile that I had just exported, I get this:

05-22 10:24:13.158 30880 30880 D APRSdroid.ProfileImport: created: Intent { dat=content://com.android.providers.downloads.documents/... flg=0x43 cmp=org.aprsdroid.app/.ProfileImportActivity }
05-22 10:24:13.174 30880 30880 D trimPosts: exectuion time: 0.000 s
05-22 10:24:13.174 30880 30880 W System.err: org.json.JSONException: Value profile-20240522-0955.aprs of type java.lang.String cannot be converted to JSONObject

This may not be the same bug you hit if you are using a former profile that was saved appropriately, but the profile file created on export for me was a one-line text file of the actual filename that it tried to save. I tested on Android 13.

gunnardave commented 1 month ago

Just upgraded my phone from an ancient Motorola Droid running Android 4.4.4 to a Samsung running Android 10.

Using the same version of APRSdroid (1.6.2b) maps that once worked no longer do.

So I now have the same problem as Loren @penguin359. Pointing to the map file in preferences and selecting OpenStreetMap.org button causes a crash and app won't restart. Have to uninstall and reinstall.

This is a critical error in my use case. The phone is used offline completely, no SIM or data plan. It gets removed from the vehicle and connected to a PC for hosted Internet over USB when it needs to be configured. It has to work offline normally and this configuration worked fine before.

The maps themselves are V3 Mapforge and still work fine with OruxMaps, Backcountry Navigator and Locus Maps so they do not appear to be corrupt. I have a theme file and makes no difference if I select it or not, APRSdroid crashes.

If it's a Mapsforge issue on newer Android is there another option possible to use pre-built offline maps? I don't have any other phones to figure out which version of Android might have broken this, it appears to be between 4.4.4 and 10, that's about all I can say.

David AC0VH