diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7591c3d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,29 @@
+**/.idea/dictionaries
+**/.idea/gradle.xml
+**/.idea/libraries
+**/.idea/tasks.xml
+**/.idea/workspace.xml
+*.iws
+.DS_Store
+.classpath
+.gradle
+.nb-gradle
+.project
+.settings
+/.classpath
+/.fbprefs
+/.pmd
+/.project
+/.svn/
+/bin
+/build
+/deploy
+/dist
+/gen
+/local.properties
+/out
+/proguard-project.txt
+/project.properties
+/test-output
+Thumbs.db
+ehthumbs.db
\ No newline at end of file
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b9412ba..6734ae1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,15 +1,29 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:installLocation="auto"
+ package="net.thauvin.erik.android.googsms"
+ android:versionCode="3"
+ android:versionName="0.3" >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/default.properties b/default.properties
new file mode 100644
index 0000000..c5d5335
--- /dev/null
+++ b/default.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Indicates whether an apk should be generated for each density.
+split.density=false
+# Project target.
+target=android-8
+apk-configurations=
diff --git a/src/net/thauvin/erik/android/googsms/R.java b/gen/net/thauvin/erik/android/googsms/R.java
similarity index 51%
rename from src/net/thauvin/erik/android/googsms/R.java
rename to gen/net/thauvin/erik/android/googsms/R.java
index 7d16384..36dae30 100644
--- a/src/net/thauvin/erik/android/googsms/R.java
+++ b/gen/net/thauvin/erik/android/googsms/R.java
@@ -31,30 +31,29 @@ public final class R {
public static final int main=0x7f030001;
}
public static final class string {
- public static final int about_menu_txt=0x7f06000a;
- public static final int about_txt=0x7f060009;
- public static final int alert_dialog_ok=0x7f06000c;
- public static final int app_name=0x7f060001;
- public static final int default_google_sms=0x7f060008;
- public static final int hello=0x7f060000;
- public static final int main_location_err_txt=0x7f060007;
- public static final int main_query_err_txt=0x7f060006;
- public static final int main_query_lbl_txt=0x7f060002;
- public static final int main_send_btn_txt=0x7f060004;
- public static final int main_sms_sent_txt=0x7f060005;
- public static final int main_type_lbl_txt=0x7f060003;
- public static final int prefs_dialog_title=0x7f06000d;
- public static final int prefs_key_loc=0x7f060017;
- public static final int prefs_key_sms=0x7f060016;
- public static final int prefs_location_dialog_title=0x7f06000e;
- public static final int prefs_location_hint=0x7f060011;
- public static final int prefs_location_summary=0x7f060010;
- public static final int prefs_location_title=0x7f06000f;
- public static final int prefs_menu_txt=0x7f06000b;
- public static final int prefs_sms_dialog_title=0x7f060012;
- public static final int prefs_sms_hint=0x7f060015;
- public static final int prefs_sms_summary=0x7f060014;
- public static final int prefs_sms_title=0x7f060013;
+ public static final int about_menu_txt=0x7f060009;
+ public static final int about_txt=0x7f060008;
+ public static final int alert_dialog_ok=0x7f06000b;
+ public static final int app_name=0x7f060000;
+ public static final int default_google_sms=0x7f060007;
+ public static final int main_location_err_txt=0x7f060006;
+ public static final int main_query_err_txt=0x7f060005;
+ public static final int main_query_lbl_txt=0x7f060001;
+ public static final int main_send_btn_txt=0x7f060003;
+ public static final int main_sms_sent_txt=0x7f060004;
+ public static final int main_type_lbl_txt=0x7f060002;
+ public static final int prefs_dialog_title=0x7f06000c;
+ public static final int prefs_key_loc=0x7f060016;
+ public static final int prefs_key_sms=0x7f060015;
+ public static final int prefs_location_dialog_title=0x7f06000d;
+ public static final int prefs_location_hint=0x7f060010;
+ public static final int prefs_location_summary=0x7f06000f;
+ public static final int prefs_location_title=0x7f06000e;
+ public static final int prefs_menu_txt=0x7f06000a;
+ public static final int prefs_sms_dialog_title=0x7f060011;
+ public static final int prefs_sms_hint=0x7f060014;
+ public static final int prefs_sms_summary=0x7f060013;
+ public static final int prefs_sms_title=0x7f060012;
}
public static final class xml {
public static final int prefs=0x7f040000;
diff --git a/res/layout/main.xml b/res/layout/main.xml
index a31ec84..e6cd564 100644
--- a/res/layout/main.xml
+++ b/res/layout/main.xml
@@ -1,26 +1,53 @@
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:padding="10dip" >
-
+
+
-
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 4ea0b65..b14b43b 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -1,77 +1,68 @@
-
- - Search
- - Web Snippets
- - Local Search
- - Local Movies
- - Local Weather
- - Airports
- - Area Codes
- - Calculator
- - Currency Conversion
- - Directions
- - Flights
- - Glossary
- - METAR
- - Maps
- - Movies
- - Products
- - Q&A
- - Sports
- - Stocks
- - Translation
- - Weather
- - Zip Codes
-
-
-
- - %s
- - web %s
- - %s %l
- - movies %%s %l
- - weather %l
- - %s airport
- - area code %s
- - %s
- - %s
- - directions %s
- - flight %s
- - define %s
- - metar %s
- - map %s
- - movies %s
- - price %s
- - %s
- - score %s
- - stock %s
- - translate %s
- - weather %s
- - zip code %s
-
-
-
- - blockbuster seattle wa
- - search terms, e.g.: t-mobile g1
- - business listing, sushi, pizza, etc.
- - No query or current movie name
- - No query required
- - airport code, e.g.: sfo
- - area code, e.g.: 650
- - 1 us pint in liters, 5+2/2, etc.
- - 8 usd in yen
- - pasadena ca to 94043
- - aa 2111, ua 14, etc.
- - word to define, e.g.: zenith
- - ICAO airport code, e.g.: khio
- - 5th avenue new york
- - current movie name boston, ma
- - ipod 40gb, UPC/ISBN, etc.
- - india population
- - NBA/NHL/MLB/NFL/NCAA team
- - ticker symbol, e.g.: goog
- - hello in french
- - new york, ny
- - 90210
-
-
+
+
+ - Search
+ - Web Snippets
+ - Local Search
+ - Local Movies
+ - Local Weather
+ - Calculator
+ - Currency Conversion
+ - Directions
+ - Glossary
+ - Maps
+ - Movies
+ - Products
+ - Sports
+ - Stocks
+ - Time
+ - Translation
+ - Weather
+ - Zip Codes
+ - Help
+
+
+ - %s
+ - WEB %s
+ - %s %l
+ - MOVIES %%s %l
+ - WEATHER %l
+ - %s
+ - %s
+ - DIRECTIONS %s
+ - DEFINE %s
+ - MAP %s
+ - %s
+ - PRICE %s
+ - SCORE %s
+ - STOCK %s
+ - TIME %s
+ - TRANSLATE %s
+ - WEATHER %s
+ - ZIP CODE %s
+ - HELP %s
+
+
+ - blockbuster seattle wa
+ - search terms, e.g.: galaxy nexus
+ - business listing, sushi, pizza, etc.
+ - No query or current movie name
+ - No query required
+ - 1 us pint in liters, 5+2/2, etc.
+ - 8 usd in yen
+ - pasadena ca to 94043
+ - word to define, e.g.: zenith
+ - 5th avenue new york
+ - current movie name boston, ma
+ - ipod 40gb, UPC/ISBN, etc.
+ - NBA/NHL/MLB/NFL/NCAA team
+ - ticker symbol, e.g.: goog
+ - new york, ny
+ - hello in french
+ - new york, ny
+ - 90210
+ - search feature, e.g.: local, etc.
+
+
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9156f9d..2e7f85d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,27 +1,28 @@
- Hello World, GoogSMS
- GoogSMS
- Query:
- Type:
- Send via SMS
- Your message was sent.
- Please enter a query...
- Please set your location...
- 466453
- © 2008 Erik C. Thauvin\nAll Rights Reserved\n\nerik@thauvin.net\n\nhttp://mobile.thauvin.net
- About
- Preferences
- OK
- Preferences
- Set Your Location...
- Location
- Your current city and state or zip.
- e.g.: san francisco ca or 94123
- Set SMS Number...
- Google SMS
- The short code or number of the Google SMS service.
- e.g.: 466453
- prefs_sms
- prefs_loc
-
+
+ GoogSMS
+ Query:
+ Type:
+ Send via SMS
+ Your message was sent.
+ Please enter a query!
+ Please set your location…
+ 466453
+ © 2008–12 Erik C. Thauvin\nAll Rights Reserved\n\nerik@thauvin.net\nhttp://m.thauvin.net/android/
+ About
+ Preferences
+ OK
+ Preferences
+ Set Your Location…
+ Location
+ Your current city and state or zip.
+ e.g.: san francisco ca or 94123
+ Set SMS Number…
+ Google SMS
+ The short code or number of the Google SMS service.
+ e.g.: 466453
+ prefs_sms
+ prefs_loc
+
+
\ No newline at end of file
diff --git a/screenshots/1.png b/screenshots/1.png
new file mode 100644
index 0000000..5e9b436
Binary files /dev/null and b/screenshots/1.png differ
diff --git a/screenshots/2.png b/screenshots/2.png
new file mode 100644
index 0000000..d10b645
Binary files /dev/null and b/screenshots/2.png differ
diff --git a/screenshots/feature.png b/screenshots/feature.png
new file mode 100644
index 0000000..f8014ee
Binary files /dev/null and b/screenshots/feature.png differ
diff --git a/screenshots/icon-hi.png b/screenshots/icon-hi.png
new file mode 100644
index 0000000..7a7b7fb
Binary files /dev/null and b/screenshots/icon-hi.png differ
diff --git a/screenshots/promo.png b/screenshots/promo.png
new file mode 100644
index 0000000..90f3011
Binary files /dev/null and b/screenshots/promo.png differ
diff --git a/src/net/thauvin/erik/android/googsms/GoogSMS.java b/src/net/thauvin/erik/android/googsms/GoogSMS.java
index 534ca47..44d97f9 100644
--- a/src/net/thauvin/erik/android/googsms/GoogSMS.java
+++ b/src/net/thauvin/erik/android/googsms/GoogSMS.java
@@ -1,7 +1,7 @@
/*
* @(#)GoogSMS.java
*
- * Copyright (c) 2008, Erik C. Thauvin (http://erik.thauvin.net/)
+ * Copyright (c) 2008-2010, Erik C. Thauvin (http://erik.thauvin.net/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id$
+ * $Id: GoogSMS.java 81 2010-06-29 12:59:19Z erik $
*
*/
package net.thauvin.erik.android.googsms;
@@ -46,32 +46,40 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.telephony.gsm.SmsManager;
import android.text.ClipboardManager;
+import android.text.Editable;
import android.text.TextUtils;
-import android.util.Log;
+import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.View;
+import android.view.View.OnTouchListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.Spinner;
+import android.widget.TextView;
import android.widget.Toast;
/**
* The GoogSMS
class implements a simple front-end for Google SMS.
*
* @author Erik C. Thauvin
- * @version $Revision$, $Date$
+ * @version $Revision: 81 $, $Date: 2010-06-29 05:59:19 -0700 (Tue, 29 Jun 2010) $
* @created Nov 2, 2008
* @since 1.0
*/
+@SuppressWarnings("deprecation")
public class GoogSMS extends Activity
{
+ private static final boolean DEBUG = false;
+
private static final int MAX_HISTORY_SIZE = 15;
private static final int MENU_ABOUT = 0;
private static final int MENU_PREFS = 1;
@@ -196,6 +204,58 @@ public class GoogSMS extends Activity
}
});
+ final Drawable imgX = getResources().getDrawable(android.R.drawable.presence_offline);
+
+ manageClearButton(queryFld, imgX);
+
+ queryFld.setOnTouchListener(new OnTouchListener()
+ {
+ @Override
+ public boolean onTouch(View v, MotionEvent event)
+ {
+ // Is there an X showing?
+ if (queryFld.getCompoundDrawables()[2] == null)
+ {
+ return false;
+ }
+
+ // Only do this for up touches
+ if (event.getAction() != MotionEvent.ACTION_UP)
+ {
+ return false;
+ }
+
+ // Is touch on our clear button?
+ if (event.getX() > queryFld.getWidth() - queryFld.getPaddingRight() - imgX.getIntrinsicWidth())
+ {
+ queryFld.requestFocusFromTouch();
+ queryFld.setText("");
+ }
+ return false;
+ }
+ });
+
+ queryFld.addTextChangedListener(new TextWatcher()
+ {
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count)
+ {
+ manageClearButton(queryFld, imgX);
+ }
+
+ @Override
+ public void afterTextChanged(Editable s)
+ {
+
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after)
+ {
+
+ }
+ });
+
sendBtn.setOnClickListener(new Button.OnClickListener()
{
public void onClick(View view)
@@ -257,13 +317,18 @@ public class GoogSMS extends Activity
final SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(getSmsNumber(), null, s2, null, null);
-
+
addHistory(query);
setAutoComplete(queryFld);
- Toast.makeText(GoogSMS.this, R.string.main_sms_sent_txt, Toast.LENGTH_SHORT).show();
-
- Log.v("SMS SENT: ", s2);
+ if (DEBUG)
+ {
+ Toast.makeText(GoogSMS.this, s2, Toast.LENGTH_LONG).show();
+ }
+ else
+ {
+ Toast.makeText(GoogSMS.this, R.string.main_sms_sent_txt, Toast.LENGTH_SHORT).show();
+ }
}
}
@@ -315,9 +380,9 @@ public class GoogSMS extends Activity
final LayoutInflater factory = LayoutInflater.from(this);
final View aboutView = factory.inflate(R.layout.about, null);
- new AlertDialog.Builder(this).setView(aboutView).setIcon(android.R.drawable.ic_dialog_info).setTitle(
- getString(R.string.app_name) + ' ' + getVersionNumber()).setPositiveButton(R.string.alert_dialog_ok,
- new DialogInterface.OnClickListener()
+ new AlertDialog.Builder(this).setView(aboutView).setIcon(android.R.drawable.ic_dialog_info)
+ .setTitle(getString(R.string.app_name) + ' ' + getVersionNumber())
+ .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
@@ -387,4 +452,24 @@ public class GoogSMS extends Activity
{
mSmsNumber = smsNumber;
}
+
+ /**
+ * Manages the clear button.
+ *
+ * @param view The text view.
+ * @param img The image.
+ */
+ private void manageClearButton(TextView view, Drawable img)
+ {
+ if (view.getText().toString().equals(""))
+ {
+ view.setCompoundDrawablesWithIntrinsicBounds(view.getCompoundDrawables()[0], view.getCompoundDrawables()[1], null,
+ view.getCompoundDrawables()[3]);
+ }
+ else
+ {
+ view.setCompoundDrawablesWithIntrinsicBounds(view.getCompoundDrawables()[0], view.getCompoundDrawables()[1], img,
+ view.getCompoundDrawables()[3]);
+ }
+ }
}
\ No newline at end of file