From a820bdff45334e153878b5dc549ed97df674e0ae Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 26 Sep 2013 15:46:49 +0400 Subject: [PATCH] update plugin and readme --- README.md | 4 ++-- src/android/startApp.java | 25 +------------------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 7a37ef9..2b0cbcd 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ cordova-plugin-startapp Phonegap 3.0.0 plugin for launch other application in android device. -Install: ```cordova plugin add https://github.com/lampaa/startApp.git``` +Install: ```cordova plugin add https://github.com/lampaa/org.apache.cordova.startapp.git``` -Delete: ```cordova plugin rm org.apache.cordova.core.startapp``` +Delete: ```cordova plugin rm org.apache.cordova.startapp``` use: ```js diff --git a/src/android/startApp.java b/src/android/startApp.java index 99b7adb..da04435 100644 --- a/src/android/startApp.java +++ b/src/android/startApp.java @@ -52,7 +52,6 @@ public class startApp extends CordovaPlugin { */ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { if (action.equals("startapp")) { - this.beep(1); this.startApp(args.getString(0)); } else { @@ -70,30 +69,8 @@ public class startApp extends CordovaPlugin { /** - * Beep plays the default notification ringtone. - * - * @param count Number of times to play notification + * startApp */ - public void beep(long count) { - Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); - Ringtone notification = RingtoneManager.getRingtone(this.cordova.getActivity().getBaseContext(), ringtone); - - // If phone is not set to silent mode - if (notification != null) { - for (long i = 0; i < count; ++i) { - notification.play(); - long timeout = 5000; - while (notification.isPlaying() && (timeout > 0)) { - timeout = timeout - 100; - try { - Thread.sleep(100); - } catch (InterruptedException e) { - } - } - } - } - } - public void startApp(String component) { Intent LaunchIntent = this.cordova.getActivity().getPackageManager().getLaunchIntentForPackage(component); this.cordova.getActivity().startActivity(LaunchIntent);