osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.64k stars 1.01k forks source link

Feature suggestion: Some sort of remote upload/download access #4370

Open martenjj opened 7 years ago

martenjj commented 7 years ago

This feature involves some background explanation, so please bear with me...

Soon after I first started using OsmAnd on multiple devices, I wrote a utility to update its maps remotely. This ran on a desktop computer and fetched the map files from the osmand.net download servers, using the XML index to find what was available, and stored a local copy. Then it could push them in turn to any device using OsmAnd, by connecting it via USB and using normal file access to the SD card. The advantage of doing this was that it made it easy to update a number of devices in one operation, without having to go through the exact same sequence of taps on each one, Because of the single local copy, it also reduced the load both on my network and the osmand.net download servers.

With the tightening of file access restrictions on newer devices and in later versions of Android, in particular the removal of FAT file access over USB and the restrictions on writing to the SD card by arbitrary apps on the device, this became no longer possible (unless the device is rooted, which not everyone would want to do and has its own disadvantages). Now the only way to perform map updates is within OsmAnd on the device itself - going back to the original problem, each additional device multiplying the load on the network and the download servers.

Therefore my suggestion is for some sort of facility where remote access could be provided within OsmAnd on the device, so getting around Android's file access restrictions. This could be either a HTTP or FTP server embedded within it (only enabled on demand, of course, with appropriate security to confine its operation to the OsmAnd file area only) to allow map files to be pushed to the device. Any new files would of course be re-indexed and brought into use in the same way as updated map files currently.

Also most useful would be the ability to both fetch and update favourites.gpx, and also to fetch and update recorded tracks,

scaidermern commented 7 years ago

There are various apps available for accessing your device via FTP, HTTP or SMB. Why re-invent the wheel and make OsmAnd unnecessarily complex?

martenjj commented 7 years ago

Yes, I know that there are plenty of remote access apps over various protocols. But they are all subject to the Android restriction of not being able to write to other apps' areas of the SD card or internal storage, unless the device is rooted. This restriction seems unlikely to be eased in the future, so the only solution appears to be to have the remote access incorporated within the Osmand app itself.

sonora commented 7 years ago

What I do not understand: You can still use the PC to sync files to any Android device's SD Card via USB cable, only it does not connect directly as FAT, but e.g. as media device. But that should be a simple adaptation of your script?

martenjj commented 7 years ago

It should be simple, but I've still encountered devices which only allow access via MTP to predefined locations (Documents, Music etc) and not to other applications' SD card area.

sonora commented 7 years ago

There are a numrer of known issues and "features" around this, it depends on Windows/PC OS version, (google) driver version and Android version. But to my knowledge all can be solved outside OsmAnd, just search the web for your particulars.

greenbigfrog commented 7 years ago

Instead of mounting your phones SD card as a drive (and just cp them), just use adb push. All you need to do is enable Developer mode on each phone