diff --git a/GooglME-1.iws b/GooglME-1.iws index 3550995..7dc7bfa 100755 --- a/GooglME-1.iws +++ b/GooglME-1.iws @@ -115,7 +115,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -133,28 +133,28 @@ - + - + - + - + @@ -163,7 +163,7 @@ - + @@ -179,25 +179,25 @@ - - - + + + - - - - - - + + + + + + @@ -231,12 +231,19 @@ - - - - - - @@ -330,21 +330,21 @@ - + - + - - + + - + @@ -444,9 +444,16 @@ + + + + + + + - + @@ -455,7 +462,7 @@ - + @@ -464,28 +471,28 @@ - + - + - + - + @@ -494,7 +501,7 @@ - + diff --git a/GooglME-2.iws b/GooglME-2.iws index 97e7baf..eac11b6 100755 --- a/GooglME-2.iws +++ b/GooglME-2.iws @@ -112,10 +112,10 @@ - + - + @@ -143,14 +143,14 @@ - + - + @@ -180,7 +180,7 @@ - + @@ -201,30 +201,30 @@ + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -357,13 +357,13 @@ - + - + @@ -467,6 +467,20 @@ + + + + + + + + + + + + + + @@ -476,14 +490,14 @@ - + - + @@ -513,28 +527,14 @@ - + - - - - - - - - - - - - - - - + diff --git a/GooglME-2.jad b/GooglME-2.jad index 8bb4723..968d158 100755 --- a/GooglME-2.jad +++ b/GooglME-2.jad @@ -1,7 +1,7 @@ MIDlet-1: GooglME,/googlme.png,net.thauvin.j2me.googlme.GooglME MIDlet-Jar-URL: GooglME-2.jar MIDlet-Icon: /googlme.png -MIDlet-Version: 0.4.1 +MIDlet-Version: 0.4.2 MIDlet-Description: GooglME MIDlet-Name: GooglME MIDlet-Vendor: Erik C. Thauvin diff --git a/GooglME.jad b/GooglME.jad index 0cab898..cf7964e 100755 --- a/GooglME.jad +++ b/GooglME.jad @@ -1,7 +1,7 @@ MIDlet-1: GooglME,/googlme.png,net.thauvin.j2me.googlme.GooglME MIDlet-Jar-URL: GooglME.jar MIDlet-Icon: /googlme.png -MIDlet-Version: 0.4.1 +MIDlet-Version: 0.4.2 MIDlet-Description: GooglME MIDlet-Name: GooglME MIDlet-Vendor: Erik C. Thauvin diff --git a/googlme.wml b/googlme.wml index d0277aa..837758b 100755 --- a/googlme.wml +++ b/googlme.wml @@ -8,7 +8,7 @@

- GoogleME 0.4.1 (~13Kb)
+ GoogleME 0.4.2 (~13Kb)

MIDP 2.0
diff --git a/lib/cldcapi10.jar b/lib/cldcapi10.jar index 9b4bf49..d53b92b 100755 Binary files a/lib/cldcapi10.jar and b/lib/cldcapi10.jar differ diff --git a/lib/midpapi10.jar b/lib/midpapi10.jar index f7a0634..58514a9 100755 Binary files a/lib/midpapi10.jar and b/lib/midpapi10.jar differ diff --git a/lib/midpapi20.jar b/lib/midpapi20.jar index 9969041..46d9dc0 100755 Binary files a/lib/midpapi20.jar and b/lib/midpapi20.jar differ diff --git a/src/net/thauvin/j2me/googlme/GooglME.java b/src/net/thauvin/j2me/googlme/GooglME.java index cbb0875..7d90976 100755 --- a/src/net/thauvin/j2me/googlme/GooglME.java +++ b/src/net/thauvin/j2me/googlme/GooglME.java @@ -112,7 +112,7 @@ public class GooglME extends MIDlet implements CommandListener, Runnable /** * The application version. */ - protected static final String APP_VERSION = "0.4.1"; + protected static final String APP_VERSION = "0.4.2"; /** * The Back command. @@ -288,10 +288,10 @@ public class GooglME extends MIDlet implements CommandListener, Runnable { if (isValidString(_address)) { - _query = _mainScreen.queryFld.getString(); + /* final */ String q = _mainScreen.queryFld.getString(); _action = CHOICES[_mainScreen.actionPopup.getSelectedIndex()]; - if (isValidString(_query)) + if (isValidString(q)) { if (((_action.equals(CHOICE_GOOGLE_LOCAL)) || (_action.equals(CHOICE_LOCAL_SHOWTIMES))) && !isValidString(_location)) @@ -305,6 +305,11 @@ public class GooglME extends MIDlet implements CommandListener, Runnable _sendingAlert = new Alert(""); } + _query = buildQuery(q); + + addHistory(_query); + saveHistory(); + alert(_sendingAlert, "Sending SMS", "Sending message to " + _address + "...", d, 2500, false); new Thread(this).start(); @@ -573,10 +578,8 @@ public class GooglME extends MIDlet implements CommandListener, Runnable { _history.removeElementAt(MAX_HISTORY - 1); } - + _history.insertElementAt(query, 0); - - saveHistory(); } // Displays a modal message/error alert dialog. @@ -606,6 +609,75 @@ public class GooglME extends MIDlet implements CommandListener, Runnable _display.setCurrent(alert, d); } + // Builds the full query . + private String buildQuery(String query) + { + /* final */ String text; + + if (_action.equals(CHOICE_GOOGLE_LOCAL)) + { + if (isValidString(_location)) + { + text = query + '.' + _location; + } + else + { + text = query; + } + } + + // Froogle + else if (_action.equals(CHOICE_FROOGLE_PRICES)) + { + text = PREFIX_FROOGLE + query; + } + + // Google + else if (_action.equals(CHOICE_GOOGLE_SEARCH)) + { + text = PREFIX_GOOGLE + query; + } + + // Definition + else if (_action.equals(CHOICE_DEFINITION)) + { + text = PREFIX_DEFINITION + query; + } + + // Showtimes + else if (_action.equals(CHOICE_MOVIE_SHOWTIMES)) + { + text = PREFIX_MOVIE + query; + } + + // Local Showtimes + else if (_action.equals(CHOICE_LOCAL_SHOWTIMES)) + { + if (isValidString(_location)) + { + text = PREFIX_MOVIE + query + ' ' + _location; + } + else + { + text = PREFIX_MOVIE + query; + } + } + + // Weather + else if (_action.equals(CHOICE_WEATHER)) + { + text = PREFIX_WEATHER + query; + } + + // Default + else + { + text = query; + } + + return text; + } + // Exits the application. private void exit() { @@ -674,73 +746,8 @@ public class GooglME extends MIDlet implements CommandListener, Runnable /* final */ TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE); msg.setAddress(address); - /* final */ String text; + msg.setPayloadText(_query); - if (_action.equals(CHOICE_GOOGLE_LOCAL)) - { - if (isValidString(_location)) - { - text = _query + '.' + _location; - } - else - { - text = _query; - } - } - - // Froogle - else if (_action.equals(CHOICE_FROOGLE_PRICES)) - { - text = PREFIX_FROOGLE + _query; - } - - // Google - else if (_action.equals(CHOICE_GOOGLE_SEARCH)) - { - text = PREFIX_GOOGLE + _query; - } - - // Definition - else if (_action.equals(CHOICE_DEFINITION)) - { - text = PREFIX_DEFINITION + _query; - } - - // Showtimes - else if (_action.equals(CHOICE_MOVIE_SHOWTIMES)) - { - text = PREFIX_MOVIE + _query; - } - - // Local Showtimes - else if (_action.equals(CHOICE_LOCAL_SHOWTIMES)) - { - if (isValidString(_location)) - { - text = PREFIX_MOVIE + _query + ' ' + _location; - } - else - { - text = PREFIX_MOVIE + _query; - } - } - - // Weather - else if (_action.equals(CHOICE_WEATHER)) - { - text = PREFIX_WEATHER + _query; - } - - // Default - else - { - text = _query; - } - - // NOTE: Must be preformed before sending the SMS on the T616. - addHistory(text); - - msg.setPayloadText(text); conn.send(msg); //alert("SMS Sent", "The text message was sent.", _mainScreen, false);