Example of usage OsmAnd API
The simplest way to integrate with OsmAnd intent API is to copy OsmAndHelper.java into your project, and call it's methods.
You can create URI yourself but it is suggested to use constants from OsmApiHelper anyway.
Simply requests data about OsmAnd status. Data returned as extras. Each key value pair as separate entity.
Request to start recording audio note for given location. Audio video notes plugin must be enabled. Otherwise OsmAnd will return RESULT_CODE_ERROR_PLUGIN_INACTIVE.
Request to start recording video note for given location. Audio video notes plugin must be enabled. Otherwise OsmAnd will return RESULT_CODE_ERROR_PLUGIN_INACTIVE.
Request to take photo for given location. Audio video notes plugin must be enabled. Otherwise OsmAnd will return RESULT_CODE_ERROR_PLUGIN_INACTIVE.
Stop recording audio or video. Audio video notes plugin must be enabled. Otherwise OsmAnd will return RESULT_CODE_ERROR_PLUGIN_INACTIVE.
Add map marker at given location.
Add favourite at given location
URI parameter: PARAM_CATEGORY - category of favourite item. Symbols that are not safe for directory name will be removed.
URI parameter: PARAM_COLOR - color of favourite item. Can be one of: "red", "orange", "yellow", "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown".
Start recording GPX track.
URI parameter: PARAM_CLOSE_AFTER_COMMAND - true if OsmAnd should be close immediately after executing command.
Stop recording GPX track.
URI parameter: PARAM_CLOSE_AFTER_COMMAND - true if OsmAnd should be close immediately after executing command.
Show GPX file on map. OsmAnd must have rights to access location. Not recommended.
Show GPX file on map. In current implementation it is recommended way to share file if your app supports API 15.
@TargetApi(16) Show GPX file on map. Recommended way to share file. In current implementation it is recommended way to share file if your app supports API 16 and above. URI created by FileProvider must be sent as ClipData
Navigate GPX file. OsmAnd must have rights to access location. Not recommended.
Navigate GPX file. In current implementation it is recommended way to share file if your app supports API 15.
@TargetApi(16) Navigate GPX file. Recommended way to share file. In current implementation it is recommended way to share file if your app supports API 16 and above. URI created by FileProvider must be sent as ClipData
Navigate from one location to another.