Added a history list. (from 0.2 beta 1)

Added a permanent location setting. (from 0.2 beta 1)
Added SMS number setting. (from 0.2 beta 2)
Added Movie Showtimes search otpion.
Added Local Showtimes search option.
This commit is contained in:
Erik C. Thauvin 2005-02-24 15:07:46 +00:00
parent a2aa9fe4e1
commit 722ac10dcf
18 changed files with 1396 additions and 268 deletions

View file

@ -2,6 +2,13 @@
<project version="4" relativePaths="false">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<additionalClassPath />
<antReference name="Local Ant" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<properties />
</buildFile>
</component>
<component name="BSFConsole">
<sendcommandbycontrolenter>false</sendcommandbycontrolenter>
@ -241,16 +248,6 @@
</modules>
</component>
<component name="ProjectRootManager" version="2" assert-keyword="false" jdk-15="false" project-jdk-name="1.4.x" />
<component name="Regex">
<option name="pos1" value="218" />
<option name="pos2" value="218" />
<option name="pos3" value="162" />
<option name="pos4" value="444" />
<option name="pos5" value="162" />
<option name="autoUpdate" value="true" />
<option name="referenceOn" value="false" />
<option name="referencePos" value="0" />
</component>
<component name="RmicSettings">
<option name="IS_EANABLED" value="false" />
<option name="DEBUGGING_INFO" value="true" />

View file

@ -115,14 +115,55 @@
<first-group selected-file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/GooglME.java">
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/GooglME.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="115" column="16" selection-start="3617" selection-end="3617" vertical-scroll-proportion="0.97969544">
<state line="245" column="54" selection-start="6316" selection-end="6316" vertical-scroll-proportion="3.7421384">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/RmsIndex.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="32" column="26" selection-start="1398" selection-end="1398" vertical-scroll-proportion="0.055555556">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HistoryScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="59" column="56" selection-start="2129" selection-end="2129" vertical-scroll-proportion="0.42767295">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HelpScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="65" column="49" selection-start="2739" selection-end="2739" vertical-scroll-proportion="0.5250266">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/MainScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="62" column="36" selection-start="2254" selection-end="2254" vertical-scroll-proportion="0.38155136">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/PrefsScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="57" column="36" selection-start="2090" selection-end="2090" vertical-scroll-proportion="0.34591195">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme/Util.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="86" column="23" selection-start="2756" selection-end="2756" vertical-scroll-proportion="0.72772276">
<state line="75" column="59" selection-start="2564" selection-end="2564" vertical-scroll-proportion="0.6415094">
<folding />
</state>
</provider>
@ -143,15 +184,20 @@
<component name="J2EEProjectPane" />
<component name="NamedScopeManager" />
<component name="PackagesPane">
<expanded_node url="net.thauvin.j2me.googlme" module="GooglME-1" type="package" />
<expanded_node url="net.thauvin" module="GooglME-1" type="package" />
<expanded_node url="net" module="GooglME-1" type="package" />
<expanded_node url="net.thauvin.j2me" module="GooglME-1" type="package" />
<expanded_node url="" module="GooglME-1" type="module" />
<expanded_node url="net.thauvin.j2me" module="GooglME-1" type="package" />
<expanded_node url="net.thauvin.j2me.googlme" module="GooglME-1" type="package" />
</component>
<component name="ProjectPane">
<expanded_node url="file://$PROJECT_DIR$/src/net/thauvin" module="GooglME-1" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net" module="GooglME-1" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme" module="GooglME-1" type="directory" />
<expanded_node url="file://$PROJECT_DIR$" module="GooglME-1" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net/thauvin/j2me" module="GooglME-1" type="directory" />
<expanded_node url="" module="GooglME-1" type="module" />
<expanded_node url="file://$PROJECT_DIR$/src" module="GooglME-1" type="directory" />
</component>
<component name="ProjectView">
<navigator currentView="PackagesPane" splitterProportion="0.5">
@ -173,21 +219,24 @@
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
</component>
<component name="Regex">
<option name="pos1" value="218" />
<option name="pos2" value="218" />
<option name="pos3" value="162" />
<option name="pos4" value="444" />
<option name="pos5" value="162" />
<option name="autoUpdate" value="true" />
<option name="referenceOn" value="false" />
<option name="referencePos" value="0" />
</component>
<component name="RunManager">
<activeType name="Application" />
<configuration selected="false" default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="PACKAGE_NAME" />
<configuration selected="false" default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ADDITIONAL_CLASS_PATH" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="wholeProject" />
</option>
<module name="" />
</configuration>
<configuration selected="false" default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
@ -196,12 +245,15 @@
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration selected="false" default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<configuration selected="false" default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="C:/IntelliJ-IDEA/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
<configuration selected="false" default="true" type="WebLogic Instance" factoryName="Local">
<option name="WORKING_DIRECTORY" />
@ -217,15 +269,19 @@
<option name="SERVER_NAME" value="myserver" />
<option name="DOMAIN_NAME" value="mydomain" />
</configuration>
<configuration selected="false" default="true" type="Applet" factoryName="Applet">
<configuration selected="false" default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="C:/IntelliJ-IDEA/bin/appletviewer.policy" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ADDITIONAL_CLASS_PATH" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="wholeProject" />
</option>
</configuration>
</component>
<component name="SelectInManager" />
@ -274,26 +330,28 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-4" y="-4" width="1032" height="776" extended-state="0" />
<frame x="46" y="6" width="1445" height="1124" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Properties File Structure" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="4" />
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Regex" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="7" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.22244897" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="1" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.2" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="1" />
<window_info id="Jalopy" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="-1" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.2734694" order="1" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="8" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.39969134" order="6" />
<window_info id="Profile" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="-1" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.17142858" order="2" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="2" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="3" />
<window_info id="CVS File View" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="0" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="1" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="4" />
<window_info id="BSFConsole" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="1" />
<window_info id="Properties File Structure" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="4" />
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="0" />
<window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="3" />
@ -366,18 +424,77 @@
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<antCommandLine value="" />
<runInBackground value="false" />
<targetFilters>
<filter targetName="jar" isVisible="false" />
<filter targetName="compile-2" isVisible="false" />
<filter targetName="compile" isVisible="false" />
<filter targetName="init" isVisible="false" />
<filter targetName="build" isVisible="true" />
<filter targetName="run-2" isVisible="false" />
<filter targetName="clean" isVisible="false" />
<filter targetName="run" isVisible="false" />
<filter targetName="jar-2" isVisible="false" />
</targetFilters>
<treeView value="true" />
<verbose value="true" />
<viewClosedWhenNoErrors value="false" />
</buildFile>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/GooglME.java">
<provider selected="true" editor-type-id="text-editor">
<state line="115" column="16" selection-start="3617" selection-end="3617" vertical-scroll-proportion="0.97969544">
<state line="245" column="54" selection-start="6316" selection-end="6316" vertical-scroll-proportion="3.7421384">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/RmsIndex.java">
<provider selected="true" editor-type-id="text-editor">
<state line="32" column="26" selection-start="1398" selection-end="1398" vertical-scroll-proportion="0.055555556">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HistoryScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="59" column="56" selection-start="2129" selection-end="2129" vertical-scroll-proportion="0.42767295">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HelpScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="65" column="49" selection-start="2739" selection-end="2739" vertical-scroll-proportion="0.5250266">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/MainScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="62" column="36" selection-start="2254" selection-end="2254" vertical-scroll-proportion="0.38155136">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/PrefsScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="57" column="36" selection-start="2090" selection-end="2090" vertical-scroll-proportion="0.34591195">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme/Util.java">
<provider selected="true" editor-type-id="text-editor">
<state line="86" column="23" selection-start="2756" selection-end="2756" vertical-scroll-proportion="0.72772276">
<state line="75" column="59" selection-start="2564" selection-end="2564" vertical-scroll-proportion="0.6415094">
<folding />
</state>
</provider>

View file

@ -36,7 +36,9 @@
<language name="vbscript" engine="org.apache.bsf.engines.activescript.ActiveScriptEngine" />
</languages>
<startupscripts />
<preferredrecentcommandsdividerlocations />
<preferredrecentcommandsdividerlocations>
<dividerlocationd language="beanshell" position="1352" />
</preferredrecentcommandsdividerlocations>
<BSFConsoleSearchOptions searchfromcursor="false">
<recentsearches />
</BSFConsoleSearchOptions>
@ -241,16 +243,6 @@
</modules>
</component>
<component name="ProjectRootManager" version="2" assert-keyword="false" jdk-15="false" project-jdk-name="1.4.x" />
<component name="Regex">
<option name="pos1" value="218" />
<option name="pos2" value="218" />
<option name="pos3" value="162" />
<option name="pos4" value="444" />
<option name="pos5" value="162" />
<option name="autoUpdate" value="true" />
<option name="referenceOn" value="false" />
<option name="referencePos" value="0" />
</component>
<component name="RmicSettings">
<option name="IS_EANABLED" value="false" />
<option name="DEBUGGING_INFO" value="true" />

View file

@ -112,38 +112,75 @@
<option name="HIDE_WARNINGS" value="false" />
</component>
<component name="FileEditorManager" split-orientation="vertical" split-proportion="0.5">
<first-group selected-file="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme/Util.java">
<first-group selected-file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/GooglME.java">
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/GooglME.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="61" column="13" selection-start="2377" selection-end="2377" vertical-scroll-proportion="0.33333334">
<state line="709" column="60" selection-start="16068" selection-end="16068" vertical-scroll-proportion="0.21482277">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HelpScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="42" column="76" selection-start="1782" selection-end="1782" vertical-scroll-proportion="0.10321489">
<state line="57" column="11" selection-start="2129" selection-end="2129" vertical-scroll-proportion="0.389738">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/MainScreen.java" pinned="false">
<entry file="file://$PROJECT_DIR$/GooglME.jad" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="52" column="13" selection-start="2077" selection-end="2077" vertical-scroll-proportion="0.33333334">
<state line="4" column="25" selection-start="165" selection-end="165" vertical-scroll-proportion="0.07303974">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme/Util.java" pinned="false">
<entry file="file://$PROJECT_DIR$/GooglME-2.jad" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="53" column="13" selection-start="2067" selection-end="2067" vertical-scroll-proportion="0.33333334">
<state line="4" column="25" selection-start="167" selection-end="167" vertical-scroll-proportion="0.07303974">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme/Util.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.6419142">
<state line="62" column="8" selection-start="2264" selection-end="2264" vertical-scroll-proportion="0.24489796">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/MainScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="68" column="11" selection-start="2368" selection-end="2368" vertical-scroll-proportion="0.5370569">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/PrefsScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="51" column="13" selection-start="2004" selection-end="2004" vertical-scroll-proportion="0.2556391">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/RmsIndex.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="30" column="13" selection-start="1360" selection-end="1360" vertical-scroll-proportion="0.18259935">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HistoryScreen.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="13" selection-start="1921" selection-end="1921" vertical-scroll-proportion="0.2556391">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme/Util.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="75" column="57" selection-start="2460" selection-end="2460" vertical-scroll-proportion="0.48872182">
<folding />
</state>
</provider>
@ -159,30 +196,35 @@
<component name="InspectionManager">
<option name="AUTOSCROLL_TO_SOURCE" value="false" />
<option name="SPLITTER_PROPORTION" value="0.5" />
<profile name="Default" />
<profile name="Erik's Inspections" />
</component>
<component name="J2EEProjectPane" />
<component name="NamedScopeManager" />
<component name="PackagesPane">
<expanded_node url="net.thauvin.j2me.googlme" module="GooglME-2" type="package" />
<expanded_node url="net.thauvin" module="GooglME-2" type="package" />
<expanded_node url="net.thauvin.j2me" module="GooglME-2" type="package" />
<expanded_node url="net" module="GooglME-2" type="package" />
<expanded_node url="net.thauvin.j2me.googlme" module="GooglME-2" type="package" />
<expanded_node url="net.thauvin.j2me" module="GooglME-2" type="package" />
<expanded_node url="" module="GooglME-2" type="module" />
<expanded_node url="net.thauvin" module="GooglME-2" type="package" />
</component>
<component name="ProjectPane">
<expanded_node url="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2/net" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1/net/thauvin" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net" module="GooglME-2" type="directory" />
<expanded_node url="" module="GooglME-2" type="module" />
<expanded_node url="file://$PROJECT_DIR$/midp-1/net" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net/thauvin/j2me" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/net/thauvin" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1/net/thauvin" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2/net/thauvin" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-2/net" module="GooglME-2" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/midp-1" module="GooglME-2" type="directory" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" splitterProportion="0.5">
@ -204,14 +246,27 @@
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
</component>
<component name="Regex">
<option name="pos1" value="218" />
<option name="pos2" value="218" />
<option name="pos3" value="162" />
<option name="pos4" value="444" />
<option name="pos5" value="162" />
<option name="autoUpdate" value="true" />
<option name="referenceOn" value="false" />
<option name="referencePos" value="0" />
</component>
<component name="RunManager">
<activeType name="Application" />
<configuration selected="false" default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<configuration selected="false" default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="C:/IntelliJ-IDEA/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
<configuration selected="false" default="true" type="JUnit" factoryName="JUnit">
<module name="" />
@ -227,6 +282,20 @@
<value defaultName="wholeProject" />
</option>
</configuration>
<configuration selected="false" default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration selected="false" default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<module name="" />
</configuration>
<configuration selected="false" default="true" type="WebLogic Instance" factoryName="Local">
<option name="WORKING_DIRECTORY" />
<option name="HOST" value="localhost" />
@ -241,23 +310,6 @@
<option name="SERVER_NAME" value="myserver" />
<option name="DOMAIN_NAME" value="mydomain" />
</configuration>
<configuration selected="false" default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration selected="false" default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="C:/IntelliJ-IDEA/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
</component>
<component name="SelectInManager" />
<component name="StarteamConfiguration">
@ -305,26 +357,28 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-4" y="-4" width="1032" height="776" extended-state="6" />
<editor active="false" />
<frame x="58" y="5" width="1445" height="1124" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Properties File Structure" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="4" />
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33032128" order="8" />
<window_info id="Regex" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="7" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.2387755" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="1" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.18090452" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33032128" order="1" />
<window_info id="Jalopy" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.39969134" order="6" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.3995984" order="6" />
<window_info id="Profile" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="2" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="3" />
<window_info id="CVS File View" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="0" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="4" />
<window_info id="BSFConsole" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="1" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="4" />
<window_info id="BSFConsole" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33032128" order="8" />
<window_info id="Properties File Structure" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="4" />
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="0" />
<window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="3" />
@ -399,37 +453,88 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme/Util.java">
<entry file="file://$PROJECT_DIR$/googlme.wml">
<provider selected="true" editor-type-id="text-editor">
<state line="53" column="13" selection-start="2067" selection-end="2067" vertical-scroll-proportion="0.33333334">
<state line="12" column="46" selection-start="328" selection-end="328" vertical-scroll-proportion="0.21911922">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme/Util.java">
<entry file="file://$PROJECT_DIR$/build.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.6419142">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HelpScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="42" column="76" selection-start="1782" selection-end="1782" vertical-scroll-proportion="0.10321489">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/GooglME.java">
<provider selected="true" editor-type-id="text-editor">
<state line="61" column="13" selection-start="2377" selection-end="2377" vertical-scroll-proportion="0.33333334">
<state line="709" column="60" selection-start="16068" selection-end="16068" vertical-scroll-proportion="0.21482277">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HelpScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="57" column="11" selection-start="2129" selection-end="2129" vertical-scroll-proportion="0.389738">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/GooglME.jad">
<provider selected="true" editor-type-id="text-editor">
<state line="4" column="25" selection-start="165" selection-end="165" vertical-scroll-proportion="0.07303974">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/GooglME-2.jad">
<provider selected="true" editor-type-id="text-editor">
<state line="4" column="25" selection-start="167" selection-end="167" vertical-scroll-proportion="0.07303974">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-1/net/thauvin/j2me/googlme/Util.java">
<provider selected="true" editor-type-id="text-editor">
<state line="62" column="8" selection-start="2264" selection-end="2264" vertical-scroll-proportion="0.24489796">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/MainScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="52" column="13" selection-start="2077" selection-end="2077" vertical-scroll-proportion="0.33333334">
<state line="68" column="11" selection-start="2368" selection-end="2368" vertical-scroll-proportion="0.5370569">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/PrefsScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="51" column="13" selection-start="2004" selection-end="2004" vertical-scroll-proportion="0.2556391">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/RmsIndex.java">
<provider selected="true" editor-type-id="text-editor">
<state line="30" column="13" selection-start="1360" selection-end="1360" vertical-scroll-proportion="0.18259935">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/thauvin/j2me/googlme/HistoryScreen.java">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="13" selection-start="1921" selection-end="1921" vertical-scroll-proportion="0.2556391">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/midp-2/net/thauvin/j2me/googlme/Util.java">
<provider selected="true" editor-type-id="text-editor">
<state line="75" column="57" selection-start="2460" selection-end="2460" vertical-scroll-proportion="0.48872182">
<folding />
</state>
</provider>

View file

@ -1,10 +1,10 @@
MIDlet-1: GooglME,/googlme.png,net.thauvin.j2me.googlme.GooglME
MIDlet-Jar-URL: GooglME-2.jar
MIDlet-Icon: /googlme.png
MIDlet-Version: 0.1.0
MIDlet-Description: GoogleME
MIDlet-Version: 0.3.0
MIDlet-Description: GooglME
MIDlet-Name: GooglME
MIDlet-Vendor: Erik C. Thauvin
MIDlet-Info-URL: http://www.thauvin.net/erik/j2me/
MIDlet-Info-URL: http://mobile.thauvin.net/j2me/
MicroEdition-Profile: MIDP-2.0
MIDlet-Permissions: javax.microedition.io.Connector.sms,javax.wireless.messaging.sms.send

View file

@ -1,8 +1,8 @@
MIDlet-1: GooglME,/googlme.png,net.thauvin.j2me.googlme.GooglME
MIDlet-Jar-URL: GooglME.jar
MIDlet-Icon: /googlme.png
MIDlet-Version: 0.1.0
MIDlet-Description: GoogleME
MIDlet-Version: 0.3.0
MIDlet-Description: GooglME
MIDlet-Name: GooglME
MIDlet-Vendor: Erik C. Thauvin
MIDlet-Info-URL: http://www.thauvin.net/erik/j2me/
MIDlet-Info-URL: http://mobile.thauvin.net/j2me/

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project name="GooglME" default="build" basedir=".">
<taskdef resource="antenna.properties"/>
@ -53,7 +53,7 @@
</target>
<target name="jar" depends="compile" description="Builds the MIDP 1.x jar">
<property name=" wtk.midp.version" value="1.0"/>
<property name="wtk.midp.version" value="1.0"/>
<copy todir="${path.deploy}" file="${ant.project.name}.jad"/>
<wtkpackage jarfile="${path.deploy}/${ant.project.name}.jar"
jadfile="${path.deploy}/${ant.project.name}.jad"

View file

@ -8,17 +8,17 @@
</template>
<card id="card1" title="GooglME" newcontext="true">
<p align="center">
GoogleME 0.1 (7Kb)<br/>
GoogleME 0.3 (13Kb)<br/>
</p>
<p align="center">
MIDP 2.0<br/>
<a href="GoogleME-2.jad">Download Jad</a><br/>
<a href="GoogleME-2.jar">Download Jar</a><br/>
<a href="GooglME-2.jad">Download Jad</a><br/>
<a href="GooglME-2.jar">Download Jar</a><br/>
</p>
<p align="center">
MIDP 1.0<br/>
<a href="GoogleME.jad">Download Jad</a><br/>
<a href="GoogleME.jar">Download Jar</a><br/>
<a href="GooglME.jad">Download Jad</a><br/>
<a href="GooglME.jar">Download Jar</a><br/>
</p>
</card>
</wml>

View file

@ -0,0 +1,20 @@
/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/

View file

@ -1,7 +1,7 @@
/*
* @(#)Util.java
*
* Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/)
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -46,19 +46,28 @@ import javax.microedition.lcdui.TextField;
/**
* The <code>Util</code> class implements methods specific to MIDP 1.x.
*
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @version $Revision$, $Date$
*
* @created October 8, 2004
* @since 1.0
* @since 1.0
*/
public class Util
{
/**
* Disables the default constructor.
*
* @throws UnsupportedOperationException if the constructor is called.
*/
private Util()
{
;
}
/**
* Returns a new exclusive choice group.
*
* @param title The title.
* @param choices The choices.
* @param title The title.
* @param choices The choices.
*
* @return The choice group.
*/
@ -71,7 +80,7 @@ public class Util
* Sets the current item.
*
* @param screen The screen.
* @param item The item.
* @param item The item.
*/
public static void setCurrentItem(Display screen, Item item)
{
@ -81,7 +90,7 @@ public class Util
/**
* Sets the initial input mode of the given text field.
*
* @param field The text field.
* @param field The text field.
* @param inputMode The input mode.
*/
public static void setInitialInputMode(TextField field, String inputMode)

View file

@ -1,7 +1,7 @@
/*
* @(#)Util.java
*
* Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/)
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -45,19 +45,26 @@ import javax.microedition.lcdui.TextField;
/**
* The <code>Util</code> class implements methods specific to MIDP 2.x.
*
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @version $Revision$, $Date$
*
* @created October 8, 2004
* @since 1.0
* @since 1.0
*/
public class Util
{
/**
* Disables the default constructor.
*/
private Util()
{
;
}
/**
* Returns a new exclusive choice group.
*
* @param title The title.
* @param choices The choices.
* @param title The title.
* @param choices The choices.
*
* @return The choice group.
*/
@ -68,8 +75,9 @@ public class Util
/**
* Sets the current item.
*
* @param screen The screen.
* @param item The item.
* @param item The item.
*/
public static void setCurrentItem(Display screen, Item item)
{
@ -79,7 +87,7 @@ public class Util
/**
* Sets the initial input mode of the given text field.
*
* @param field The text field.
* @param field The text field.
* @param inputMode The input mode.
*/
public static void setInitialInputMode(TextField field, String inputMode)

1
res/.cvsignore Normal file
View file

@ -0,0 +1 @@
*.db

View file

@ -1,7 +1,7 @@
/*
* @(#)GooglME.java
*
* Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/)
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -36,83 +36,210 @@
*/
package net.thauvin.j2me.googlme;
import javax.microedition.io.*;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Item;
import java.util.Vector;
import javax.microedition.io.Connector;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.rms.RecordStoreException;
import javax.wireless.messaging.*;
import javax.wireless.messaging.MessageConnection;
import javax.wireless.messaging.TextMessage;
/**
* The <code>GooglME</code> class implements a simple front-end for Google SMS.
*
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @version $Revision$, $Date$
*
* @created October 8, 2004
* @since 1.0
* @since 1.0
*/
public class GooglME extends MIDlet implements CommandListener, Runnable
{
/**
* Definition choice.
*/
protected static final String CHOICE_DEFINITION = "Definition";
/**
* Froogle Prices choice.
*/
protected static final String CHOICE_FROOGLE_PRICES = "Froogle Prices";
/**
* Google Local choice.
*/
protected static final String CHOICE_GOOGLE_LOCAL = "Google Local";
/**
* Google Search choice.
*/
protected static final String CHOICE_GOOGLE_SEARCH = "Google Search";
/**
* Google SMS choice.
*/
protected static final String CHOICE_GOOGLE_SMS = "Google SMS";
/**
* Local Showtimes choice.
*/
protected static final String CHOICE_LOCAL_SHOWTIMES = "Local Showtimes";
/**
* Movie Showtimes choice.
*/
protected static final String CHOICE_MOVIE_SHOWTIMES = "Movie Showtimes";
/**
* The <code>About</code> command.
*/
protected /* final */ Command aboutCommand = new Command("About", Command.SCREEN, 5);
/**
* The <code>Back</code> command.
*/
protected /* final */ Command backCommand = new Command("Back", Command.BACK, 2);
/**
* The <code>Clear</code> command.
*/
protected /* final */ Command clearCommand = new Command("Clear", Command.SCREEN, 3);
/**
* The <code>Exit</code> command.
*/
protected /* final */ Command exitCommand = new Command("Exit", Command.EXIT, 2);
/**
* The <code>Help</code> command.
*/
protected /* final */ Command helpCommand = new Command("Help", Command.HELP, 4);
/**
* The <code>Send</code> command.
*/
protected /* final */ Command sendCommand = new Command("Send", Command.SCREEN, 2);
protected static final Command COMMAND_ABOUT = new Command("About", Command.SCREEN, 2);
/**
* The application name.
*/
protected /* final */ String appName = "GooglME";
protected static final String APP_NAME = "GooglME";
/**
* The application version.
*/
protected /* final */ String appVersion = "0.1";
private Display display;
protected static final String APP_VERSION = "0.3";
/**
* The help screen.
* The <code>Back</code> command.
*/
private /* final */ HelpScreen helpScreen;
protected static final Command COMMAND_BACK = new Command("Back", Command.BACK, 2);
/**
* The main screen.
* The action choices.
*/
private /* final */ MainScreen mainScreen;
private String query;
private int action;
protected static final String[] CHOICES = new String[]
{
CHOICE_GOOGLE_SMS, CHOICE_GOOGLE_LOCAL, CHOICE_FROOGLE_PRICES,
CHOICE_GOOGLE_SEARCH, CHOICE_MOVIE_SHOWTIMES, CHOICE_LOCAL_SHOWTIMES,
CHOICE_DEFINITION
};
/**
* The <code>Clear</code> command.
*/
protected static final Command COMMAND_CLEAR = new Command("Clear", Command.SCREEN, 2);
/**
* The <code>Exit</code> command.
*/
protected static final Command COMMAND_EXIT = new Command("Exit", Command.EXIT, 2);
/**
* The <code>Help</code> command.
*/
protected static final Command COMMAND_HELP = new Command("Help", Command.HELP, 2);
/**
* The <code>History</code> command.
*/
protected static final Command COMMAND_HISTORY = new Command("History", Command.SCREEN, 2);
/**
* The <code>Settings</code> command.
*/
protected static final Command COMMAND_SETTINGS = new Command("Settings", Command.SCREEN, 2);
/**
* The <code>Save</code> command.
*/
protected static final Command COMMAND_SAVE = new Command("Save", Command.OK, 1);
/**
* The <code>Send</code> command.
*/
protected static final Command COMMAND_SEND = new Command("Send", Command.OK, 1);
/**
* The history maximum size.
*/
private static final int MAX_HISTORY = 8;
/**
* The description query prefix.
*/
private static final String PREFIX_DEFINITION = "d ";
/**
* The Google query prefix.
*/
private static final String PREFIX_GOOGLE = "g ";
/**
* The Froogle query prefix.
*/
private static final String PREFIX_FROOGLE = "f ";
/**
* The Movie query prefix.
*/
private static final String PREFIX_MOVIE = "movie: ";
/**
* The history preferences key.
*/
private static final String PREFS_HISTORY_KEY = "h";
/**
* The location preferences key.
*/
private static final String PREFS_LOCATION_KEY = "l";
/**
* The address preferences key.
*/
private static final String PREFS_ADDRESS_KEY = "a";
// The current action.
private String _action = CHOICE_GOOGLE_SMS;
// The Google SMS address.
private String _address = "46645";
// The default error/message alert dialog.
private Alert _defaultAlert;
// The display instance.
private Display _display;
// The first time flag.
private boolean _firstTime;
// The help screen.
private HelpScreen _helpScreen;
// The history.
private /* final */ Vector _history = new Vector(8);
// The history screen.
private HistoryScreen _historyScreen;
// The location.
private String _location = "";
// The main screen.
private /* final */ MainScreen _mainScreen;
// The preferences store.
private RmsIndex _prefs;
// The preferences screen.
private PrefsScreen _prefsScreen;
// The current query.
private String _query = "";
// The sending message alert dialog.
private Alert _sendingAlert;
/**
* Creates a new GooglME instance.
@ -121,7 +248,8 @@ public class GooglME extends MIDlet implements CommandListener, Runnable
{
super();
mainScreen = new MainScreen(this);
_mainScreen = new MainScreen(this);
_firstTime = true;
}
/**
@ -130,56 +258,187 @@ public class GooglME extends MIDlet implements CommandListener, Runnable
* @param c The command action.
* @param d The diplayable screen.
*/
public void commandAction(Command c, Displayable d)
public /* final */ void commandAction(Command c, Displayable d)
{
if (c == exitCommand)
if (c == COMMAND_EXIT)
{
exit();
}
else if (c == aboutCommand)
else if (c == COMMAND_ABOUT)
{
msg("About " + appName, appName + ' ' + appVersion + "\nCopyright 2004\nErik C. Thauvin\nerik@thauvin.net",
d, false);
alert("About " + APP_NAME,
APP_NAME + ' ' + APP_VERSION + "\nCopyright 2005\nErik C. Thauvin\nerik@thauvin.net", d, false);
}
else if (c == clearCommand)
else if (c == COMMAND_CLEAR)
{
mainScreen.queryFld.setString("");
Util.setCurrentItem(display, (Item) mainScreen.queryFld);
_mainScreen.queryFld.setString("");
Util.setCurrentItem(_display, (Item) _mainScreen.queryFld);
}
else if (c == sendCommand)
else if (c == COMMAND_SEND)
{
query = mainScreen.queryFld.getString();
action = mainScreen.actionPopup.getSelectedIndex();
if ((query != null) && (query.length() > 0))
if (isValidString(_address))
{
new Thread(this).start();
_query = _mainScreen.queryFld.getString();
_action = CHOICES[_mainScreen.actionPopup.getSelectedIndex()];
if (isValidString(_query))
{
if (((_action.equals(CHOICE_GOOGLE_LOCAL)) || (_action.equals(CHOICE_LOCAL_SHOWTIMES))) &&
!isValidString(_location))
{
alert("No Location", "Please set a location first.", d, true);
}
else
{
if (_sendingAlert == null)
{
_sendingAlert = new Alert("");
}
alert(_sendingAlert, "Sending SMS", "Sending message to " + _address + "...", d, 2500, false);
new Thread(this).start();
}
}
else
{
Util.setCurrentItem(_display, (Item) _mainScreen.queryFld);
alert("Invalid Input", "Please specify a query.", d, true);
}
}
else
{
msg("Invalid Input", "Please specify a query.", d, true);
Util.setCurrentItem(display, (Item) mainScreen.queryFld);
alert("No SMS Address", "Please set the Google SMS number.", d, true);
}
}
else if (c == helpCommand)
else if (c == COMMAND_SETTINGS)
{
if (helpScreen == null)
if (_prefsScreen == null)
{
helpScreen = new HelpScreen(this);
_prefsScreen = new PrefsScreen(this);
}
display.setCurrent(helpScreen);
_prefsScreen.smsFld.setString(_address);
_prefsScreen.locationFld.setString(_location);
_display.setCurrent(_prefsScreen);
}
else if (c == backCommand)
else if (c == COMMAND_SAVE)
{
display.setCurrent(mainScreen);
_location = _prefsScreen.locationFld.getString();
_address = _prefsScreen.smsFld.getString();
_display.setCurrent(_mainScreen);
saveSettings();
}
else if (c == COMMAND_HISTORY)
{
if (_historyScreen == null)
{
_historyScreen = new HistoryScreen(this);
}
int size = _historyScreen.size();
if (size > 0)
{
for (int i = 0; i < size; i++)
{
_historyScreen.delete(0);
}
}
size = _history.size();
if (size > 0)
{
for (int i = 0; i < size; i++)
{
_historyScreen.append((String) _history.elementAt(i), null);
}
_display.setCurrent(_historyScreen);
}
else
{
alert("No History", "There is no history to display.", d, true);
}
}
else if (c == List.SELECT_COMMAND)
{
/* final */ String query = _historyScreen.getString(_historyScreen.getSelectedIndex());
// Definition
if (query.startsWith(PREFIX_DEFINITION))
{
_mainScreen.queryFld.setString(query.substring(query.indexOf(' ') + 1));
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_DEFINITION), true);
}
// Google
else if (query.startsWith(PREFIX_GOOGLE))
{
_mainScreen.queryFld.setString(query.substring(query.indexOf(' ') + 1));
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_GOOGLE_SEARCH), true);
}
// Froogle
else if (query.startsWith(PREFIX_FROOGLE))
{
_mainScreen.queryFld.setString(query.substring(query.indexOf(' ') + 1));
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_FROOGLE_PRICES), true);
}
// Showtimes
else if (query.startsWith(PREFIX_MOVIE))
{
// Local
if (isValidString(_location) && query.endsWith(' ' + _location))
{
_mainScreen.queryFld.setString(query.substring(PREFIX_MOVIE.length(), query.lastIndexOf(' ')));
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_LOCAL_SHOWTIMES), true);
}
else
{
_mainScreen.queryFld.setString(query.substring(PREFIX_MOVIE.length()));
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_MOVIE_SHOWTIMES), true);
}
}
// Local
else if (isValidString(_location) && query.endsWith('.' + _location))
{
_mainScreen.queryFld.setString(query.substring(0, query.lastIndexOf('.')));
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_GOOGLE_LOCAL), true);
}
else
{
_mainScreen.queryFld.setString(query);
_mainScreen.actionPopup.setSelectedIndex(choiceIndex(CHOICE_GOOGLE_SMS), true);
}
_display.setCurrent(_mainScreen);
}
else if (c == COMMAND_HELP)
{
if (_helpScreen == null)
{
_helpScreen = new HelpScreen(this);
}
_display.setCurrent(_helpScreen);
}
else if (c == COMMAND_BACK)
{
_display.setCurrent(_mainScreen);
}
}
/**
* Executes the thread.
*/
public void run()
public /* final */ void run()
{
sendSMS();
}
@ -190,13 +449,25 @@ public class GooglME extends MIDlet implements CommandListener, Runnable
protected void destroyApp(boolean b)
throws MIDletStateChangeException
{
try
{
if (_prefs != null)
{
_prefs.close();
}
}
catch (RecordStoreException e)
{
alert("Close Error", "Could not close the preferences store: " + e.getMessage(), _mainScreen, true);
}
notifyDestroyed();
}
/**
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp()
protected /* final */ void pauseApp()
{
;
}
@ -204,11 +475,118 @@ public class GooglME extends MIDlet implements CommandListener, Runnable
/**
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp()
throws MIDletStateChangeException
protected /* final */ void startApp()
throws MIDletStateChangeException
{
display = Display.getDisplay(this);
display.setCurrent(mainScreen);
if (_firstTime)
{
try
{
_prefs = new RmsIndex("GooglME");
String item;
// Load the history.
for (int i = 0; i < MAX_HISTORY; i++)
{
item = _prefs.get(PREFS_HISTORY_KEY + i);
if (item != null)
{
_history.addElement(item);
}
else
{
break;
}
}
// Load the location.
item = _prefs.get(PREFS_LOCATION_KEY);
if (item != null)
{
_location = item;
}
// Load the address.
item = _prefs.get(PREFS_ADDRESS_KEY);
if (item != null)
{
_address = item;
}
}
catch (RecordStoreException e)
{
alert("Load Error", "Could not load the preferences: " + e.getMessage(), _mainScreen, true);
}
_firstTime = false;
}
_display = Display.getDisplay(this);
_display.setCurrent(_mainScreen);
}
// Return the index of the given choice.
private static int choiceIndex(String choice)
{
for (int i = 0; i < CHOICES.length; i++)
{
if (CHOICES[i].equals(choice))
{
return i;
}
}
return 0;
}
// Validates a string.
private static boolean isValidString(String s)
{
return ((s != null) && (s.length() > 0));
}
// Adds to the history.
private void addHistory(String query)
{
if (_history.size() == MAX_HISTORY)
{
_history.removeElementAt(MAX_HISTORY - 1);
}
_history.insertElementAt(query, 0);
saveHistory();
}
// Displays a modal message/error alert dialog.
private void alert(String title, String msg, Displayable d, boolean isError)
{
if (_defaultAlert == null)
{
_defaultAlert = new Alert("");
}
alert(_defaultAlert, title, msg, d, Alert.FOREVER, isError);
}
// Displays a message/error alert dialog.
private void alert(Alert alert, String title, String msg, Displayable d, int timeout, boolean isError)
{
if (title != null)
{
alert.setTitle(title);
}
alert.setString(msg);
alert.setType(isError ? AlertType.ERROR : AlertType.INFO);
alert.setTimeout(timeout);
_display.setCurrent(alert, d);
}
// Exits the application.
@ -218,30 +596,58 @@ public class GooglME extends MIDlet implements CommandListener, Runnable
{
destroyApp(false);
}
catch (MIDletStateChangeException e)
catch (MIDletStateChangeException ignore)
{
; // Do nothing
; // Do nothing
}
}
// Displays a message/error dialog.
private void msg(String title, String msg, Displayable d, boolean isError)
// Saves the history.
private void saveHistory()
{
/* final */ Alert alert = new Alert(title, msg, null, AlertType.INFO);
if (isError)
try
{
alert.setType(AlertType.ERROR);
}
if (_prefs != null)
{
/* final */ int size = _history.size();
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert, d);
// Save the history.
for (int i = 0; i < size; i++)
{
_prefs.put(PREFS_HISTORY_KEY + i, (String) _history.elementAt(i));
}
}
}
catch (RecordStoreException e)
{
alert("Save Error", "Could not save the history: " + e.getMessage(), _mainScreen, true);
}
}
// Saves the settings.
private void saveSettings()
{
try
{
if (_prefs != null)
{
// Save the location.
_prefs.put(PREFS_LOCATION_KEY, _location);
// Save the address.
_prefs.put(PREFS_ADDRESS_KEY, _address);
}
}
catch (RecordStoreException e)
{
alert("Save Error", "Could not save the settings: " + e.getMessage(), _mainScreen, true);
}
}
// Sends the SMS.
private void sendSMS()
{
/* final */ String address = "sms://46645";
/* final */ String address = "sms://" + _address;
MessageConnection conn = null;
try
@ -251,35 +657,76 @@ public class GooglME extends MIDlet implements CommandListener, Runnable
/* final */ TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setAddress(address);
// Froogle
if (action == 1)
/* final */ String text;
if (_action.equals(CHOICE_GOOGLE_LOCAL))
{
msg.setPayloadText("f " + query);
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 == 2)
else if (_action.equals(CHOICE_GOOGLE_SEARCH))
{
msg.setPayloadText("g " + query);
text = PREFIX_GOOGLE + _query;
}
// Definition
else if (action == 3)
else if (_action.equals(CHOICE_DEFINITION))
{
msg.setPayloadText("d " + query);
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;
}
}
// Default
else
{
msg.setPayloadText(query);
text = _query;
}
msg.setPayloadText(text);
conn.send(msg);
addHistory(text);
msg("SMS Sent", "The text message was sent.", mainScreen, false);
//alert("SMS Sent", "The text message was sent.", _mainScreen, false);
}
catch (SecurityException e)
{
alert("SMS Error", "Access to SMS was refused: " + e.getMessage(), _mainScreen, true);
}
catch (Exception e)
{
msg("SMS Error", "The text message could not be sent: " + e.getMessage(), mainScreen, true);
alert("SMS Error", "The text message could not be sent: " + e.getMessage(), _mainScreen, true);
}
finally
{

View file

@ -1,7 +1,7 @@
/*
* @(#)HelpScreen.java
*
* Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/)
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -37,16 +37,16 @@
package net.thauvin.j2me.googlme;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
/**
* The <code>HelpScreen</code> class implements a form used to display some help.
*
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @version $Revision$, $Date$
*
* @created October 8, 2004
* @since 1.0
* @since 1.0
*/
public class HelpScreen extends Form
{
@ -57,12 +57,22 @@ public class HelpScreen extends Form
*/
public HelpScreen(GooglME midlet)
{
super(midlet.appName + " Help");
super(GooglME.APP_NAME + " Help");
append("Google SMS: To get business listings, enter business name and city, state or zip. If you want to make sure you get Google Local results, put a period between the business name and the location. To get phone numbers, enter name of person and city, state or zip.\n\nFroogle Prices: For product prices, enter the product name.\n\nGoogle Search: For Google search snippets, enter the search terms.\n\nDefinition: For definitions, enter the word or term.");
append(new StringItem(GooglME.CHOICE_GOOGLE_SMS + ": ",
"To get business listings, enter business name and city, state or zip. To get phone numbers, enter name of person and city, state or zip.\n\n"));
append(new StringItem(GooglME.CHOICE_GOOGLE_LOCAL + ": ",
"To get local business listings, enter business name. To get local phone numbers, enter name of person. The permanent location setting is automatically added to your query.\n\n"));
append(new StringItem(GooglME.CHOICE_FROOGLE_PRICES + ": ", "For product prices, enter the product name.\n\n"));
append(new StringItem(GooglME.CHOICE_GOOGLE_SEARCH + ": ",
"For Google search snippets, enter the search terms.\n\n"));
append(new StringItem(GooglME.CHOICE_MOVIE_SHOWTIMES + ": ",
"To get movie showtimes, enter the movie's title followed by your location (a zip code or city and state). For a listing of theaters, enter 'theaters' followed by your location. For a listing of movies playing, enter 'movies' followed by your location.\n\n"));
append(new StringItem(GooglME.CHOICE_LOCAL_SHOWTIMES + ": ",
"To get local movie showtimes, enter the movie's title. For a listing of theaters near you, enter 'theaters'. For a listing of movies playing near you, enter 'movies'. The permanent location setting is automatically added to your query.\n\n"));
append(new StringItem(GooglME.CHOICE_DEFINITION + ": ", "For definitions, enter the word or term.\n\n"));
addCommand(midlet.exitCommand);
addCommand(midlet.backCommand);
addCommand(GooglME.COMMAND_BACK);
setCommandListener(midlet);
}

View file

@ -0,0 +1,65 @@
/*
* @(#)HistoryScreen.java
*
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the authors nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
package net.thauvin.j2me.googlme;
import javax.microedition.lcdui.List;
/**
* The <code>HistoryScreen</code> class implements a form used to display the history.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
* @created Oct 12, 2004
* @since 1.0
*/
public class HistoryScreen extends List
{
/**
* Creates a new HistoryScreen object.
*
* @param midlet The MIDlet instance.
*/
public HistoryScreen(GooglME midlet)
{
super(GooglME.APP_NAME + " History", List.IMPLICIT);
addCommand(GooglME.COMMAND_BACK);
setCommandListener(midlet);
}
}

View file

@ -1,7 +1,7 @@
/*
* @(#)MainScreen.java
*
* Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/)
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -44,11 +44,10 @@ import javax.microedition.lcdui.TextField;
/**
* The <code>MainScreen</code> class implements a form used to gather the data needed to perform a Google SMS query.
*
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @author <a href="http://www.thauvin.net/erik/">Erik C. Thauvin</a>
* @version $Revision$, $Date$
*
* @created October 8, 2004
* @since 1.0
* @since 1.0
*/
public class MainScreen extends Form
{
@ -69,21 +68,22 @@ public class MainScreen extends Form
*/
public MainScreen(GooglME midlet)
{
super(midlet.appName);
super(GooglME.APP_NAME);
queryFld = new TextField("Query: ", "", 25, TextField.ANY);
Util.setInitialInputMode(queryFld, "MIDP_LOWERCASE_LATIN");
actionPopup =
Util.getChoiceGroup("Type: ", new String[] { "Google SMS", "Froogle Prices", "Google Search", "Definition" });
actionPopup = Util.getChoiceGroup("Type: ", GooglME.CHOICES);
actionPopup.setSelectedIndex(0, true);
append(queryFld);
append(actionPopup);
addCommand(midlet.helpCommand);
addCommand(midlet.aboutCommand);
addCommand(midlet.clearCommand);
addCommand(midlet.exitCommand);
addCommand(midlet.sendCommand);
addCommand(GooglME.COMMAND_SEND);
addCommand(GooglME.COMMAND_CLEAR);
addCommand(GooglME.COMMAND_HISTORY);
addCommand(GooglME.COMMAND_SETTINGS);
addCommand(GooglME.COMMAND_HELP);
addCommand(GooglME.COMMAND_ABOUT);
addCommand(GooglME.COMMAND_EXIT);
setCommandListener(midlet);
}

View file

@ -0,0 +1,88 @@
/*
* @(#)PrefsScreen.java
*
* Copyright (c) 2004-2005, Erik C. Thauvin (http://www.thauvin.net/erik/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the authors nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
package net.thauvin.j2me.googlme;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
/**
* The <code>PrefsScreen</code> class implements a form used to set the preferences.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
* @created Oct 12, 2004
* @since 1.0
*/
public class PrefsScreen extends Form
{
/**
* The query field.
*/
protected /* final */ TextField locationFld;
/**
* The SMS number field.
*/
protected /* final */ TextField smsFld;
/**
* Creates a new PrefsScreen object.
*
* @param midlet The MIDlet instance.
*/
public PrefsScreen(GooglME midlet)
{
super(GooglME.APP_NAME + " Settings");
locationFld = new TextField("Location: ", "", 25, TextField.ANY);
append(locationFld);
append(new StringItem("", "Your current city and state or zip. (e.g.: san francisco ca or 94123)"));
smsFld = new TextField("Google SMS: ", "", 25, TextField.PHONENUMBER);
append(smsFld);
append(new StringItem("", "The short code or number of the Google SMS service. (e.g.: 46645)"));
addCommand(GooglME.COMMAND_BACK);
addCommand(GooglME.COMMAND_SAVE);
setCommandListener(midlet);
}
}

View file

@ -0,0 +1,269 @@
/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
package net.thauvin.j2me.googlme;
import javax.microedition.rms.*;
import java.io.*;
/**
* An Rms based BTree index. Currently, the functionality is similar to a
* persistent hashtable.
*/
public class RmsIndex {
static byte[] DUMMY = new byte[0];
RecordStore store;
Node root;
int n = 32;
String cachedKey;
Node cachedNode;
int cachedIndex;
/** Node helper class */
class Node {
int index;
int size;
String[] keys = new String[n + n + 1];
String[] values = new String[n + n + 1];
int[] children = new int[n + n + 2];
/** Create a new Node */
Node() throws RecordStoreException {
index = store.addRecord(DUMMY, 0, 0);
}
Node(Node split) throws RecordStoreException {
this();
System.arraycopy(split.keys, n + 1, keys, 0, n);
System.arraycopy(split.values, n + 1, values, 0, n);
System.arraycopy(split.children, n + 1, children, 0, n + 1);
size = n;
split.size = n;
split.store();
store();
}
/** Load the node at the given index position */
Node(int index) throws RecordStoreException {
this.index = index;
byte[] data = store.getRecord(index);
if (data == null || data.length == 0)
return;
try {
DataInputStream dis = new DataInputStream(
new ByteArrayInputStream(data));
size = dis.readInt();
for (int i = 0; i < size; i++) {
children[i] = dis.readInt();
keys[i] = dis.readUTF();
values[i] = dis.readUTF();
}
children[size] = dis.readInt();
} catch (IOException e) {
throw new RuntimeException(e.toString());
}
}
public void put(String key, String value) throws RecordStoreException {
int i;
for (i = 0; i < size; i++) {
int cmp = key.compareTo(keys[i]);
if (cmp == 0) {
values[i] = value;
store();
return;
} else if (cmp < 0)
break;
}
int newIndex = 0;
if (children[i] != 0) {
Node child = new Node(children[i]);
child.put(key, value);
if (child.size < n + n + 1)
return;
Node split = new Node(child);
newIndex = split.index;
key = child.keys[n];
value = child.values[n];
}
System.arraycopy(keys, i, keys, i + 1, size - i);
System.arraycopy(values, i, values, i + 1, size - i);
System.arraycopy(children, i + 1, children, i + 2, size - i);
keys[i] = key;
values[i] = value;
children[i + 1] = newIndex;
size++;
if (size < n + n + 1)
// otherwise, store will be performed by uplink
store();
}
public void store() throws RecordStoreException {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
dos.writeInt(size);
for (int i = 0; i < size; i++) {
dos.writeInt(children[i]);
dos.writeUTF(keys[i]);
dos.writeUTF(values[i]);
}
dos.writeInt(children[size]);
byte[] data = bos.toByteArray();
store.setRecord(index, data, 0, data.length);
} catch (IOException e) {
throw new RuntimeException(e.toString());
}
}
}
/**
* Creates a new index with the given Name
*/
public RmsIndex(String name) throws RecordStoreException {
store = RecordStore.openRecordStore(name, true);
root = store.getNumRecords() == 0 ? new Node() : new Node(1);
}
/**
* Returns the value for the given key
*
* @param key: The key
* @return String: The value associated with the key, or null if none.
* @throws RecordStoreException
*/
public String get(String key) throws RecordStoreException {
Node current = root;
while (true) {
int i;
for (i = 0; i < current.size; i++) {
int cmp = key.compareTo(current.keys[i]);
if (cmp == 0)
return current.values[i];
else if (cmp < 0)
break;
}
if (current.children[i] == 0)
return null;
current = new Node(current.children[i]);
}
}
/**
* Assigns the given value to the given key persistently
*
* @param key: The key
* @param value: The value
* @throws RecordStoreException
*/
public void put(String key, String value) throws RecordStoreException {
root.put(key, value);
if (root.size < n + n + 1)
return;
// split root....
Node left = root;
root = new Node();
left.index = root.index;
root.index = 1;
Node right = new Node(left);
root.keys[0] = left.keys[n];
root.values[0] = left.values[n];
root.children[0] = left.index;
root.children[1] = right.index;
root.size = 1;
root.store();
}
public void close() throws RecordStoreException {
store.closeRecordStore();
}
public int size() throws RecordStoreException {
Node current = root;
return current.size;
}
public String get(int recordNum) throws RecordStoreException {
Node current = root;
return current.values[recordNum];
}
public String getKey(int recordNum) throws RecordStoreException {
Node current = root;
return current.keys[recordNum];
}
public void deleteAll(String name) throws RecordStoreException {
store.closeRecordStore();
RecordStore.deleteRecordStore(name);
store = RecordStore.openRecordStore(name, true);
root = store.getNumRecords() == 0 ? new Node() : new Node(1);
}
}