Author Topic: [DEV] - (DEPRECATED) add Point from your app (19.4.2011)  (Read 2516 times)

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10662
  • Thanked: 160 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
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
    Code: [Select]
    <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.
    Code: [Select]
    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
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline migrations

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: [DEV] - add Point from your app (19.4.2011)
« Reply #1 on: June 29, 2011, 22:29:54 »
And the otherway around? Adding a point to your app using Locus? Is that possible?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10662
  • Thanked: 160 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - add Point from your app (19.4.2011)
« Reply #2 on: June 30, 2011, 05:40:37 »
wasn't needed ... till now? What exactly you need?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!