package cgeo.geocaching.apps.cache.navi;

import cgeo.geocaching.R;
import cgeo.geocaching.location.Geopoint;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;

/**
 * http://help.sygic.com/entries/22207668-developers-only-sygic-implementation-to-your-app-android-sdk-iphone-sdk-url-
 * handler
 *
 */
class SygicNavigationApp extends AbstractPointNavigationApp {

    private static final String PACKAGE = "com.sygic.aura";

    SygicNavigationApp() {
        super(getString(R.string.cache_menu_sygic), R.id.cache_app_sygic, null, PACKAGE);
    }

    @Override
    public void navigate(final Activity activity, final Geopoint coords) {
        final String str = "http://com.sygic.aura/coordinate|" + coords.getLongitude() + "|" + coords.getLatitude() + "|show";
        activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));
    }

}
@@ -102,16 +102,59 @@
 eopoint;
+%0Aimport cgeo.geocaching.utils.ProcessUtils;
 %0A%0Aimport
@@ -475,16 +475,23 @@
  PACKAGE
+_NORMAL
  = %22com.
@@ -507,123 +507,430 @@
 a%22;%0A
-%0A    SygicNavigationApp() %7B%0A        super(getString(R.string.cache_menu_sygic), R.id.cache_app_sygic, null, PACKAGE
+    /**%0A     * there is a secondary edition of this app%0A     */%0A    private static final String PACKAGE_VOUCHER = %22com.sygic.aura_voucher%22;%0A%0A    SygicNavigationApp() %7B%0A        super(getString(R.string.cache_menu_sygic), R.id.cache_app_sygic, null, PACKAGE_NORMAL);%0A    %7D%0A%0A    @Override%0A    public boolean isInstalled() %7B%0A        return ProcessUtils.isLaunchable(PACKAGE_NORMAL) %7C%7C ProcessUtils.isLaunchable(PACKAGE_VOUCHER
 );%0A 

fix #4518: recognize Sygic voucher edition