I started to work on this a few weeks (probably months) ago. I ran
into a few problems and lacked time and motivation to finish it yet.
You say, you messed with the files already so I wanted to reply as
quickly as possible but it will probably still be a few days until I
can show my code in a reasonable way. It would be nice if you
described what changes you already made.
I, too, want OsmAnd to listen to every type of mapping intent I can
think of. You already listed quite a few and I would even go a step
further and add http intents for Google Maps, Bing, etc. The user
still has the choice to ignore them and use the browser instead.
For the contact intent, some tickets already said that it wasn't
implemented because it needs permission to read contact data. My
current idea is to have a helper application that would listen for
those intents and rewrite them.
Which brings me to the intents themselves.
I started to create custom intents for OsmAnd that can do everything
I'd like to do with OsmAnd from an external application:
net.osmand.intent.action.MAP:
- Name (description to show in favorites or whatever)
- Latitude
- Longitude
- Directions (show directions to position?)
- Navigate (start navigating to position?)
- Zoom
- Application mode
- Original latitude/longitude (for directions that don't start at the
current location)
- Force (if true, OsmAnd starts the required action right away; if
false, a dialog pops up with the given values preset that the user can
change)
- ... (That's all that I started to implement at the moment but there
are probably a few more that would be nice to have. Another option I
want is online/offline.)
net.osmand.intent.action.SEARCH:
- Query (just a text parameter)
- returns latitude and longitude
- the activity that does the search should have a possibility to use
online search tools aswell as offline
Pretty much all parameters for the MAP intent are optional. If no lat/
lon is given but a name is, it will be stuffed into the SEARCH intent.
That's pretty much my vision and some stuff already works. My main
problem at the moment is that MapActivity doesn't set some
initialization stuff if OsmAnd is launched using that activity
directly.
Once those intents are working, we just need a simple activity that
listens for all the geo intents and translates them to the MAP intent.
I already implemented the google.navigation intent but supporting any
of them should be a piece of cake.
I will try to commit my current codebase to
https://github.com/MelTraX/Osmand
in the next days. Writing this post already motivated me quite a lot
to actually make it work.
I don't care too much about your points 2-4. Obviously they should be
addressed but I won't do that. :)
That's it for now. As I said, I just wanted to throw my progress out
there before you spend a lot of time on things I already did.