Author Topic: [DEV] - (DEPRECATED) calling app from Locus (4.5.2011)  (Read 2277 times)

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10868
  • Thanked: 190 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Method is deprecated, use Locus API


This is useful function that allow you to add shortcut into point submenu in Locus, and call your application with point coordinates.

Simple example:
  when you hold finger on screen, you then see address. Click on address and you get new point on place you tap (or when you click on red center cross, you get exactly map center). Now in last bottom submenu, is few items like Street view and more. And this tool add new item on top of this list. Nice :)

How to do this

  • register intent-filter for your activity
    Code: [Select]
    <intent-filter>
    <action android:name="menion.android.locus.ON_POINT_ACTION" />
    <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.ON_POINT_ACTION")) {
    double lat = getIntent().getDoubleExtra("latitude", 0.0);
    double lon = getIntent().getDoubleExtra("longitude", 0.0);
    double alt = getIntent().getDoubleExtra("altitude", 0.0);
    double acc = getIntent().getDoubleExtra("accuracy", 0.0);

    // do what you want with this ...
    }

and that's all.

Actual application that use this feature
...
« 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 fabiancz

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • http://home.fabian.cz
Re: [DEV] - calling app from Locus (4.5.2011)
« Reply #1 on: May 09, 2011, 18:48:02 »
This feature is used in Foursquare4Locus addon from version 0.2.1. See: viewtopic.php?f=26&t=550&p=3002#p3002
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Twitter: fabiancz