Android Sygic intent

2.9k Views Asked by At

I followed the instructions at http://dev.sygic.com/documentation/custom-url-schema/ & http://help.sygic.com/entries/22207668-Developers-Only-Sygic-implementation-to-your-app-Android-SDK-iPhone-SDK-Url-Handler-

I am passing the coordinates to Sygic 12.991030334592057 as latitude and 77.80791163444519 as longitude.

Another com.sygic.aura://coordinate|12.9138|77.6680|drive

However Sygic says 'The coordinates are outside the map.'

        String str = "http://com.sygic.aura/coordinate|" + latitude + "|"
            + longitude + "|" + type.toString();        
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

I also tried

        String str = "com.sygic.aura://coordinate|" + latitude + "|"
            + longitude + "|" + type.toString();        
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

EDIT: The type is enum. type.toString shows drive as the string.

What am I doing wrong?

2

There are 2 best solutions below

4
On

Got the same problem. As enli was saying, the order of the lat,lon params is the opposite. This code worked for me:

String str = "com.sygic.aura://coordinate|" + lon + "|" + lat + "|" + type.toString();        
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

in my phone, this example call launched sygic and started navigation:

com.sygic.aura://coordinate|-3.588678|37.176278|drive

Hope it helps

0
On

There is nothing wrong with your code. Have you made sure that those values of longitude and latitude are correct? With which application you got those co-ordinates?

I was working on the same code today and it seems that I had used longitude at the place of latitude and vice versa. Try interchanging the co-ordinates. That worked for me when I was in the same boat as yours. If that is not the case, make sure that you have Sygic maps for that location by manually navigating to that location by navigating to that location from Menu > Navigate to... > GPS coordinates.