top
logo
Deutsch (DE-CH-AT)English (United Kingdom)

Like it? Share it!

Main Menu


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /www/htdocs/w006661d/anddev/andnav/libraries/joomla/cache/handler/callback.php on line 99

AndNav2


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /www/htdocs/w006661d/anddev/andnav/libraries/joomla/cache/handler/callback.php on line 99

Home
AndNav2 - Extended API PDF Print E-mail
Written by Nicolas Gramlich   
Monday, 22 December 2008 19:02

Hello Developers,

 the API you, as a developer, can interfere with AndNav2 has been extended. You can now make AndNav2 display a couple of GPS-locations along with a title and a description.

 This is what looks like having sent out some locations:

This is how it works:


 // Only AndNav2 will react!
public static final String ANDNAV2_VIEW_ACTION =
   "org.andnav2.intent.ACTION_VIEW";

private void sampleLocationRequest() {
// Create a bundle that will transfer the location-information
final Bundle b = new Bundle();

final ArrayList locations = new ArrayList();
// Add as many locations as you want here

// "Latitude,Longitude;Title;Description"
locations.add("50.119539,8.658031;Frankfurt;City Center");
// "Latitude,Longitude;Title;Description"
locations.add("50.133089,8.66729;Frankfurt (title is optional);"
+ "Just an optional description.. put anything here =) !!");
// "Latitude,Longitude;Title"
locations.add("50.133089,8.63729;Just a title, no decription");
// "Latitude,Longitude"
locations.add("50.124089,8.64729");

// Add the locations to the bungle using "locations" as the key
b.putStringArrayList("locations", locations);

// Create and broadcast an Intent that will
// start an AndNav-Map with the locations marked

final Intent locationIntent = new Intent(ANDNAV2_VIEW_ACTION);
locationIntent.putExtras(b);
sendBroadcast(locationIntent);
}

This will be available from the very next version of AndNav2!

We are open to any suggestion(s) Smile

 

Best Regards,
Nicolas

Last Updated on Saturday, 27 December 2008 20:38
 

bottom

Powered by Joomla!. Designed by: Free Joomla Themes, hosting.  Valid XHTML and CSS.