From 7344964c05cdaa3598eaf72de68ceb8157241d7f Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Sun, 13 Mar 2011 22:36:09 -0500 Subject: [PATCH 1/3] Add support for setting sms body using uri "sms:#?body=text". --- framework/src/com/phonegap/DroidGap.java | 45 +++++++++++++++++------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 7953d8ad..470ed9f8 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -946,19 +946,38 @@ public class DroidGap extends PhonegapActivity { return true; } - // If sms:5551212 - else if (url.startsWith("sms:")) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(url)); - intent.putExtra("address", url.substring(4)); - intent.setType("vnd.android-dir/mms-sms"); - startActivity(intent); - } catch (android.content.ActivityNotFoundException e) { - System.out.println("Error sending sms "+url+":"+ e.toString()); - } - return true; - } + // If sms:5551212?body=This is the message + else if (url.startsWith("sms:")) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + + // Get address + String address = null; + int parmIndex = url.indexOf('?'); + if (parmIndex == -1) { + address = url.substring(4); + } + else { + address = url.substring(4, parmIndex); + + // If body, then set sms body + Uri uri = Uri.parse(url); + String query = uri.getQuery(); + if (query != null) { + if (query.startsWith("body=")) { + intent.putExtra("sms_body", query.substring(5)); + } + } + } + intent.setData(Uri.parse("sms:"+address)); + intent.putExtra("address", address); + intent.setType("vnd.android-dir/mms-sms"); + startActivity(intent); + } catch (android.content.ActivityNotFoundException e) { + System.out.println("Error sending sms "+url+":"+ e.toString()); + } + return true; + } // All else else { From ec307fdda8f3003b3aa68c79d5933f0453bb5817 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Mon, 14 Mar 2011 16:15:19 -0700 Subject: [PATCH 2/3] Null check in droidgap classic (build script). --- lib/classic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classic.rb b/lib/classic.rb index 8c1ca2d8..cf9ab692 100755 --- a/lib/classic.rb +++ b/lib/classic.rb @@ -21,7 +21,7 @@ class Classic def setup @android_dir = File.expand_path(File.dirname(__FILE__).gsub(/lib$/,'')) @framework_dir = File.join(@android_dir, "framework") - @icon = File.join(@www, 'icon.png') unless File.exists?(@icon) + @icon = File.join(@www, 'icon.png') unless !@icon.nil? && File.exists?(@icon) # Hash that stores the location of icons for each resolution type. Uses the default icon for all resolutions as a baseline. @icons = { :"drawable-ldpi" => @icon, From 04de2052fdca8aba030df01383bfc4eb01a2394d Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Tue, 15 Mar 2011 12:46:05 -0700 Subject: [PATCH 3/3] As best a fix as can be made for issue 95: on HTC devices, if text input is in bottom half of page, it does not get scrolled up to top half of page when you tap it and virtual keyboard comes up. --- framework/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/AndroidManifest.xml b/framework/AndroidManifest.xml index bf2f9709..a97572ba 100644 --- a/framework/AndroidManifest.xml +++ b/framework/AndroidManifest.xml @@ -1,5 +1,5 @@ -