android
android copied to clipboard
Waypoints import (.OTRW) reports "import failed"
- App build number: 2.4.10 (20410033)
- Android version: 9
- Device: Samsung S8
- Installation source: Google Play
As reported in https://github.com/owntracks/android/issues/1282, the import of an .otrw file containing waypoints fails with the diagnostic Import failed: message is not a valid configuration message
This is the JSON:
{
"_type": "waypoints",
"waypoints": [
{
"_type": "waypoint",
"desc": "Chez Jane à Paris",
"lat": 48.856826,
"lon": 2.292713,
"rad": 450,
"tst": 1598451372
},
{
"_type": "waypoint",
"desc": "Lestari Indonesisch restaurant",
"lat": 51.978743,
"lon": 5.905338,
"rad": 100,
"tst": 1598453157
}
]
}
As far as I can tell, this worked in August 2020 which was when I last tested this import.
Hm. I don't remember being able to import a waypoint list JSON file via the configuration import ever worked. Is that a thing that should work? Would having the option of importing via the "Regions" activity not be more intuitive?
That error is coming from this bit of code, which is definitely only considering _type=configuration to be a valid configuration to import:
https://github.com/owntracks/android/blob/d373b8ebd5a6f235859485c57e50803f935c6b4c/project/app/src/main/java/org/owntracks/android/ui/preferences/load/LoadViewModel.java#L62-L79
I would have sworn it worked but have been wrong before, and if the code isn't there, then I'm definitely wrong!
importing via the "Regions" activity
Will you educate me? What is that?
This one: 
Ah, you speak of a possible future; being able to import regions there.
Our iOS app permits import of waypoints as specified above via import (association with the app) of *.otrw (the w is for waypoints) files. I think we decided that several years ago, and the intention was to have this equivalent in both Android and iOS. It seems https://github.com/owntracks/android/issues/14 actually led to an implementation in https://github.com/owntracks/android/issues/596 (at least it says 'fixed'), but I don't see code for it ...
All futures are possible! 😄
Ok, so if this doesn't work today, is it better to spend time making it work on the configuration import screen, or is it better to actually implement it in the regions screen (which is arguably where it belongs)?
In iOS, the import is not a function of the app, but the filetype .otrw is opened with the app automatically. From this point of view, I don't have a preference for the screen.
Does the import of waypoints via cmd work in Android as in #596?
https://owntracks.org/booklet/tech/json/#_typecmd
Does the import of waypoints via cmd work in Android as in https://github.com/owntracks/android/issues/596? https://owntracks.org/booklet/tech/json/#_typecmd
Yes, this works.