top
logo

Support AndNav

PayPal
US-Server kick-off.
Current Fundraising Progress

Login Form




Home
Interfacing with AndNav PDF Print E-mail
Written by Nicolas Gramlich   
Tuesday, 25 November 2008 03:54

Hello Developers,

 today I want to introduce the nice and small AndNav-API to you all. With this tiny example you can make any application use the full navigation capabilities of AndNav2 and or AndNav1. This API can be useful for any application, especially all kinds of Piggyback- or FriendFinder-Applications!

This is how you do it. Nothing more, nothing less:

 


    // Both(!) AndNav1 and AndNav2 will react!
    public static final String ANDNAV_NAV_ACTION = "org.andnav.intent.ACTION_NAV_TO";

    // Only AndNav2 will react!
    public static final String ANDNAV2_NAV_ACTION = "org.andnav2.intent.ACTION_NAV_TO";
    
    private void sampleNavRequest() {
        final Intent navTo = new Intent(ANDNAV2_NAV_ACTION);

        // Create a bundle that will transfer the routing-information
       final Bundle b = new Bundle();
        
        final ArrayList<String> vias = new ArrayList<String>();
        vias.add("50.119539,8.658031"); // "Latitude,Longitude"
        // Add as many waypoints as you want here
       
        b.putString("to", "50.133089,8.66729"); // "Latitude,Longitude"
        b.putStringArrayList("via", vias);
        
        navTo.putExtras(b);

        sendBroadcast(navTo);
    }


 

I think this sample is pretty clear, but please do not hesitate to ask any open questions in the comments Smile.

Note: AndNav2 will contain this interface from the first public release - AndNav1 from the next update!

Best Regards,
Nicolas

Last Updated ( Tuesday, 25 November 2008 05:02 )
 

Comments  

 
0 #2 Nicolas Gramlich 2008-11-25 18:08 Exactly Quote
 
 
+1 #1 flo 2008-11-25 18:05 Thanks a lot!
This is really cool: Now everyone can integrate navigation with a few lines of code :)
Quote
 

Add comment


Security code
Refresh


bottom

Powered by Joomla!.
Warning: call_user_func(tdo) [function.call-user-func]: First argument is expected to be a valid callback in /www/htdocs/w006661d/anddev/andnav/templates/themza_j15_06/html/pagination.php on line 153
Valid XHTML and CSS.