Interfacing with AndNav Drucken
Geschrieben von: Nicolas Gramlich   
Dienstag, 25. November 2008 um 03:54 Uhr
There are no translations available.

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);



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,

Zuletzt aktualisiert am Dienstag, 25. November 2008 um 05:02 Uhr