简体   繁体   中英

How to open Sygic maps using intent?

I am trying to search for an place in the sygic app using

  String str = "com.sygic.aura://search|Gas%Station";
  startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

as intended by the documentation . However the code only opens the app, and the search bar is empty. It doesn't search for anything.

What am I doing wrong? I have spent hours trying to look for and figure out a solution.

Few trials you could make, if you havent done so, from my research on sygic documentation and google( I have not used the sygic app)

  1. Try using + sign for space, like Gas+Station in your search string, if %20 is not solving the issue. URL encoding the space character: + or %20?

  2. Since the doucmentation mentions to follow encoding, try rewriting Url as per documnentation example " Please note that for majority of uses the parameter string needs to be URL-encoded (so called percent encoding). It normally relates to the following characters: "#%<>[]^`{|} and the SPACE. For exact rules check the documentation on Encoding Example: Instead of com.sygic.aura://route_download|http://dat.my.com/my route.sif use com.sygic.aura://route_download%7Chttp%3A%2F%2Fdata.my.com%2Fmy%20route.sif"

  3. Checkout this example provided in documentation. Maybe you want to split "Gas Station" into 2 strings

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM