[DEV] - (DEPRECATED) add Point from your app (19.4.2011)

Started by Menion, April 19, 2011, 08:37:49

0 Members and 1 Guest are viewing this topic.

Menion

Method is deprecated, use Locus API



This is useful function that allow you to directly add point from you application to Locus. It's not the same as displaying points.

Simple example:
  go to Poi manager screen (screen with point in category). Tap first bottom button and you'll see list of action. What you can do to add point to this category. You can use GPS, map center and more. And in this list can appear also your application. So you can for example offer some searching on web, or in internal application storage and more ...

How to do this

  • register intent-filter for your activity
    <intent-filter>
    <action android:name="menion.android.locus.GET_POINT" />
    <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
  • now register intent receiver in your application.
    if (getIntent().getAction().equals("menion.android.locus.GET_POINT")) {
    // get some data here and finally return value back

    Intent intent = new Intent();
    // string value name
    intent.putExtra("name", "Point name"); // optional
    // rest are all DOUBLE values (to avoid problems even when for acc and alt isn't double needed)
    intent.putExtra("latitude", 50.0); // required, not 0.0
    intent.putExtra("longitude", 14.0); // required, not 0.0
    intent.putExtra("altitude", 0.0); // optional
    intent.putExtra("accuracy", 0.0); // optional
    setResult(RESULT_OK, intent);
    finish();
    }

and that's all. You application appear now in list!

Actual application that use this feature
GPS Averaging
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

migrations

#1
And the otherway around? Adding a point to your app using Locus? Is that possible?
  •  

Menion

#2
wasn't needed ... till now? What exactly you need?
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •