Skip to content

Instantly share code, notes, and snippets.

@chmouel
Created May 25, 2010 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chmouel/412643 to your computer and use it in GitHub Desktop.
Save chmouel/412643 to your computer and use it in GitHub Desktop.
Index: android/src/com/google/android/apps/chrometophone/C2DMReceiver.java
===================================================================
--- android/src/com/google/android/apps/chrometophone/C2DMReceiver.java (revision 11)
+++ android/src/com/google/android/apps/chrometophone/C2DMReceiver.java (working copy)
@@ -82,6 +82,16 @@
}
}
+ private String cyrketToMarket(String url) {
+ String ret = url.substring(32);
+ Log.w(TAG, "Converting cyrket link to market");
+
+ if (ret.endsWith("/"))
+ ret = ret.substring(0, ret.length() - 1);
+ return "market://search?q=pname:" + ret;
+ }
+
+
private void launchBrowserOrMaps(Context context, String url, String title) {
final String GMM_PACKAGE_NAME = "com.google.android.apps.maps";
final String GMM_CLASS_NAME = "com.google.android.maps.MapsActivity";
@@ -90,6 +100,9 @@
RingtoneManager.getRingtone(context,
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)).play();
+ if (url.startsWith("http://www.cyrket.com/p/android/"))
+ url = this.cyrketToMarket(url);
+
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment