Ver Fonte

First round - Mesh network

Mike Duan há 9 anos atrás
pai
commit
031931cf6c

+ 113 - 77
.idea/workspace.xml

@@ -11,10 +11,12 @@
   </component>
   </component>
   <component name="ChangeListManager">
   <component name="ChangeListManager">
     <list default="true" id="053edabf-4111-4892-a056-15b75b9c4605" name="Default" comment="">
     <list default="true" id="053edabf-4111-4892-a056-15b75b9c4605" name="Default" comment="">
-      <change type="DELETED" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BuildConfig.java" afterPath="" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/app.iml" afterPath="$PROJECT_DIR$/app/app.iml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" />
     </list>
     </list>
     <ignored path="Pplfindr.iws" />
     <ignored path="Pplfindr.iws" />
     <ignored path=".idea/workspace.xml" />
     <ignored path=".idea/workspace.xml" />
@@ -45,16 +47,16 @@
       <file leaf-file-name="MainActivity.java" pinned="false" current-in-tab="true">
       <file leaf-file-name="MainActivity.java" pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java">
           <provider selected="true" editor-type-id="text-editor">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="0.06733167">
-              <caret line="97" column="4" selection-start-line="97" selection-start-column="4" selection-end-line="97" selection-end-column="4" />
+            <state vertical-scroll-proportion="0.44074073">
+              <caret line="70" column="11" selection-start-line="70" selection-start-column="11" selection-end-line="70" selection-end-column="11" />
               <folding>
               <folding>
                 <element signature="imports" expanded="true" />
                 <element signature="imports" expanded="true" />
-                <element signature="e#1687#2118#0" expanded="true" />
-                <element signature="e#1879#1908#0" expanded="true" />
-                <element signature="e#1994#2023#0" expanded="true" />
-                <element signature="e#2117#2118#0" expanded="true" />
-                <element signature="e#6439#7211#0" expanded="true" />
-                <element signature="e#7210#7211#0" expanded="true" />
+                <element signature="e#1826#2257#0" expanded="true" />
+                <element signature="e#2018#2047#0" expanded="true" />
+                <element signature="e#2133#2162#0" expanded="true" />
+                <element signature="e#2256#2257#0" expanded="true" />
+                <element signature="e#7413#8185#0" expanded="true" />
+                <element signature="e#8184#8185#0" expanded="true" />
               </folding>
               </folding>
             </state>
             </state>
           </provider>
           </provider>
@@ -63,8 +65,8 @@
       <file leaf-file-name="BluetoothClient.java" pinned="false" current-in-tab="false">
       <file leaf-file-name="BluetoothClient.java" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java">
           <provider selected="true" editor-type-id="text-editor">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-3.275862">
-              <caret line="82" column="60" selection-start-line="82" selection-start-column="60" selection-end-line="82" selection-end-column="60" />
+            <state vertical-scroll-proportion="-9.931034">
+              <caret line="85" column="112" selection-start-line="85" selection-start-column="112" selection-end-line="85" selection-end-column="112" />
               <folding>
               <folding>
                 <element signature="imports" expanded="true" />
                 <element signature="imports" expanded="true" />
               </folding>
               </folding>
@@ -75,8 +77,8 @@
       <file leaf-file-name="BluetoothServer.java" pinned="false" current-in-tab="false">
       <file leaf-file-name="BluetoothServer.java" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java">
           <provider selected="true" editor-type-id="text-editor">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-6.034483">
-              <caret line="27" column="30" selection-start-line="27" selection-start-column="30" selection-end-line="27" selection-end-column="30" />
+            <state vertical-scroll-proportion="-10.5172415">
+              <caret line="85" column="8" selection-start-line="85" selection-start-column="8" selection-end-line="85" selection-end-column="112" />
               <folding>
               <folding>
                 <element signature="imports" expanded="true" />
                 <element signature="imports" expanded="true" />
               </folding>
               </folding>
@@ -88,11 +90,13 @@
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java">
           <provider selected="true" editor-type-id="text-editor">
           <provider selected="true" editor-type-id="text-editor">
             <state vertical-scroll-proportion="0.0">
             <state vertical-scroll-proportion="0.0">
-              <caret line="59" column="37" selection-start-line="59" selection-start-column="37" selection-end-line="59" selection-end-column="37" />
+              <caret line="94" column="130" selection-start-line="94" selection-start-column="77" selection-end-line="94" selection-end-column="130" />
               <folding>
               <folding>
                 <element signature="imports" expanded="true" />
                 <element signature="imports" expanded="true" />
-                <element signature="e#2750#2751#0" expanded="true" />
-                <element signature="e#2775#2776#0" expanded="true" />
+                <element signature="e#3766#3767#0" expanded="true" />
+                <element signature="e#3811#3812#0" expanded="true" />
+                <element signature="e#3980#3981#0" expanded="true" />
+                <element signature="e#4035#4036#0" expanded="true" />
               </folding>
               </folding>
             </state>
             </state>
           </provider>
           </provider>
@@ -126,7 +130,7 @@
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java">
         <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java">
           <provider selected="true" editor-type-id="text-editor">
           <provider selected="true" editor-type-id="text-editor">
             <state vertical-scroll-proportion="0.0">
             <state vertical-scroll-proportion="0.0">
-              <caret line="16" column="17" selection-start-line="16" selection-start-column="17" selection-end-line="16" selection-end-column="17" />
+              <caret line="19" column="57" selection-start-line="19" selection-start-column="57" selection-end-line="19" selection-end-column="57" />
               <folding>
               <folding>
                 <element signature="imports" expanded="true" />
                 <element signature="imports" expanded="true" />
               </folding>
               </folding>
@@ -147,8 +151,8 @@
       <file leaf-file-name="strings.xml" pinned="false" current-in-tab="false">
       <file leaf-file-name="strings.xml" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/src/main/res/values/strings.xml">
         <entry file="file://$PROJECT_DIR$/app/src/main/res/values/strings.xml">
           <provider selected="true" editor-type-id="text-editor">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-1.4875">
-              <caret line="7" column="48" selection-start-line="7" selection-start-column="48" selection-end-line="7" selection-end-column="48" />
+            <state vertical-scroll-proportion="-1.2830188">
+              <caret line="4" column="73" selection-start-line="4" selection-start-column="73" selection-end-line="4" selection-end-column="73" />
               <folding />
               <folding />
             </state>
             </state>
           </provider>
           </provider>
@@ -1984,12 +1988,12 @@
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/InputThread.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/InputThread.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/OutputThread.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/OutputThread.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MessageHandler.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MessageHandler.java" />
-        <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java" />
-        <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java" />
-        <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java" />
         <option value="$PROJECT_DIR$/app/build.gradle" />
         <option value="$PROJECT_DIR$/app/build.gradle" />
         <option value="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" />
         <option value="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" />
+        <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java" />
         <option value="$PROJECT_DIR$/app/src/main/res/values/strings.xml" />
         <option value="$PROJECT_DIR$/app/src/main/res/values/strings.xml" />
+        <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java" />
+        <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java" />
         <option value="$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java" />
       </list>
       </list>
@@ -2412,7 +2416,7 @@
     </todo-panel>
     </todo-panel>
   </component>
   </component>
   <component name="ToolWindowManager">
   <component name="ToolWindowManager">
-    <frame x="-8" y="-8" width="1616" height="876" extended-state="0" />
+    <frame x="-8" y="-8" width="1616" height="876" extended-state="1" />
     <editor active="true" />
     <editor active="true" />
     <layout>
     <layout>
       <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
@@ -2421,8 +2425,8 @@
       <window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
       <window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
       <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32823366" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.36300418" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16968012" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.36300418" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3991655" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3991655" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
@@ -2435,7 +2439,7 @@
       <window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32880846" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32880846" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.21529563" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.21529563" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@@ -2444,6 +2448,36 @@
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
     </layout>
     </layout>
+    <layout-to-restore>
+      <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.36300418" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
+      <window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
+      <window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32880846" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.21529563" sideWeight="0.5" order="4" side_tool="false" content_ui="combo" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="7" side_tool="false" content_ui="combo" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
+      <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
+      <window_info id="Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32904884" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32823366" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3991655" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32962447" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
+    </layout-to-restore>
   </component>
   </component>
   <component name="VcsContentAnnotationSettings">
   <component name="VcsContentAnnotationSettings">
     <option name="myLimit" value="2678400000" />
     <option name="myLimit" value="2678400000" />
@@ -2453,7 +2487,7 @@
       <breakpoints>
       <breakpoints>
         <line-breakpoint enabled="true" type="java-line">
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java</url>
           <url>file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java</url>
-          <line>48</line>
+          <line>50</line>
           <properties />
           <properties />
         </line-breakpoint>
         </line-breakpoint>
       </breakpoints>
       </breakpoints>
@@ -2548,16 +2582,6 @@
         </state>
         </state>
       </provider>
       </provider>
     </entry>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-3.275862">
-          <caret line="82" column="60" selection-start-line="82" selection-start-column="60" selection-end-line="82" selection-end-column="60" />
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/gradlew">
     <entry file="file://$PROJECT_DIR$/gradlew">
       <provider selected="true" editor-type-id="text-editor">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="0.33186814">
         <state vertical-scroll-proportion="0.33186814">
@@ -2566,26 +2590,6 @@
         </state>
         </state>
       </provider>
       </provider>
     </entry>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="16" column="17" selection-start-line="16" selection-start-column="17" selection-end-line="16" selection-end-column="17" />
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-6.034483">
-          <caret line="27" column="30" selection-start-line="27" selection-start-column="30" selection-end-line="27" selection-end-column="30" />
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/app/src/main/AndroidManifest.xml">
     <entry file="file://$PROJECT_DIR$/app/src/main/AndroidManifest.xml">
       <provider selected="true" editor-type-id="text-editor">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-6.6037736">
         <state vertical-scroll-proportion="-6.6037736">
@@ -2598,10 +2602,18 @@
         </state>
         </state>
       </provider>
       </provider>
     </entry>
     </entry>
+    <entry file="file://$PROJECT_DIR$/app/build/generated/source/buildConfig/debug/com/example/mduan/pplfindr/BuildConfig.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="-1.8888888">
+          <caret line="5" column="30" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="30" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/app/src/main/res/values/strings.xml">
     <entry file="file://$PROJECT_DIR$/app/src/main/res/values/strings.xml">
       <provider selected="true" editor-type-id="text-editor">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-1.4875">
-          <caret line="7" column="48" selection-start-line="7" selection-start-column="48" selection-end-line="7" selection-end-column="48" />
+        <state vertical-scroll-proportion="-1.2830188">
+          <caret line="4" column="73" selection-start-line="4" selection-start-column="73" selection-end-line="4" selection-end-column="73" />
           <folding />
           <folding />
         </state>
         </state>
       </provider>
       </provider>
@@ -2614,38 +2626,62 @@
         </state>
         </state>
       </provider>
       </provider>
     </entry>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java">
+    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/Globals.java">
       <provider selected="true" editor-type-id="text-editor">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="0.0">
         <state vertical-scroll-proportion="0.0">
-          <caret line="59" column="37" selection-start-line="59" selection-start-column="37" selection-end-line="59" selection-end-column="37" />
+          <caret line="19" column="57" selection-start-line="19" selection-start-column="57" selection-end-line="19" selection-end-column="57" />
           <folding>
           <folding>
             <element signature="imports" expanded="true" />
             <element signature="imports" expanded="true" />
-            <element signature="e#2750#2751#0" expanded="true" />
-            <element signature="e#2775#2776#0" expanded="true" />
           </folding>
           </folding>
         </state>
         </state>
       </provider>
       </provider>
     </entry>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/build/generated/source/buildConfig/debug/com/example/mduan/pplfindr/BuildConfig.java">
+    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java">
       <provider selected="true" editor-type-id="text-editor">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-1.8888888">
-          <caret line="5" column="30" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="30" />
-          <folding />
+        <state vertical-scroll-proportion="-9.931034">
+          <caret line="85" column="112" selection-start-line="85" selection-start-column="112" selection-end-line="85" selection-end-column="112" />
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="-10.5172415">
+          <caret line="85" column="8" selection-start-line="85" selection-start-column="8" selection-end-line="85" selection-end-column="112" />
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="0.0">
+          <caret line="94" column="130" selection-start-line="94" selection-start-column="77" selection-end-line="94" selection-end-column="130" />
+          <folding>
+            <element signature="imports" expanded="true" />
+            <element signature="e#3766#3767#0" expanded="true" />
+            <element signature="e#3811#3812#0" expanded="true" />
+            <element signature="e#3980#3981#0" expanded="true" />
+            <element signature="e#4035#4036#0" expanded="true" />
+          </folding>
         </state>
         </state>
       </provider>
       </provider>
     </entry>
     </entry>
     <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java">
     <entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/mduan/pplfindr/MainActivity.java">
       <provider selected="true" editor-type-id="text-editor">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.06733167">
-          <caret line="97" column="4" selection-start-line="97" selection-start-column="4" selection-end-line="97" selection-end-column="4" />
+        <state vertical-scroll-proportion="0.44074073">
+          <caret line="70" column="11" selection-start-line="70" selection-start-column="11" selection-end-line="70" selection-end-column="11" />
           <folding>
           <folding>
             <element signature="imports" expanded="true" />
             <element signature="imports" expanded="true" />
-            <element signature="e#1687#2118#0" expanded="true" />
-            <element signature="e#1879#1908#0" expanded="true" />
-            <element signature="e#1994#2023#0" expanded="true" />
-            <element signature="e#2117#2118#0" expanded="true" />
-            <element signature="e#6439#7211#0" expanded="true" />
-            <element signature="e#7210#7211#0" expanded="true" />
+            <element signature="e#1826#2257#0" expanded="true" />
+            <element signature="e#2018#2047#0" expanded="true" />
+            <element signature="e#2133#2162#0" expanded="true" />
+            <element signature="e#2256#2257#0" expanded="true" />
+            <element signature="e#7413#8185#0" expanded="true" />
+            <element signature="e#8184#8185#0" expanded="true" />
           </folding>
           </folding>
         </state>
         </state>
       </provider>
       </provider>

+ 2 - 0
app/src/main/java/com/example/mduan/pplfindr/BluetoothClient.java

@@ -11,6 +11,7 @@ import android.widget.Toast;
 import java.io.IOException;
 import java.io.IOException;
 import java.math.BigInteger;
 import java.math.BigInteger;
 import java.util.UUID;
 import java.util.UUID;
+import java.util.Vector;
 
 
 /**
 /**
  * Created by mduan on 4/9/2016.
  * Created by mduan on 4/9/2016.
@@ -82,6 +83,7 @@ public class BluetoothClient extends Thread {
     {
     {
         communicationThread = new CommunicationThread(socket, mMessageHandler);
         communicationThread = new CommunicationThread(socket, mMessageHandler);
         communicationThread.start(); //TODO race condition here, if someone gives a mac address inbetween these two calls then :(
         communicationThread.start(); //TODO race condition here, if someone gives a mac address inbetween these two calls then :(
+        mMessageHandler.obtainMessage(Globals.NewCommunicationSocketOpened, communicationThread).sendToTarget();
         if(!targetAddress.isEmpty())
         if(!targetAddress.isEmpty())
         {
         {
             communicationThread.broadcastFor(targetAddress);
             communicationThread.broadcastFor(targetAddress);

+ 3 - 2
app/src/main/java/com/example/mduan/pplfindr/BluetoothServer.java

@@ -11,6 +11,7 @@ import android.os.Message;
 import java.io.IOException;
 import java.io.IOException;
 import java.math.BigInteger;
 import java.math.BigInteger;
 import java.util.UUID;
 import java.util.UUID;
+import java.util.Vector;
 
 
 /**
 /**
  * Created by mduan on 4/9/2016.
  * Created by mduan on 4/9/2016.
@@ -56,7 +57,6 @@ public class BluetoothServer extends Thread { //TODO what happens if a client co
             // If a connection was accepted
             // If a connection was accepted
             if (socket != null) {
             if (socket != null) {
                 // Do work to manage the connection (in a separate thread)
                 // Do work to manage the connection (in a separate thread)
-                Handler mainHandler = new Handler(Looper.getMainLooper());
                 Message completeMessage =
                 Message completeMessage =
                         mMessageHandler.obtainMessage(0, "Received a Connection");
                         mMessageHandler.obtainMessage(0, "Received a Connection");
                 completeMessage.sendToTarget();
                 completeMessage.sendToTarget();
@@ -67,7 +67,7 @@ public class BluetoothServer extends Thread { //TODO what happens if a client co
                     break;
                     break;
                 }
                 }
 
 
-                break;
+                //break; //TODO need to close the thread somehow.
             }
             }
         }
         }
     }
     }
@@ -83,6 +83,7 @@ public class BluetoothServer extends Thread { //TODO what happens if a client co
     {
     {
         communicationThread = new CommunicationThread(socket, mMessageHandler);
         communicationThread = new CommunicationThread(socket, mMessageHandler);
         communicationThread.start();
         communicationThread.start();
+        mMessageHandler.obtainMessage(Globals.NewCommunicationSocketOpened, communicationThread).sendToTarget();
         if(!targetMACAddress.isEmpty())
         if(!targetMACAddress.isEmpty())
         {
         {
             communicationThread.broadcastFor(targetMACAddress);
             communicationThread.broadcastFor(targetMACAddress);

+ 42 - 3
app/src/main/java/com/example/mduan/pplfindr/CommunicationThread.java

@@ -8,6 +8,7 @@ import android.util.Log;
 import java.io.IOException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStream;
+import java.util.Vector;
 
 
 /**
 /**
  * Created by mduan on 4/9/2016.
  * Created by mduan on 4/9/2016.
@@ -17,6 +18,7 @@ public class CommunicationThread extends Thread {
     private final InputStream mmInStream;
     private final InputStream mmInStream;
     private final OutputStream mmOutStream;
     private final OutputStream mmOutStream;
     private Handler mMainHandler;
     private Handler mMainHandler;
+    private Vector<String> IDCache;
 
 
     public CommunicationThread(BluetoothSocket socket, Handler messageHandler) {
     public CommunicationThread(BluetoothSocket socket, Handler messageHandler) {
         mmSocket = socket;
         mmSocket = socket;
@@ -48,6 +50,7 @@ public class CommunicationThread extends Thread {
                 String readBytes = new String(buffer, "UTF-8");
                 String readBytes = new String(buffer, "UTF-8");
                 mMainHandler.obtainMessage(Globals.MESSAGE_READ, bytes, -1, readBytes)
                 mMainHandler.obtainMessage(Globals.MESSAGE_READ, bytes, -1, readBytes)
                         .sendToTarget();
                         .sendToTarget();
+                HandleMessage(readBytes);
             } catch (IOException e) {
             } catch (IOException e) {
                 mMainHandler.obtainMessage(0, "Exception Caught").sendToTarget();
                 mMainHandler.obtainMessage(0, "Exception Caught").sendToTarget();
                 mMainHandler.obtainMessage(0, e.toString()).sendToTarget();
                 mMainHandler.obtainMessage(0, e.toString()).sendToTarget();
@@ -75,12 +78,48 @@ public class CommunicationThread extends Thread {
 
 
     public void broadcastFor(String macAddress)
     public void broadcastFor(String macAddress)
     {
     {
-        Log.d("this should work", "Message should've been sent");
-        write(macAddress.getBytes());
+        String finalString = Globals.MARCO + Globals.myMACADDRESS + macAddress + getGPSLocation() + getUniqueMessageID();
+        write(finalString.getBytes());
+        Globals.incrementor++;
+    }
+    public void HandleMessage(String message)
+    {
+        if(messageShouldBeBroadcasted(message))
+        {
+            mMainHandler.obtainMessage(Globals.MESSAGE_BROADCAST_RECEIVED, message).sendToTarget();
+        }
+    }
+
+    public boolean messageShouldBeBroadcasted(String message)
+    {
+        if(message.substring(0,1).equals(Integer.toString(Globals.MARCO)) && message.substring(1, 18).equals(Globals.myMACADDRESS))
+        {
+            return false;
+        }
+        String messageID = message.substring(65);
+        for(String previousIDs : IDCache)
+        {
+            if(previousIDs.equals(messageID) && !message.substring(0,1).equals(Integer.toString(Globals.POLO)))
+            {
+                return false;
+            }
+        }
+        IDCache.add(messageID);
+        return true;
+    }
+
+    public void broadcast(String toBroadcast)
+    {
+        write(toBroadcast.getBytes());
+    }
+
+    private String getUniqueMessageID()
+    {
+        return Integer.toString(Globals.incrementor + Globals.messageID);
     }
     }
 
 
     public String getGPSLocation()
     public String getGPSLocation()
     {
     {
-        return "";
+        return "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
     }
     }
 }
 }

+ 8 - 0
app/src/main/java/com/example/mduan/pplfindr/Globals.java

@@ -15,8 +15,16 @@ public class Globals {
         toast.show();
         toast.show();
     }
     }
     public final static int MESSAGE_READ = 200;
     public final static int MESSAGE_READ = 200;
+    public final static int MESSAGE_BROADCAST_RECEIVED = 99;
+    public final static int NewCommunicationSocketOpened = 98;
     public static String ABHINAV_MAC = "8C:3A:E3:FC:29:DC";
     public static String ABHINAV_MAC = "8C:3A:E3:FC:29:DC";
     public static String TRAVIS_MAC = "DC:EE:06:E9:9F:0A";
     public static String TRAVIS_MAC = "DC:EE:06:E9:9F:0A";
     public static String MIKE_MAC = "88:C9:D0:74:DB:FF";
     public static String MIKE_MAC = "88:C9:D0:74:DB:FF";
+    public static String APP_ID = "AF8";
+    public static String myMACADDRESS = ""; //TODO race conditions galore
+    public final static int MARCO = 0;
+    public final static int POLO = 1;
+    public static int incrementor = 0; //TODO lol the desperation is real
+    public static int messageID = (int)(Math.random() * 50 + 1);
 
 
 }
 }

+ 34 - 7
app/src/main/java/com/example/mduan/pplfindr/MainActivity.java

@@ -28,11 +28,14 @@ import com.facebook.CallbackManager;
 import com.facebook.FacebookSdk;
 import com.facebook.FacebookSdk;
 import com.facebook.Profile;
 import com.facebook.Profile;
 
 
+import java.util.Vector;
+
 public class MainActivity extends AppCompatActivity {
 public class MainActivity extends AppCompatActivity {
     public static int REQUEST_ENABLE_BT = 100; //Used to ID our intent to turn on BlueTooth
     public static int REQUEST_ENABLE_BT = 100; //Used to ID our intent to turn on BlueTooth
     private BluetoothAdapter mBluetoothAdapter;
     private BluetoothAdapter mBluetoothAdapter;
     private Handler mHandler;
     private Handler mHandler;
     private GoogleApiClient mGoogleApiClient;
     private GoogleApiClient mGoogleApiClient;
+    private Vector<CommunicationThread> commList;
 
 
     AccessToken token;
     AccessToken token;
     @Override
     @Override
@@ -41,6 +44,7 @@ public class MainActivity extends AppCompatActivity {
         setContentView(R.layout.activity_main);
         setContentView(R.layout.activity_main);
 
 
         mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
         mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+        Globals.myMACADDRESS = mBluetoothAdapter.getAddress();
 
 
         //FACEBOOK LOGIN/STATE HANDLING
         //FACEBOOK LOGIN/STATE HANDLING
         FacebookSdk.sdkInitialize(getApplicationContext(), new FacebookSdk.InitializeCallback() {
         FacebookSdk.sdkInitialize(getApplicationContext(), new FacebookSdk.InitializeCallback() {
@@ -58,13 +62,13 @@ public class MainActivity extends AppCompatActivity {
         });
         });
 
 
         // Create an instance of GoogleAPIClient.
         // Create an instance of GoogleAPIClient.
-        if (mGoogleApiClient == null) {
+        /*if (mGoogleApiClient == null) {
             mGoogleApiClient = new GoogleApiClient.Builder(this)
             mGoogleApiClient = new GoogleApiClient.Builder(this)
                     .addConnectionCallbacks(this)
                     .addConnectionCallbacks(this)
                     .addOnConnectionFailedListener(this)
                     .addOnConnectionFailedListener(this)
                     .addApi(LocationServices.API)
                     .addApi(LocationServices.API)
                     .build();
                     .build();
-        }
+        }*/
 
 
         BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
         BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
         if (mBluetoothAdapter == null) { // TODO throw up a page
         if (mBluetoothAdapter == null) { // TODO throw up a page
@@ -86,20 +90,45 @@ public class MainActivity extends AppCompatActivity {
                 {
                 {
                     case Globals.MESSAGE_READ:
                     case Globals.MESSAGE_READ:
                         message = inputMessage.obj.toString();
                         message = inputMessage.obj.toString();
+                        Display(message);
+                        break;
+                    case Globals.NewCommunicationSocketOpened:
+                        commList.add((CommunicationThread)inputMessage.obj);
+                        break;
+                    case Globals.MESSAGE_BROADCAST_RECEIVED:
+                        if(GPSFound(message))
+                        {
+                            Display("FOUND HIM: " + message);
+                        }
+                        else
+                        {
+                            BroadcastToAll(message);
+                        }
                         break;
                         break;
                     case 0:
                     case 0:
                         message = inputMessage.obj.toString();
                         message = inputMessage.obj.toString();
+                        Display(message);
                         break;
                         break;
                     default:
                     default:
                         super.handleMessage(inputMessage);
                         super.handleMessage(inputMessage);
 
 
                 }
                 }
-                Display(message);
             }
             }
         };
         };
     }
     }
 
 
+    public boolean GPSFound(String message)
+    {
+        return message.substring(0,1).equals(Integer.toString(Globals.POLO)) && message.substring(1, 18).equals(Globals.myMACADDRESS);
+    }
 
 
+    public void BroadcastToAll(String message)
+    {
+        for(CommunicationThread comm : commList)
+        {
+            comm.broadcast(message);
+        }
+    }
     public void Display(String message)
     public void Display(String message)
     {
     {
         Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
         Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
@@ -162,9 +191,7 @@ public class MainActivity extends AppCompatActivity {
     }
     }
 
 
     public void hostServerAndConnect(View view) {
     public void hostServerAndConnect(View view) {
-        BluetoothServer server = new BluetoothServer(mBluetoothAdapter, mHandler);
-        server.AcceptThread();
-        server.start();
+
         BluetoothClient client = new BluetoothClient(mHandler, mHandler, "" /*=Mac Address*/); //TODO validate addresses when this becomes a freaking list
         BluetoothClient client = new BluetoothClient(mHandler, mHandler, "" /*=Mac Address*/); //TODO validate addresses when this becomes a freaking list
         BluetoothDevice otherPhone = mBluetoothAdapter.getRemoteDevice(Globals.ABHINAV_MAC);
         BluetoothDevice otherPhone = mBluetoothAdapter.getRemoteDevice(Globals.ABHINAV_MAC);
         client.ConnectThread(otherPhone);
         client.ConnectThread(otherPhone);
@@ -176,7 +203,7 @@ public class MainActivity extends AppCompatActivity {
         BluetoothDevice otherPhone = mBluetoothAdapter.getRemoteDevice(Globals.MIKE_MAC);
         BluetoothDevice otherPhone = mBluetoothAdapter.getRemoteDevice(Globals.MIKE_MAC);
         client.ConnectThread(otherPhone);
         client.ConnectThread(otherPhone);
         client.start();
         client.start();
-        client.lookFor("Hello World");
+        client.lookFor(Globals.TRAVIS_MAC);
     }
     }
 
 
     //TODO Listen for the user turning off Bluetooth. Need to turn bluetooth back on
     //TODO Listen for the user turning off Bluetooth. Need to turn bluetooth back on

+ 2 - 2
app/src/main/res/values/strings.xml

@@ -1,8 +1,8 @@
 <resources>
 <resources>
     <string name="app_name">Pplfindr</string>
     <string name="app_name">Pplfindr</string>
     <string name="TargetHostButton">TargetPerson</string>
     <string name="TargetHostButton">TargetPerson</string>
-    <string name="MiddleHostButtonAndConnect">MiddlePerson</string>
-    <string name="InitialPersonConnectButton">InitialPerson</string>
+    <string name="MiddleHostButtonAndConnect">ConnectAbhinav</string>
+    <string name="InitialPersonConnectButton">ConnectMikeAndLookForTravis</string>
     <string name="MainButton">Butt</string>
     <string name="MainButton">Butt</string>
     <string name="facebook_app_id">1370892879603114</string>
     <string name="facebook_app_id">1370892879603114</string>
     <string name="debug_tag">Marco Polo</string>
     <string name="debug_tag">Marco Polo</string>