2013-05-14 Mark Holland <mark@mark-holland.me.uk>
* src/pandroid/agent/PandroidAgentListener.java: Moved the loading of the config values to an asynctask to force that updating the values and then contacting the server and creating the notification happens after all the config values have been loaded. * src/pandroid/agent/Status.java: On resuming the app the loading of the last values has been moved to an asynctask to force updating the ui to wait for all the values to be loaded. * src/pandroid/agent/*.java: Applied the Correct Indentation function of eclipse to all code. * res/layout/*.xml: Applied the Correct Indentation function of eclipse to all code. * Pandroid Agent v3.0_iso-8859-1.apk: Updated to latest version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8127 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1c49e57a52
commit
fe4bcdc14a
|
@ -15,78 +15,79 @@
|
|||
// GNU General Public License for more details.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="pandroid.agent"
|
||||
android:versionCode="2"
|
||||
android:versionName="1.5">
|
||||
|
||||
package="pandroid.agent"
|
||||
android:versionCode="2"
|
||||
android:versionName="1.5" >
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||
<uses-permission android:name="android.permission.GET_TASKS"/>
|
||||
<uses-permission android:name="android.permission.BATTERY_STATS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
|
||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<uses-feature android:name="android.hardware.sensor.light" />
|
||||
<uses-feature android:name="android.hardware.location" />
|
||||
|
||||
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||
<uses-permission android:name="android.permission.BATTERY_STATS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.READ_CALL_LOG" />
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<uses-feature android:name="android.hardware.sensor.light" />
|
||||
<uses-feature android:name="android.hardware.location" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name" >
|
||||
<activity
|
||||
android:name=".PandroidAgent"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
android:theme="@style/MainTheme"
|
||||
>
|
||||
android:name=".PandroidAgent"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MainTheme" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".Status" />
|
||||
<activity android:name=".Setup" />
|
||||
|
||||
<service android:enabled="true" android:name="pandroid.agent.PandroidAgentListener" />
|
||||
<receiver android:name="pandroid.agent.EventReceiver" />
|
||||
|
||||
<receiver
|
||||
android:name="pandroid.agent.StartMyServiceAtBootReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:label="StartMyServiceAtBootReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service android:enabled="true" android:name="pandroid.agent.MyStartService" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".About"
|
||||
android:label="@string/pandroid_agent_str"
|
||||
android:theme="@android:style/Theme.Dialog"
|
||||
/>
|
||||
<activity
|
||||
android:name=".Help"
|
||||
android:label="@string/help_str"
|
||||
android:theme="@android:style/Theme.Dialog"
|
||||
/>
|
||||
|
||||
<receiver android:name=".SMSBroadcastReceiver">
|
||||
|
||||
<service
|
||||
android:name="pandroid.agent.PandroidAgentListener"
|
||||
android:enabled="true" />
|
||||
|
||||
<receiver android:name="pandroid.agent.EventReceiver" />
|
||||
<receiver
|
||||
android:name="pandroid.agent.StartMyServiceAtBootReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:label="StartMyServiceAtBootReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name="pandroid.agent.MyStartService"
|
||||
android:enabled="true" />
|
||||
|
||||
<activity
|
||||
android:name=".About"
|
||||
android:label="@string/pandroid_agent_str"
|
||||
android:theme="@android:style/Theme.Dialog" />
|
||||
<activity
|
||||
android:name=".Help"
|
||||
android:label="@string/help_str"
|
||||
android:theme="@android:style/Theme.Dialog" />
|
||||
|
||||
<receiver android:name=".SMSBroadcastReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED" >
|
||||
</action>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
|
||||
<uses-sdk android:minSdkVersion="8"/>
|
||||
</manifest>
|
||||
|
||||
<uses-sdk android:minSdkVersion="8" />
|
||||
|
||||
</manifest>
|
|
@ -1,11 +1,30 @@
|
|||
2013-05-14 Mark Holland <mark@mark-holland.me.uk>
|
||||
|
||||
* src/pandroid/agent/PandroidAgentListener.java: Moved the
|
||||
loading of the config values to an asynctask to force that updating
|
||||
the values and then contacting the server and creating the
|
||||
notification happens after all the config values have been loaded.
|
||||
|
||||
* src/pandroid/agent/Status.java: On resuming the app
|
||||
the loading of the last values has been moved to an asynctask to force
|
||||
updating the ui to wait for all the values to be loaded.
|
||||
|
||||
* src/pandroid/agent/*.java: Applied the Correct Indentation function
|
||||
of eclipse to all code.
|
||||
|
||||
* res/layout/*.xml: Applied the Correct Indentation function
|
||||
of eclipse to all code.
|
||||
|
||||
* Pandroid Agent v3.0_iso-8859-1.apk: Updated to latest version.
|
||||
|
||||
2013-05-01 Mark Holland <mark@mark-holland.me.uk>
|
||||
|
||||
* src/pandroid/agent/PandroidAgentListener.java: Changed gps module
|
||||
to update coordinates after a time of "interval" AND "15 metres" if
|
||||
* src/pandroid/agent/PandroidAgentListener.java: Changed gps module
|
||||
to update coordinates after a time of "interval" AND "15 metres" if
|
||||
no change then uses lastKnownLocation.
|
||||
|
||||
* Pandroid Agent v3.0_iso-8859-1.apk: Updated to latest version.
|
||||
|
||||
* Pandroid Agent v3.0_iso-8859-1.apk: Updated to latest version.
|
||||
|
||||
2013-04-28 Mark Holland <mark@mark-holland.me.uk>
|
||||
|
||||
* layout/spinner.xml: Changed spinnner text color to green.
|
||||
|
|
Binary file not shown.
|
@ -20,36 +20,36 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="10dip" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_logo_about"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0"
|
||||
android:contentDescription="@string/about_desc"
|
||||
android:src="@drawable/pandorafms_logo" />
|
||||
<ImageView
|
||||
android:id="@+id/img_logo_about"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0"
|
||||
android:contentDescription="@string/about_desc"
|
||||
android:src="@drawable/pandorafms_logo" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pandroid_agent_copyright" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/licensed_under_gpl_str" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:text="@string/develop_team_str" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/url_pandora"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pandroid_agent_copyright"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/licensed_under_gpl_str"
|
||||
android:gravity="center_horizontal"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/develop_team_str"
|
||||
android:gravity="left"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/url_pandora"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
/>
|
||||
</LinearLayout>
|
|
@ -14,25 +14,22 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="10dip"
|
||||
android:background="#000000"
|
||||
>
|
||||
android:orientation="vertical"
|
||||
android:padding="10dip" >
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/help_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</ScrollView>
|
||||
<TextView
|
||||
android:id="@+id/help_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
|
@ -12,7 +12,8 @@
|
|||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.-->
|
||||
// GNU General Public License for more details.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/p"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -27,7 +28,6 @@
|
|||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:text="@string/yes" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/no_button"
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
-->
|
||||
// GNU General Public License for more details.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/setupnosim"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -31,15 +31,15 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkNotification"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="5sp"
|
||||
android:text="@string/notificationCheck"
|
||||
android:textColor="#bbbbbb"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="5sp"/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/field1"
|
||||
|
@ -52,7 +52,7 @@
|
|||
android:id="@+id/serverAddrInput"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView
|
||||
|
@ -91,9 +91,9 @@
|
|||
android:id="@+id/agentNameInput"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/field5"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -106,7 +106,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:singleLine="true" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/field6"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -119,19 +119,19 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="textUri"
|
||||
android:singleLine="true" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/goToWebButton"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/go_to_web" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/field7"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/taskToReport" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -148,7 +148,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkTaskReport"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -180,7 +180,7 @@
|
|||
android:text="@string/memoryReport"
|
||||
android:textColor="#bbbbbb"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkDeviceUpTimeReport"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -188,7 +188,7 @@
|
|||
android:text="@string/uptimeReport"
|
||||
android:textColor="#bbbbbb"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkInventoryReport"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -196,7 +196,7 @@
|
|||
android:text="@string/InventoryReport"
|
||||
android:textColor="#bbbbbb"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkHelloSignalReport"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -204,31 +204,30 @@
|
|||
android:text="@string/HelloSignalReport"
|
||||
android:textColor="#bbbbbb"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/update"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/update" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_password"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/set_password" />
|
||||
|
||||
<Button
|
||||
|
||||
<Button
|
||||
android:id="@+id/stopAgent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/stopAgent" />
|
||||
|
||||
<Button
|
||||
|
||||
<Button
|
||||
android:id="@+id/restartAgent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/restartAgent" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="#00FF00">
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="#00FF00" >
|
||||
|
||||
</TextView>
|
|
@ -14,108 +14,94 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
|
||||
>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_margin="5dp" >
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_margin="5dp" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/last_values_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/last_values"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/last_values_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/last_values"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lastContactInfo_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/lastContactInfo_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/logo"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/img_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/latitude_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/lastContactInfo_label_str"
|
||||
android:text="@string/latitude"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/latitude_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/lastContactInfo_label_str"
|
||||
android:text="@string/latitude"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/latitude_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/latitude_label_str"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/latitude_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/latitude_label_str" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/longitude_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/latitude_value_str"
|
||||
android:text="@string/longitude"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/longitude_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/latitude_value_str"
|
||||
android:text="@string/longitude"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/longitude_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/longitude_label_str"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/longitude_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/longitude_label_str" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/battery_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/longitude_value_str"
|
||||
android:text="@string/battery_level"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/battery_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/longitude_value_str"
|
||||
android:text="@string/battery_level"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/battery_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/battery_label_str"
|
||||
/>
|
||||
|
||||
<!--
|
||||
<TextView
|
||||
android:id="@+id/battery_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/battery_label_str" />
|
||||
|
||||
<!--
|
||||
<TextView
|
||||
android:id="@+id/orientation_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -146,355 +132,310 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/proximity_label_str"
|
||||
/>
|
||||
-->
|
||||
</RelativeLayout>
|
||||
-->
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/task_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/task"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/task_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/task"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/task_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/task_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/memory_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/memory"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/memory_label_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/memory"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/memory_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.18"
|
||||
>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/uptime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/uptime"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/memory_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/uptime_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sim_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sim_id"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.18" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sim_id_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_operator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/network_operator"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:paddingRight="5dip"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/uptime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/uptime"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_operator_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
<TextView
|
||||
android:id="@+id/uptime_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/network_type"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_type_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
</TableRow>
|
||||
<TextView
|
||||
android:id="@+id/sim_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sim_id"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/phone_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/phone_type"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sim_id_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/phone_type_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/signal_strength"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/signal_strength"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/signal_strength_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_received"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sms_received"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/network_operator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="5dip"
|
||||
android:text="@string/network_operator"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_received_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_sent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sms_sent"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/network_operator_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_sent_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_calls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/incoming_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missed_calls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/missed_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/network_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/network_type"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missed_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/outgoing_calls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/outgoing_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/network_type_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/outgoing_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receive_bytes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/receive_bytes"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receive_bytes_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transmit_bytes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/transmit_bytes"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/phone_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/phone_type"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transmit_bytes_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/roaming"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/roaming"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/phone_type_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roaming_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
<TableRow
|
||||
android:id="@+id/tableRow5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
|
||||
<!-- for debugging
|
||||
<TextView
|
||||
android:id="@+id/signal_strength"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/signal_strength"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/signal_strength_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_received"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sms_received"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_received_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_sent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sms_sent"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_sent_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_calls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/incoming_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missed_calls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/missed_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missed_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/outgoing_calls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/outgoing_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/outgoing_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receive_bytes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/receive_bytes"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receive_bytes_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transmit_bytes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/transmit_bytes"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transmit_bytes_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roaming"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/roaming"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roaming_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<!--
|
||||
for debugging
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -527,8 +468,8 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hide xml" />
|
||||
-->
|
||||
</LinearLayout>
|
||||
-->
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
|
@ -4,7 +4,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ImageView1"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -16,10 +16,6 @@
|
|||
android:contentDescription="Pandroid logo"
|
||||
android:paddingTop="20dp"
|
||||
android:src="@drawable/pandroid_large" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/help_button_menu_options"
|
||||
android:title="@string/help_label_str"
|
||||
android:icon="@drawable/help"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/about_button_menu_options"
|
||||
android:title="@string/about_label_str"
|
||||
android:icon="@drawable/about"
|
||||
/>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/help_button_menu_options"
|
||||
android:icon="@drawable/help"
|
||||
android:title="@string/help_label_str"/>
|
||||
<item
|
||||
android:id="@+id/about_button_menu_options"
|
||||
android:icon="@drawable/about"
|
||||
android:title="@string/about_label_str"/>
|
||||
|
||||
</menu>
|
|
@ -22,13 +22,13 @@ import android.widget.TextView;
|
|||
|
||||
public class About extends Activity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.about);
|
||||
|
||||
TextView text = (TextView) findViewById(R.id.url_pandora);
|
||||
text.setText(Html.fromHtml("<a href='http://pandorafms.com/'>PandoraFMS.com</a>"));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.about);
|
||||
|
||||
TextView text = (TextView) findViewById(R.id.url_pandora);
|
||||
text.setText(Html.fromHtml("<a href='http://pandorafms.com/'>PandoraFMS.com</a>"));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,11 +24,11 @@ import android.content.SharedPreferences;
|
|||
//import android.util.Log;
|
||||
|
||||
public class Core {
|
||||
|
||||
|
||||
// //
|
||||
// CONSTANTS //
|
||||
// //
|
||||
|
||||
|
||||
//The 181 is the first invalid value between 180 and -180 values.
|
||||
static final float CONST_INVALID_COORDS = 181;
|
||||
static final int CONST_INVALID_BATTERY_LEVEL = -1;
|
||||
|
@ -37,208 +37,208 @@ public class Core {
|
|||
static final float CONST_INVALID_PROXIMITY = -1;
|
||||
static final long CONST_INVALID_CONTACT = -1;
|
||||
static final int CONST_CONTACT_ERROR = 0;
|
||||
|
||||
|
||||
// //
|
||||
// DEFAULT CONFIGURATION MODULES //
|
||||
// //
|
||||
|
||||
static volatile public String defaultServerAddr = "firefly.artica.es"; //master address
|
||||
static volatile public String defaultServerPort = "41121";
|
||||
static volatile public int defaultInterval = 300;
|
||||
static volatile public String defaultAgentName = "pandroid";
|
||||
static volatile public long defaultBufferSize = 256;
|
||||
static volatile public String defaultmobileWebURL = "firefly.artica.es/pandora_demo/mobile";
|
||||
static volatile public String defaultTaskStatus = "disabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultGpsStatus = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultBatteryLevelReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultMemoryStatus = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultPasswordCheck = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultDeviceUpTimeReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultInventoryReport = "disabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultNotificationCheck = "enabled"; // "disabled" or "enabled"
|
||||
|
||||
static volatile public boolean defaultHasSim = false;
|
||||
|
||||
//hasSim values
|
||||
|
||||
static volatile public String defaultSimIDReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultNetworkOperatorReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultNetworkTypeReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultPhoneTypeReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultSignalStrengthReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultReceivedSMSReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultSentSMSReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultIncomingCallsReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultMissedCallsReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultOutgoingCallsReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultBytesReceivedReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultRoamingReport = "enabled"; // "disabled" or "enabled"
|
||||
|
||||
|
||||
// //
|
||||
// DEFAULT MODULE VALUES //
|
||||
// //
|
||||
|
||||
static volatile public String defaultTask = "";
|
||||
static volatile public String defaultTaskHumanName = "";
|
||||
static volatile public String defaultTaskRun = "false";
|
||||
static volatile public long defaultRam = 0;
|
||||
static volatile public long defaultContact = 0;
|
||||
static volatile public int defaultContactError = 0;
|
||||
static volatile public long defaultUpTime = 0;
|
||||
static volatile public int defaultHelloSignal = 2;
|
||||
|
||||
|
||||
//hasSim values
|
||||
static volatile public String defaultSimID = "";
|
||||
static volatile public String defaultNetworkOperator = "";
|
||||
static volatile public String defaultNetworkType = "";
|
||||
static volatile public String defaultPhoneType = "";
|
||||
static volatile public int defaultSignalStrength = 0;
|
||||
static volatile public int defaultSMSReceived = 0;
|
||||
static volatile public int defaultSMSSent = 0;
|
||||
static volatile public int defaultIncomingCalls = 0;
|
||||
static volatile public int defaultMissedCalls = 0;
|
||||
static volatile public int defaultOutgoingCalls = 0;
|
||||
static volatile public long defaultReceiveBytes = 0;
|
||||
static volatile public long defaultTransmitBytes = 0;
|
||||
static volatile public int defaultRoaming = 0;
|
||||
|
||||
|
||||
static volatile public String defaultPassword = "";
|
||||
|
||||
static volatile public Context con = null;
|
||||
static volatile public AlarmManager am = null;
|
||||
static volatile public PendingIntent sender = null;
|
||||
static volatile public boolean alarmEnabled = false;
|
||||
|
||||
// //
|
||||
// CONFIGURATION VALUES //
|
||||
// //
|
||||
|
||||
static volatile public String serverAddr = defaultServerAddr;
|
||||
static volatile public String serverPort = defaultServerPort;
|
||||
static volatile public int interval = defaultInterval;
|
||||
static volatile public String agentName = defaultAgentName;
|
||||
static volatile public long bufferSize = defaultBufferSize;
|
||||
static volatile public String mobileWebURL = defaultmobileWebURL;
|
||||
static volatile public String taskStatus = defaultTaskStatus;
|
||||
static volatile public String task = defaultTask;
|
||||
static volatile public String taskHumanName = defaultTaskHumanName;
|
||||
static volatile public String gpsStatus = defaultGpsStatus;
|
||||
static volatile public String BatteryLevelReport = defaultHelloSignalReport;
|
||||
static volatile public String memoryStatus = defaultMemoryStatus;
|
||||
static volatile public String passwordCheck = defaultPasswordCheck;
|
||||
static volatile public String DeviceUpTimeReport = defaultDeviceUpTimeReport;
|
||||
static volatile public String InventoryReport = defaultRoamingReport;
|
||||
static volatile public String HelloSignalReport = defaultHelloSignalReport;
|
||||
static volatile public String RoamingReport = defaultRoamingReport;
|
||||
static volatile public String NotificationCheck = defaultNotificationCheck;
|
||||
|
||||
//hasSim values
|
||||
|
||||
static volatile public boolean hasSim = defaultHasSim;
|
||||
static volatile public String simIDReport = defaultSimIDReport;
|
||||
static volatile public String NetworkOperatorReport = defaultNetworkOperatorReport;
|
||||
static volatile public String NetworkTypeReport = defaultNetworkTypeReport;
|
||||
static volatile public String PhoneTypeReport = defaultPhoneTypeReport;
|
||||
static volatile public String SignalStrengthReport = defaultSignalStrengthReport;
|
||||
static volatile public String ReceivedSMSReport = defaultReceivedSMSReport;
|
||||
static volatile public String SentSMSReport = defaultSentSMSReport;
|
||||
static volatile public String IncomingCallsReport = defaultIncomingCallsReport;
|
||||
static volatile public String MissedCallsReport = defaultMissedCallsReport;
|
||||
static volatile public String OutgoingCallsReport = defaultOutgoingCallsReport;
|
||||
static volatile public String BytesReceivedReport = defaultBytesReceivedReport;
|
||||
static volatile public String BytesSentReport = defaultBytesSentReport;
|
||||
|
||||
static volatile public String password = defaultPassword;
|
||||
|
||||
// //
|
||||
// MODULES VALUES //
|
||||
// //
|
||||
|
||||
static volatile public float latitude = CONST_INVALID_COORDS;
|
||||
static volatile public float longitude = CONST_INVALID_COORDS;
|
||||
static volatile public int batteryLevel = CONST_INVALID_BATTERY_LEVEL;
|
||||
static volatile public float orientation = CONST_INVALID_ORIENTATION;
|
||||
static volatile public float proximity = CONST_INVALID_PROXIMITY;
|
||||
static volatile public String taskRun = defaultTaskRun;
|
||||
static volatile public long availableRamKb = defaultRam;
|
||||
static volatile public long totalRamKb = defaultRam;
|
||||
static volatile public long upTime = defaultUpTime;
|
||||
static volatile public int helloSignal = defaultHelloSignal;
|
||||
static volatile public int roaming = defaultRoaming;
|
||||
|
||||
|
||||
static volatile public long lastContact = CONST_INVALID_CONTACT;
|
||||
static volatile public int contactError = CONST_CONTACT_ERROR;
|
||||
static volatile public String simID = defaultSimID;
|
||||
|
||||
//hasSim values
|
||||
|
||||
static volatile public int SMSReceived = defaultSMSReceived;
|
||||
static volatile public int SMSSent = defaultSMSSent;
|
||||
static volatile public String networkOperator = defaultNetworkOperator;
|
||||
static volatile public String networkType = defaultNetworkType;
|
||||
static volatile public String phoneType = defaultPhoneType;
|
||||
static volatile public int signalStrength = defaultSignalStrength;
|
||||
static volatile public int incomingCalls = defaultIncomingCalls;
|
||||
static volatile public int missedCalls = defaultMissedCalls;
|
||||
static volatile public int outgoingCalls = defaultOutgoingCalls;
|
||||
static volatile public long receiveBytes = defaultReceiveBytes;
|
||||
static volatile public long transmitBytes = defaultTransmitBytes;
|
||||
|
||||
public Core() {
|
||||
|
||||
}
|
||||
|
||||
static synchronized public void startAgentListener(Context context) {
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
loadConf(con);
|
||||
|
||||
|
||||
static volatile public String defaultServerAddr = "firefly.artica.es"; //master address
|
||||
static volatile public String defaultServerPort = "41121";
|
||||
static volatile public int defaultInterval = 300;
|
||||
static volatile public String defaultAgentName = "pandroid";
|
||||
static volatile public long defaultBufferSize = 256;
|
||||
static volatile public String defaultmobileWebURL = "firefly.artica.es/pandora_demo/mobile";
|
||||
static volatile public String defaultTaskStatus = "disabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultGpsStatus = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultBatteryLevelReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultMemoryStatus = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultPasswordCheck = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultDeviceUpTimeReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultInventoryReport = "disabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultNotificationCheck = "enabled"; // "disabled" or "enabled"
|
||||
|
||||
static volatile public boolean defaultHasSim = false;
|
||||
|
||||
//hasSim values
|
||||
|
||||
static volatile public String defaultSimIDReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultNetworkOperatorReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultNetworkTypeReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultPhoneTypeReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultSignalStrengthReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultReceivedSMSReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultSentSMSReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultIncomingCallsReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultMissedCallsReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultOutgoingCallsReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultBytesReceivedReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
|
||||
static volatile public String defaultRoamingReport = "enabled"; // "disabled" or "enabled"
|
||||
|
||||
|
||||
// //
|
||||
// DEFAULT MODULE VALUES //
|
||||
// //
|
||||
|
||||
static volatile public String defaultTask = "";
|
||||
static volatile public String defaultTaskHumanName = "";
|
||||
static volatile public String defaultTaskRun = "false";
|
||||
static volatile public long defaultRam = 0;
|
||||
static volatile public long defaultContact = 0;
|
||||
static volatile public int defaultContactError = 0;
|
||||
static volatile public long defaultUpTime = 0;
|
||||
static volatile public int defaultHelloSignal = 2;
|
||||
|
||||
|
||||
//hasSim values
|
||||
static volatile public String defaultSimID = "";
|
||||
static volatile public String defaultNetworkOperator = "";
|
||||
static volatile public String defaultNetworkType = "";
|
||||
static volatile public String defaultPhoneType = "";
|
||||
static volatile public int defaultSignalStrength = 0;
|
||||
static volatile public int defaultSMSReceived = 0;
|
||||
static volatile public int defaultSMSSent = 0;
|
||||
static volatile public int defaultIncomingCalls = 0;
|
||||
static volatile public int defaultMissedCalls = 0;
|
||||
static volatile public int defaultOutgoingCalls = 0;
|
||||
static volatile public long defaultReceiveBytes = 0;
|
||||
static volatile public long defaultTransmitBytes = 0;
|
||||
static volatile public int defaultRoaming = 0;
|
||||
|
||||
|
||||
static volatile public String defaultPassword = "";
|
||||
|
||||
static volatile public Context con = null;
|
||||
static volatile public AlarmManager am = null;
|
||||
static volatile public PendingIntent sender = null;
|
||||
static volatile public boolean alarmEnabled = false;
|
||||
|
||||
// //
|
||||
// CONFIGURATION VALUES //
|
||||
// //
|
||||
|
||||
static volatile public String serverAddr = defaultServerAddr;
|
||||
static volatile public String serverPort = defaultServerPort;
|
||||
static volatile public int interval = defaultInterval;
|
||||
static volatile public String agentName = defaultAgentName;
|
||||
static volatile public long bufferSize = defaultBufferSize;
|
||||
static volatile public String mobileWebURL = defaultmobileWebURL;
|
||||
static volatile public String taskStatus = defaultTaskStatus;
|
||||
static volatile public String task = defaultTask;
|
||||
static volatile public String taskHumanName = defaultTaskHumanName;
|
||||
static volatile public String gpsStatus = defaultGpsStatus;
|
||||
static volatile public String BatteryLevelReport = defaultHelloSignalReport;
|
||||
static volatile public String memoryStatus = defaultMemoryStatus;
|
||||
static volatile public String passwordCheck = defaultPasswordCheck;
|
||||
static volatile public String DeviceUpTimeReport = defaultDeviceUpTimeReport;
|
||||
static volatile public String InventoryReport = defaultRoamingReport;
|
||||
static volatile public String HelloSignalReport = defaultHelloSignalReport;
|
||||
static volatile public String RoamingReport = defaultRoamingReport;
|
||||
static volatile public String NotificationCheck = defaultNotificationCheck;
|
||||
|
||||
//hasSim values
|
||||
|
||||
static volatile public boolean hasSim = defaultHasSim;
|
||||
static volatile public String simIDReport = defaultSimIDReport;
|
||||
static volatile public String NetworkOperatorReport = defaultNetworkOperatorReport;
|
||||
static volatile public String NetworkTypeReport = defaultNetworkTypeReport;
|
||||
static volatile public String PhoneTypeReport = defaultPhoneTypeReport;
|
||||
static volatile public String SignalStrengthReport = defaultSignalStrengthReport;
|
||||
static volatile public String ReceivedSMSReport = defaultReceivedSMSReport;
|
||||
static volatile public String SentSMSReport = defaultSentSMSReport;
|
||||
static volatile public String IncomingCallsReport = defaultIncomingCallsReport;
|
||||
static volatile public String MissedCallsReport = defaultMissedCallsReport;
|
||||
static volatile public String OutgoingCallsReport = defaultOutgoingCallsReport;
|
||||
static volatile public String BytesReceivedReport = defaultBytesReceivedReport;
|
||||
static volatile public String BytesSentReport = defaultBytesSentReport;
|
||||
|
||||
static volatile public String password = defaultPassword;
|
||||
|
||||
// //
|
||||
// MODULES VALUES //
|
||||
// //
|
||||
|
||||
static volatile public float latitude = CONST_INVALID_COORDS;
|
||||
static volatile public float longitude = CONST_INVALID_COORDS;
|
||||
static volatile public int batteryLevel = CONST_INVALID_BATTERY_LEVEL;
|
||||
static volatile public float orientation = CONST_INVALID_ORIENTATION;
|
||||
static volatile public float proximity = CONST_INVALID_PROXIMITY;
|
||||
static volatile public String taskRun = defaultTaskRun;
|
||||
static volatile public long availableRamKb = defaultRam;
|
||||
static volatile public long totalRamKb = defaultRam;
|
||||
static volatile public long upTime = defaultUpTime;
|
||||
static volatile public int helloSignal = defaultHelloSignal;
|
||||
static volatile public int roaming = defaultRoaming;
|
||||
|
||||
|
||||
static volatile public long lastContact = CONST_INVALID_CONTACT;
|
||||
static volatile public int contactError = CONST_CONTACT_ERROR;
|
||||
static volatile public String simID = defaultSimID;
|
||||
|
||||
//hasSim values
|
||||
|
||||
static volatile public int SMSReceived = defaultSMSReceived;
|
||||
static volatile public int SMSSent = defaultSMSSent;
|
||||
static volatile public String networkOperator = defaultNetworkOperator;
|
||||
static volatile public String networkType = defaultNetworkType;
|
||||
static volatile public String phoneType = defaultPhoneType;
|
||||
static volatile public int signalStrength = defaultSignalStrength;
|
||||
static volatile public int incomingCalls = defaultIncomingCalls;
|
||||
static volatile public int missedCalls = defaultMissedCalls;
|
||||
static volatile public int outgoingCalls = defaultOutgoingCalls;
|
||||
static volatile public long receiveBytes = defaultReceiveBytes;
|
||||
static volatile public long transmitBytes = defaultTransmitBytes;
|
||||
|
||||
public Core() {
|
||||
|
||||
}
|
||||
|
||||
static synchronized public void startAgentListener(Context context) {
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
loadConf(con);
|
||||
|
||||
Intent intentReceiver = new Intent(con, EventReceiver.class);
|
||||
|
||||
|
||||
sender = PendingIntent.getBroadcast(con, 0, intentReceiver, 0);
|
||||
|
||||
|
||||
am = (AlarmManager)con.getSystemService(Context.ALARM_SERVICE);
|
||||
|
||||
alarmEnabled = true;
|
||||
am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), (interval * 1000), sender);
|
||||
|
||||
}// end startAgentListener
|
||||
|
||||
static synchronized public void stopAgentListener() {
|
||||
if (am != null){
|
||||
am.cancel(sender);
|
||||
alarmEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
alarmEnabled = true;
|
||||
am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), (interval * 1000), sender);
|
||||
|
||||
}// end startAgentListener
|
||||
|
||||
static synchronized public void stopAgentListener() {
|
||||
if (am != null){
|
||||
am.cancel(sender);
|
||||
alarmEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
static synchronized public void restartAgentListener(Context context) {
|
||||
stopAgentListener();
|
||||
startAgentListener(context);
|
||||
}
|
||||
|
||||
|
||||
static synchronized public void loadLastValues(Context context) {
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
lastContact = agentPreferences.getLong("lastContact", defaultContact);
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
lastContact = agentPreferences.getLong("lastContact", defaultContact);
|
||||
latitude = agentPreferences.getFloat("latitude", CONST_INVALID_COORDS);
|
||||
longitude = agentPreferences.getFloat("longitude", CONST_INVALID_COORDS);
|
||||
batteryLevel = agentPreferences.getInt("batteryLevel", CONST_INVALID_BATTERY_LEVEL);
|
||||
// orientation = agentPreferences.getFloat("orientation", CONST_INVALID_ORIENTATION);
|
||||
// proximity = agentPreferences.getFloat("proximity", CONST_INVALID_PROXIMITY);
|
||||
taskStatus = agentPreferences.getString("taskStatus", defaultTaskStatus);
|
||||
longitude = agentPreferences.getFloat("longitude", CONST_INVALID_COORDS);
|
||||
batteryLevel = agentPreferences.getInt("batteryLevel", CONST_INVALID_BATTERY_LEVEL);
|
||||
// orientation = agentPreferences.getFloat("orientation", CONST_INVALID_ORIENTATION);
|
||||
// proximity = agentPreferences.getFloat("proximity", CONST_INVALID_PROXIMITY);
|
||||
taskStatus = agentPreferences.getString("taskStatus", defaultTaskStatus);
|
||||
task = agentPreferences.getString("task", defaultTask);
|
||||
taskHumanName = agentPreferences.getString("taskHumanName", defaultTaskHumanName);
|
||||
taskRun = agentPreferences.getString("taskRun", defaultTaskRun);
|
||||
|
@ -248,11 +248,11 @@ public class Core {
|
|||
upTime = agentPreferences.getLong("upTime", Core.defaultUpTime);
|
||||
helloSignal = agentPreferences.getInt("helloSignal", defaultHelloSignal);
|
||||
contactError = agentPreferences.getInt("contactError", defaultContactError);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//hasSim values
|
||||
|
||||
|
||||
simID = agentPreferences.getString("simID", defaultSimID);
|
||||
networkOperator = agentPreferences.getString("networkOperator", defaultNetworkOperator);
|
||||
networkType = agentPreferences.getString("networkType", defaultNetworkType);
|
||||
|
@ -266,18 +266,18 @@ public class Core {
|
|||
receiveBytes = agentPreferences.getLong("receiveBytes", defaultReceiveBytes);
|
||||
transmitBytes = agentPreferences.getLong("transmitBytes", defaultTransmitBytes);
|
||||
roaming = agentPreferences.getInt("roaming", defaultRoaming);
|
||||
|
||||
}// end loadLastValues
|
||||
|
||||
static synchronized public void loadConf(Context context) {
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
|
||||
}// end loadLastValues
|
||||
|
||||
static synchronized public void loadConf(Context context) {
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
serverAddr = agentPreferences.getString("serverAddr", defaultServerAddr);
|
||||
serverPort = agentPreferences.getString("serverPort", defaultServerPort);
|
||||
interval = agentPreferences.getInt("interval", defaultInterval);
|
||||
|
@ -290,68 +290,68 @@ public class Core {
|
|||
taskRun = agentPreferences.getString("taskRun", defaultTaskRun);
|
||||
gpsStatus = agentPreferences.getString("gpsStatus", defaultGpsStatus);
|
||||
BatteryLevelReport = agentPreferences.getString("BatteryLevelReport", defaultBatteryLevelReport);
|
||||
memoryStatus = agentPreferences.getString("memoryStatus", defaultMemoryStatus);
|
||||
memoryStatus = agentPreferences.getString("memoryStatus", defaultMemoryStatus);
|
||||
DeviceUpTimeReport = agentPreferences.getString("DeviceUpTimeReport", defaultDeviceUpTimeReport);
|
||||
InventoryReport = agentPreferences.getString("InventoryReport", defaultInventoryReport);
|
||||
HelloSignalReport = agentPreferences.getString("HelloSignalReport", defaultHelloSignalReport);
|
||||
password = agentPreferences.getString("password", defaultPassword);
|
||||
HelloSignalReport = agentPreferences.getString("HelloSignalReport", defaultHelloSignalReport);
|
||||
password = agentPreferences.getString("password", defaultPassword);
|
||||
passwordCheck = agentPreferences.getString("passwordCheck", defaultPasswordCheck);
|
||||
NotificationCheck = agentPreferences.getString("NotificationCheck", defaultNotificationCheck);
|
||||
hasSim = agentPreferences.getBoolean("hasSim", defaultHasSim);
|
||||
//hasSim values
|
||||
|
||||
//hasSim values
|
||||
|
||||
simIDReport = agentPreferences.getString("simIDReport", defaultSimIDReport);
|
||||
NetworkOperatorReport = agentPreferences.getString("NetworkOperatorReport", defaultNetworkOperatorReport);
|
||||
NetworkTypeReport = agentPreferences.getString("NetworkTypeReport", defaultNetworkTypeReport);
|
||||
PhoneTypeReport = agentPreferences.getString("PhoneTypeReport", defaultPhoneTypeReport);
|
||||
SignalStrengthReport = agentPreferences.getString("SignalStrengthReport", defaultSignalStrengthReport);
|
||||
ReceivedSMSReport = agentPreferences.getString("ReceivedSMSReport", defaultReceivedSMSReport);
|
||||
SentSMSReport = agentPreferences.getString("SentSMSReport", defaultSentSMSReport);
|
||||
IncomingCallsReport = agentPreferences.getString("IncomingCallsReport", defaultIncomingCallsReport);
|
||||
MissedCallsReport = agentPreferences.getString("MissedCallsReport", defaultMissedCallsReport);
|
||||
OutgoingCallsReport = agentPreferences.getString("OutgoingCallsReport", defaultOutgoingCallsReport);
|
||||
BytesReceivedReport = agentPreferences.getString("BytesReceivedReport", defaultBytesReceivedReport);
|
||||
BytesSentReport = agentPreferences.getString("BytesSentReport", defaultBytesSentReport);
|
||||
RoamingReport = agentPreferences.getString("RoamingReport", defaultRoamingReport);
|
||||
|
||||
|
||||
|
||||
}// end loadConf
|
||||
|
||||
static synchronized public boolean updateConf(Context context) {
|
||||
return updateConf(context, serverAddr, serverPort, interval, agentName, bufferSize, mobileWebURL,
|
||||
taskStatus, task, taskHumanName, gpsStatus, BatteryLevelReport, memoryStatus, upTime, DeviceUpTimeReport,
|
||||
InventoryReport, helloSignal, HelloSignalReport, password, passwordCheck, hasSim, simID, simIDReport,
|
||||
networkOperator, NetworkOperatorReport, networkType, NetworkTypeReport, phoneType, PhoneTypeReport,
|
||||
signalStrength, SignalStrengthReport, SMSReceived, ReceivedSMSReport, SMSSent, SentSMSReport,
|
||||
incomingCalls, IncomingCallsReport, missedCalls, MissedCallsReport, outgoingCalls, OutgoingCallsReport,
|
||||
receiveBytes, BytesReceivedReport, transmitBytes, BytesSentReport, RoamingReport, roaming,
|
||||
NotificationCheck
|
||||
);
|
||||
|
||||
}// end updateConf
|
||||
|
||||
static synchronized public boolean updateConf(Context context, String _serverAddr,
|
||||
String _serverPort, int _interval, String _agentName, long _bufferSize, String _mobileWebURL,
|
||||
String _taskStatus, String _task, String _taskHumanName, String _gpsStatus, String _BatteryLevelReport,
|
||||
String _memoryStatus, long _upTime, String _DeviceUpTimeReport, String _InventoryReport, int _helloSignal,
|
||||
String _HelloSignalReport, String _password, String _passwordCheck, boolean _hasSim, String _simID, String _simIDReport,
|
||||
String _networkOperator, String _NetworkOperatorReport, String _networkType, String _NetworkTypeReport, String _phoneType,
|
||||
String _PhoneTypeReport, int _signalStrength, String _SignalStrengthReport, int _smsReceived, String _ReceivedSMSReport,
|
||||
int _smsSent, String _SentSMSReport, int _incomingCalls, String _IncomingCallsReport, int _missedCalls, String _MissedCallsReport,
|
||||
int _outgoingCalls, String _OutgoingCallsReport, long _receiveBytes, String _BytesReceivedReport, long _transmitBytes,
|
||||
String _BytesSentReport, String _RoamingReport, int _roaming,
|
||||
String _NotificationCheck ) {
|
||||
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
NetworkTypeReport = agentPreferences.getString("NetworkTypeReport", defaultNetworkTypeReport);
|
||||
PhoneTypeReport = agentPreferences.getString("PhoneTypeReport", defaultPhoneTypeReport);
|
||||
SignalStrengthReport = agentPreferences.getString("SignalStrengthReport", defaultSignalStrengthReport);
|
||||
ReceivedSMSReport = agentPreferences.getString("ReceivedSMSReport", defaultReceivedSMSReport);
|
||||
SentSMSReport = agentPreferences.getString("SentSMSReport", defaultSentSMSReport);
|
||||
IncomingCallsReport = agentPreferences.getString("IncomingCallsReport", defaultIncomingCallsReport);
|
||||
MissedCallsReport = agentPreferences.getString("MissedCallsReport", defaultMissedCallsReport);
|
||||
OutgoingCallsReport = agentPreferences.getString("OutgoingCallsReport", defaultOutgoingCallsReport);
|
||||
BytesReceivedReport = agentPreferences.getString("BytesReceivedReport", defaultBytesReceivedReport);
|
||||
BytesSentReport = agentPreferences.getString("BytesSentReport", defaultBytesSentReport);
|
||||
RoamingReport = agentPreferences.getString("RoamingReport", defaultRoamingReport);
|
||||
|
||||
|
||||
|
||||
}// end loadConf
|
||||
|
||||
static synchronized public boolean updateConf(Context context) {
|
||||
return updateConf(context, serverAddr, serverPort, interval, agentName, bufferSize, mobileWebURL,
|
||||
taskStatus, task, taskHumanName, gpsStatus, BatteryLevelReport, memoryStatus, upTime, DeviceUpTimeReport,
|
||||
InventoryReport, helloSignal, HelloSignalReport, password, passwordCheck, hasSim, simID, simIDReport,
|
||||
networkOperator, NetworkOperatorReport, networkType, NetworkTypeReport, phoneType, PhoneTypeReport,
|
||||
signalStrength, SignalStrengthReport, SMSReceived, ReceivedSMSReport, SMSSent, SentSMSReport,
|
||||
incomingCalls, IncomingCallsReport, missedCalls, MissedCallsReport, outgoingCalls, OutgoingCallsReport,
|
||||
receiveBytes, BytesReceivedReport, transmitBytes, BytesSentReport, RoamingReport, roaming,
|
||||
NotificationCheck
|
||||
);
|
||||
|
||||
}// end updateConf
|
||||
|
||||
static synchronized public boolean updateConf(Context context, String _serverAddr,
|
||||
String _serverPort, int _interval, String _agentName, long _bufferSize, String _mobileWebURL,
|
||||
String _taskStatus, String _task, String _taskHumanName, String _gpsStatus, String _BatteryLevelReport,
|
||||
String _memoryStatus, long _upTime, String _DeviceUpTimeReport, String _InventoryReport, int _helloSignal,
|
||||
String _HelloSignalReport, String _password, String _passwordCheck, boolean _hasSim, String _simID, String _simIDReport,
|
||||
String _networkOperator, String _NetworkOperatorReport, String _networkType, String _NetworkTypeReport, String _phoneType,
|
||||
String _PhoneTypeReport, int _signalStrength, String _SignalStrengthReport, int _smsReceived, String _ReceivedSMSReport,
|
||||
int _smsSent, String _SentSMSReport, int _incomingCalls, String _IncomingCallsReport, int _missedCalls, String _MissedCallsReport,
|
||||
int _outgoingCalls, String _OutgoingCallsReport, long _receiveBytes, String _BytesReceivedReport, long _transmitBytes,
|
||||
String _BytesSentReport, String _RoamingReport, int _roaming,
|
||||
String _NotificationCheck ) {
|
||||
|
||||
if (con == null) {
|
||||
con = context;
|
||||
}
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = agentPreferences.edit();
|
||||
|
||||
|
||||
editor.putString("serverAddr", _serverAddr);
|
||||
editor.putString("serverPort", _serverPort);
|
||||
editor.putInt("interval", _interval);
|
||||
|
@ -372,7 +372,7 @@ public class Core {
|
|||
editor.putString("password", _password);
|
||||
editor.putString("passwordCheck", _passwordCheck);
|
||||
editor.putBoolean("hasSim", _hasSim);
|
||||
|
||||
|
||||
//hasSim values
|
||||
editor.putString("simID", _simID);
|
||||
editor.putString("simIDReport", _simIDReport);
|
||||
|
@ -401,23 +401,23 @@ public class Core {
|
|||
editor.putString("RoamingReport", _RoamingReport);
|
||||
editor.putInt("roaming", _roaming);
|
||||
editor.putString("NotificationCheck", _NotificationCheck);
|
||||
|
||||
|
||||
|
||||
|
||||
if (editor.commit()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}// end updateConf
|
||||
|
||||
|
||||
public synchronized static void putSharedData(String preferenceName, String tokenName, String data, String type) {
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
|
||||
public synchronized static void putSharedData(String preferenceName, String tokenName, String data, String type) {
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = agentPreferences.edit();
|
||||
|
||||
|
||||
|
||||
|
||||
if(type == "boolean") {
|
||||
editor.putBoolean(tokenName, Boolean.parseBoolean(data));
|
||||
}
|
||||
|
@ -433,16 +433,16 @@ public class Core {
|
|||
else if(type == "string") {
|
||||
editor.putString(tokenName, data);
|
||||
}
|
||||
|
||||
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
public synchronized static String getSharedData(String preferenceName, String tokenName, String defaultValue, String type) {
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
}
|
||||
|
||||
public synchronized static String getSharedData(String preferenceName, String tokenName, String defaultValue, String type) {
|
||||
|
||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
||||
con.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
if(type == "boolean") {
|
||||
boolean a = agentPreferences.getBoolean(tokenName, Boolean.parseBoolean(defaultValue));
|
||||
return Boolean.valueOf(a).toString();
|
||||
|
@ -462,8 +462,8 @@ public class Core {
|
|||
else if(type == "string") {
|
||||
return agentPreferences.getString(tokenName, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ import android.content.Intent;
|
|||
|
||||
public class EventReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
context.startService(new Intent(context, PandroidAgentListener.class));
|
||||
}
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
context.startService(new Intent(context, PandroidAgentListener.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -22,13 +22,13 @@ import android.widget.TextView;
|
|||
|
||||
public class Help extends Activity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.help);
|
||||
|
||||
TextView text = (TextView) findViewById(R.id.help_text);
|
||||
text.setText(Html.fromHtml(getString(R.string.help_text_str)));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.help);
|
||||
|
||||
TextView text = (TextView) findViewById(R.id.help_text);
|
||||
text.setText(Html.fromHtml(getString(R.string.help_text_str)));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,35 +28,35 @@ import android.content.Context;
|
|||
*/
|
||||
|
||||
public class Installation {
|
||||
private static String sID = null;
|
||||
private static final String INSTALLATION = "INSTALLATION";
|
||||
private static String sID = null;
|
||||
private static final String INSTALLATION = "INSTALLATION";
|
||||
|
||||
public synchronized static String id(Context context) {
|
||||
if (sID == null) {
|
||||
File installation = new File(context.getFilesDir(), INSTALLATION);
|
||||
try {
|
||||
if (!installation.exists())
|
||||
writeInstallationFile(installation);
|
||||
sID = readInstallationFile(installation);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return sID;
|
||||
}
|
||||
public synchronized static String id(Context context) {
|
||||
if (sID == null) {
|
||||
File installation = new File(context.getFilesDir(), INSTALLATION);
|
||||
try {
|
||||
if (!installation.exists())
|
||||
writeInstallationFile(installation);
|
||||
sID = readInstallationFile(installation);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return sID;
|
||||
}
|
||||
|
||||
private static String readInstallationFile(File installation) throws IOException {
|
||||
RandomAccessFile f = new RandomAccessFile(installation, "r");
|
||||
byte[] bytes = new byte[(int) f.length()];
|
||||
f.readFully(bytes);
|
||||
f.close();
|
||||
return new String(bytes);
|
||||
}
|
||||
private static String readInstallationFile(File installation) throws IOException {
|
||||
RandomAccessFile f = new RandomAccessFile(installation, "r");
|
||||
byte[] bytes = new byte[(int) f.length()];
|
||||
f.readFully(bytes);
|
||||
f.close();
|
||||
return new String(bytes);
|
||||
}
|
||||
|
||||
private static void writeInstallationFile(File installation) throws IOException {
|
||||
FileOutputStream out = new FileOutputStream(installation);
|
||||
String id = UUID.randomUUID().toString();
|
||||
out.write(id.getBytes());
|
||||
out.close();
|
||||
}
|
||||
private static void writeInstallationFile(File installation) throws IOException {
|
||||
FileOutputStream out = new FileOutputStream(installation);
|
||||
String id = UUID.randomUUID().toString();
|
||||
out.write(id.getBytes());
|
||||
out.close();
|
||||
}
|
||||
}
|
|
@ -29,26 +29,26 @@ import android.widget.TabHost;
|
|||
|
||||
|
||||
public class PandroidAgent extends TabActivity {
|
||||
|
||||
|
||||
Handler h = new Handler();
|
||||
int defaultInterval = 300;
|
||||
TabHost tabHost;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
/*
|
||||
int defaultInterval = 300;
|
||||
TabHost tabHost;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
/*
|
||||
final Dialog dialog = new Dialog(this,android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
||||
dialog.setContentView(R.layout.welcome);
|
||||
dialog.setCancelable(false);
|
||||
dialog.getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN, LayoutParams.FLAG_FULLSCREEN);
|
||||
|
||||
|
||||
|
||||
|
||||
dialog.show();
|
||||
|
||||
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
|
@ -56,74 +56,74 @@ public class PandroidAgent extends TabActivity {
|
|||
dialog.dismiss();
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
*/
|
||||
|
||||
//Requires The agent name to use installation id
|
||||
File installation = new File(getApplicationContext().getFilesDir(), "INSTALLATION");
|
||||
if(!installation.exists()){
|
||||
Core.restartAgentListener(getApplicationContext());
|
||||
}
|
||||
else{
|
||||
//Core.stopAgentListener();
|
||||
Core.loadConf(this);
|
||||
Core.alarmEnabled = true;
|
||||
//new Intent(this, EventReceiver.class);
|
||||
}
|
||||
|
||||
//Check whether device has a sim card, phone without a sim card present
|
||||
//return SIM_STATE_ABSENT but tablets only return SIM_STATE_UNKNOWN
|
||||
String serviceName = Context.TELEPHONY_SERVICE;
|
||||
|
||||
*/
|
||||
|
||||
//Requires The agent name to use installation id
|
||||
File installation = new File(getApplicationContext().getFilesDir(), "INSTALLATION");
|
||||
if(!installation.exists()){
|
||||
Core.restartAgentListener(getApplicationContext());
|
||||
}
|
||||
else{
|
||||
//Core.stopAgentListener();
|
||||
Core.loadConf(this);
|
||||
Core.alarmEnabled = true;
|
||||
//new Intent(this, EventReceiver.class);
|
||||
}
|
||||
|
||||
//Check whether device has a sim card, phone without a sim card present
|
||||
//return SIM_STATE_ABSENT but tablets only return SIM_STATE_UNKNOWN
|
||||
String serviceName = Context.TELEPHONY_SERVICE;
|
||||
TelephonyManager telephonyManager = (TelephonyManager) getApplicationContext().getSystemService(serviceName);
|
||||
String hasSim = ""+(telephonyManager.getSimState() != TelephonyManager.SIM_STATE_UNKNOWN);
|
||||
if(hasSim.equals("true"))
|
||||
hasSim = ""+(telephonyManager.getSimState() != TelephonyManager.SIM_STATE_ABSENT);
|
||||
Core.hasSim = Boolean.parseBoolean(hasSim);
|
||||
|
||||
|
||||
|
||||
|
||||
//Create layout with 2 tabs
|
||||
tabHost = getTabHost();
|
||||
|
||||
tabHost.addTab
|
||||
|
||||
tabHost.addTab
|
||||
(
|
||||
tabHost.newTabSpec("Status")
|
||||
.setIndicator(getString(R.string.status_str))
|
||||
.setContent(new Intent(this, Status.class))
|
||||
);
|
||||
|
||||
tabHost.addTab
|
||||
tabHost.newTabSpec("Status")
|
||||
.setIndicator(getString(R.string.status_str))
|
||||
.setContent(new Intent(this, Status.class))
|
||||
);
|
||||
|
||||
tabHost.addTab
|
||||
(
|
||||
tabHost.newTabSpec("Setup")
|
||||
.setIndicator(getString(R.string.setup_str))
|
||||
.setContent(new Intent(this, Setup.class))
|
||||
);
|
||||
}
|
||||
|
||||
public void onPause(){
|
||||
super.onPause();
|
||||
Core.updateConf(getApplicationContext());
|
||||
//Core.updateDatabase(this);
|
||||
}
|
||||
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
Core.updateConf(getApplicationContext());
|
||||
//Core.updateDatabase(this);
|
||||
|
||||
}
|
||||
|
||||
//Sets hello signal to 1(first connect since pandroid was closed)
|
||||
public void onResume(){
|
||||
super.onResume();
|
||||
|
||||
if(Core.helloSignal == 0)
|
||||
Core.helloSignal = 1;
|
||||
Core.updateConf(getApplicationContext());
|
||||
}
|
||||
|
||||
// Called from activity to allow tab switching
|
||||
public void switchTab(int tab){
|
||||
tabHost.setCurrentTab(tab);
|
||||
}
|
||||
|
||||
tabHost.newTabSpec("Setup")
|
||||
.setIndicator(getString(R.string.setup_str))
|
||||
.setContent(new Intent(this, Setup.class))
|
||||
);
|
||||
}
|
||||
|
||||
public void onPause(){
|
||||
super.onPause();
|
||||
Core.updateConf(getApplicationContext());
|
||||
//Core.updateDatabase(this);
|
||||
}
|
||||
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
Core.updateConf(getApplicationContext());
|
||||
//Core.updateDatabase(this);
|
||||
|
||||
}
|
||||
|
||||
//Sets hello signal to 1(first connect since pandroid was closed)
|
||||
public void onResume(){
|
||||
super.onResume();
|
||||
|
||||
if(Core.helloSignal == 0)
|
||||
Core.helloSignal = 1;
|
||||
Core.updateConf(getApplicationContext());
|
||||
}
|
||||
|
||||
// Called from activity to allow tab switching
|
||||
public void switchTab(int tab){
|
||||
tabHost.setCurrentTab(tab);
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -29,174 +29,174 @@ import android.util.Log;
|
|||
class tentacle_client {
|
||||
|
||||
// Return 0 when success, -1 when error
|
||||
public int tentacle_client(String args[]) {
|
||||
|
||||
int port = 41121;
|
||||
String send = null;
|
||||
String serverResponse = null;
|
||||
String address = "127.0.0.1";
|
||||
String data = "";
|
||||
String parameter = "";
|
||||
String filePath = null;
|
||||
boolean verbose = false;
|
||||
File file = new File("");
|
||||
|
||||
for (int i=0;i<args.length;i++) {
|
||||
if(i == (args.length - 1)) {
|
||||
filePath = args[i];
|
||||
} else {
|
||||
// Get the param if is -* format or empty string otherwise
|
||||
String last_parameter = parameter;
|
||||
parameter = isParameter(args[i]);
|
||||
public int tentacle_client(String args[]) {
|
||||
|
||||
// If is not -* param check the previous param
|
||||
if(parameter.equals("")) {
|
||||
if(last_parameter.equals("-a")) {
|
||||
address = args[i];
|
||||
}
|
||||
else if(last_parameter.equals("-p")) {
|
||||
port = Integer.parseInt(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// The solo params are checked otherwise
|
||||
if(parameter.equals("-v")) {
|
||||
verbose = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
int port = 41121;
|
||||
String send = null;
|
||||
String serverResponse = null;
|
||||
String address = "127.0.0.1";
|
||||
String data = "";
|
||||
String parameter = "";
|
||||
String filePath = null;
|
||||
boolean verbose = false;
|
||||
File file = new File("");
|
||||
|
||||
if(filePath == null) {
|
||||
getError("Incorrect parameters. File path is necessary.");
|
||||
}
|
||||
|
||||
getInfo("\n*** Starting tentacle client ***\n",verbose);
|
||||
|
||||
Socket socketCliente = new Socket();
|
||||
|
||||
// TODO Maybe change socket to higher timeout value
|
||||
|
||||
try {
|
||||
socketCliente.connect(new InetSocketAddress(address, port), 2000);
|
||||
|
||||
} catch (UnknownHostException e) {
|
||||
getError("Host don't exists");
|
||||
return -1;
|
||||
} catch (IOException e) {
|
||||
getError("Could not connect: The host is down");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int i=0;i<args.length;i++) {
|
||||
if(i == (args.length - 1)) {
|
||||
filePath = args[i];
|
||||
} else {
|
||||
// Get the param if is -* format or empty string otherwise
|
||||
String last_parameter = parameter;
|
||||
parameter = isParameter(args[i]);
|
||||
|
||||
DataOutputStream serverOutput = null;
|
||||
|
||||
try {
|
||||
serverOutput = new DataOutputStream(socketCliente.getOutputStream());
|
||||
} catch (IOException e1) {
|
||||
getError("Could not get Data output stream");
|
||||
}
|
||||
|
||||
BufferedReader serverInput = null;
|
||||
|
||||
try {
|
||||
serverInput = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));
|
||||
} catch (IOException e1) {
|
||||
getError("Could not get Buffered reader");
|
||||
}
|
||||
|
||||
try {
|
||||
file = new File (filePath);
|
||||
FileReader fr = new FileReader (file);
|
||||
BufferedReader br = new BufferedReader(fr);
|
||||
// If is not -* param check the previous param
|
||||
if(parameter.equals("")) {
|
||||
if(last_parameter.equals("-a")) {
|
||||
address = args[i];
|
||||
}
|
||||
else if(last_parameter.equals("-p")) {
|
||||
port = Integer.parseInt(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
getInfo("Reading the file '" + file.getName() + "' content...\n", verbose);
|
||||
// Reading the file
|
||||
String line;
|
||||
while((line=br.readLine())!=null)
|
||||
data += line + '\n';
|
||||
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
getError("Could not get the file");
|
||||
}
|
||||
|
||||
getInfo("*** Start of transference ***\n",verbose);
|
||||
// Send the file name and length
|
||||
try {
|
||||
send = "SEND <" + file.getName() + "> SIZE " + Integer.toString(data.length()) + '\n';
|
||||
getInfo("Client -> Server: " + send, verbose);
|
||||
serverOutput.writeBytes(send);
|
||||
} catch (IOException e) {
|
||||
getError("Could not write on server");
|
||||
}
|
||||
try {
|
||||
serverResponse = serverInput.readLine();
|
||||
} catch (IOException e) {
|
||||
getError("Could not get server response");
|
||||
}
|
||||
|
||||
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
||||
if (serverResponse != null && serverResponse.equals("SEND OK")) {
|
||||
try {
|
||||
getInfo("Client -> Server: [file data]\n", verbose);
|
||||
serverOutput.writeBytes(data);
|
||||
|
||||
} catch (IOException e) {
|
||||
getError("Could not write on server");
|
||||
}
|
||||
try {
|
||||
serverResponse = serverInput.readLine();
|
||||
} catch (IOException e) {
|
||||
getError("Could not get server response");
|
||||
}
|
||||
|
||||
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
||||
if (serverResponse != null && serverResponse.equals("SEND OK")) {
|
||||
try {
|
||||
send = "QUIT\n";
|
||||
getInfo("Client -> Server: " + send, verbose);
|
||||
serverOutput.writeBytes("QUIT\n");
|
||||
} catch (IOException e) {
|
||||
getError("Could not write on server");
|
||||
}
|
||||
getInfo("*** End of transference ***\n", verbose);
|
||||
}
|
||||
else {
|
||||
getError("Bad server response, execution aborted.\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
getError("Bad server response, execution aborted.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private String isParameter(String str) {
|
||||
if(str.equals("-a") || str.equals("-p") || str.equals("-v")) {
|
||||
return str;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private void getError(String error_str) {
|
||||
log("[ERROR] " + error_str + '\n');
|
||||
}
|
||||
|
||||
private void getInfo(String error_str, boolean verbose) {
|
||||
if(verbose) {
|
||||
log("[INFO] " + error_str + '\n');
|
||||
}
|
||||
}
|
||||
|
||||
private void log (String msg) {
|
||||
//Log.e("Tentacle",msg);
|
||||
//Context context = getApplicationContext();
|
||||
//int duration = Toast.LENGTH_SHORT;
|
||||
// The solo params are checked otherwise
|
||||
if(parameter.equals("-v")) {
|
||||
verbose = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Toast toast = Toast.makeText(context, msg, duration);
|
||||
//toast.show();
|
||||
}
|
||||
if(filePath == null) {
|
||||
getError("Incorrect parameters. File path is necessary.");
|
||||
}
|
||||
|
||||
getInfo("\n*** Starting tentacle client ***\n",verbose);
|
||||
|
||||
Socket socketCliente = new Socket();
|
||||
|
||||
// TODO Maybe change socket to higher timeout value
|
||||
|
||||
try {
|
||||
socketCliente.connect(new InetSocketAddress(address, port), 2000);
|
||||
|
||||
} catch (UnknownHostException e) {
|
||||
getError("Host don't exists");
|
||||
return -1;
|
||||
} catch (IOException e) {
|
||||
getError("Could not connect: The host is down");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
DataOutputStream serverOutput = null;
|
||||
|
||||
try {
|
||||
serverOutput = new DataOutputStream(socketCliente.getOutputStream());
|
||||
} catch (IOException e1) {
|
||||
getError("Could not get Data output stream");
|
||||
}
|
||||
|
||||
BufferedReader serverInput = null;
|
||||
|
||||
try {
|
||||
serverInput = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));
|
||||
} catch (IOException e1) {
|
||||
getError("Could not get Buffered reader");
|
||||
}
|
||||
|
||||
try {
|
||||
file = new File (filePath);
|
||||
FileReader fr = new FileReader (file);
|
||||
BufferedReader br = new BufferedReader(fr);
|
||||
|
||||
getInfo("Reading the file '" + file.getName() + "' content...\n", verbose);
|
||||
// Reading the file
|
||||
String line;
|
||||
while((line=br.readLine())!=null)
|
||||
data += line + '\n';
|
||||
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
getError("Could not get the file");
|
||||
}
|
||||
|
||||
getInfo("*** Start of transference ***\n",verbose);
|
||||
// Send the file name and length
|
||||
try {
|
||||
send = "SEND <" + file.getName() + "> SIZE " + Integer.toString(data.length()) + '\n';
|
||||
getInfo("Client -> Server: " + send, verbose);
|
||||
serverOutput.writeBytes(send);
|
||||
} catch (IOException e) {
|
||||
getError("Could not write on server");
|
||||
}
|
||||
try {
|
||||
serverResponse = serverInput.readLine();
|
||||
} catch (IOException e) {
|
||||
getError("Could not get server response");
|
||||
}
|
||||
|
||||
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
||||
if (serverResponse != null && serverResponse.equals("SEND OK")) {
|
||||
try {
|
||||
getInfo("Client -> Server: [file data]\n", verbose);
|
||||
serverOutput.writeBytes(data);
|
||||
|
||||
} catch (IOException e) {
|
||||
getError("Could not write on server");
|
||||
}
|
||||
try {
|
||||
serverResponse = serverInput.readLine();
|
||||
} catch (IOException e) {
|
||||
getError("Could not get server response");
|
||||
}
|
||||
|
||||
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
||||
if (serverResponse != null && serverResponse.equals("SEND OK")) {
|
||||
try {
|
||||
send = "QUIT\n";
|
||||
getInfo("Client -> Server: " + send, verbose);
|
||||
serverOutput.writeBytes("QUIT\n");
|
||||
} catch (IOException e) {
|
||||
getError("Could not write on server");
|
||||
}
|
||||
getInfo("*** End of transference ***\n", verbose);
|
||||
}
|
||||
else {
|
||||
getError("Bad server response, execution aborted.\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
getError("Bad server response, execution aborted.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private String isParameter(String str) {
|
||||
if(str.equals("-a") || str.equals("-p") || str.equals("-v")) {
|
||||
return str;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private void getError(String error_str) {
|
||||
log("[ERROR] " + error_str + '\n');
|
||||
}
|
||||
|
||||
private void getInfo(String error_str, boolean verbose) {
|
||||
if(verbose) {
|
||||
log("[INFO] " + error_str + '\n');
|
||||
}
|
||||
}
|
||||
|
||||
private void log (String msg) {
|
||||
//Log.e("Tentacle",msg);
|
||||
//Context context = getApplicationContext();
|
||||
//int duration = Toast.LENGTH_SHORT;
|
||||
|
||||
//Toast toast = Toast.makeText(context, msg, duration);
|
||||
//toast.show();
|
||||
}
|
||||
}
|
|
@ -22,31 +22,31 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
public class SMSBroadcastReceiver extends BroadcastReceiver {
|
||||
public class SMSBroadcastReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
|
||||
private static final String TAG = "SMSBroadcastReceiver";
|
||||
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
|
||||
private static final String TAG = "SMSBroadcastReceiver";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.i(TAG, "Intent recieved: " + intent.getAction());
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.i(TAG, "Intent recieved: " + intent.getAction());
|
||||
|
||||
if (intent.getAction().equals(SMS_RECEIVED)) {
|
||||
|
||||
int defaultSMSReceived = 0;
|
||||
int mode = Activity.MODE_PRIVATE;
|
||||
|
||||
SharedPreferences pref = context.getSharedPreferences("PANDROID_DATA", mode);
|
||||
int sms = pref.getInt("SMSReceived", defaultSMSReceived);
|
||||
|
||||
sms++;
|
||||
|
||||
SharedPreferences.Editor editor = pref.edit();
|
||||
editor.putInt("SMSReceived", sms);
|
||||
editor.commit();
|
||||
|
||||
}//end if
|
||||
|
||||
}//end onRecieve
|
||||
if (intent.getAction().equals(SMS_RECEIVED)) {
|
||||
|
||||
int defaultSMSReceived = 0;
|
||||
int mode = Activity.MODE_PRIVATE;
|
||||
|
||||
SharedPreferences pref = context.getSharedPreferences("PANDROID_DATA", mode);
|
||||
int sms = pref.getInt("SMSReceived", defaultSMSReceived);
|
||||
|
||||
sms++;
|
||||
|
||||
SharedPreferences.Editor editor = pref.edit();
|
||||
editor.putInt("SMSReceived", sms);
|
||||
editor.commit();
|
||||
|
||||
}//end if
|
||||
|
||||
}//end onRecieve
|
||||
}//end class
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,10 +6,10 @@ import android.content.Intent;
|
|||
|
||||
public class StartMyServiceAtBootReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
|
||||
//Core.restartAgentListener(context);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
|
||||
//Core.restartAgentListener(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.Date;
|
|||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Menu;
|
||||
|
@ -29,139 +30,154 @@ import android.widget.TextView;
|
|||
|
||||
public class Status extends Activity {
|
||||
Handler h = new Handler();
|
||||
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if(Core.hasSim)
|
||||
setContentView(R.layout.status);
|
||||
else
|
||||
setContentView(R.layout.statusnosim);
|
||||
|
||||
// Core.loadLastValues(getApplicationContext());
|
||||
// showLastValues();
|
||||
// updateLastContactInfo();
|
||||
//setButtonEvents();
|
||||
}
|
||||
//TODO maybe remove duplicate from onCreate
|
||||
@Override
|
||||
public void onResume(){
|
||||
super.onResume();
|
||||
|
||||
if(Core.hasSim)
|
||||
setContentView(R.layout.status);
|
||||
else
|
||||
setContentView(R.layout.statusnosim);
|
||||
|
||||
Core.loadLastValues(getApplicationContext());
|
||||
|
||||
showLastValues();
|
||||
|
||||
updateLastContactInfo();
|
||||
|
||||
}
|
||||
|
||||
public void onStart(){
|
||||
super.onStart();
|
||||
|
||||
// Update the UI each second
|
||||
h.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Core.loadLastValues(getApplicationContext());
|
||||
|
||||
showLastValues();
|
||||
|
||||
updateLastContactInfo();
|
||||
|
||||
h.postDelayed(this, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//For options
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.options_menu, menu);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
Intent i;
|
||||
switch (item.getItemId()) {
|
||||
case R.id.help_button_menu_options:
|
||||
i = new Intent(this, Help.class);
|
||||
startActivity(i);
|
||||
break;
|
||||
case R.id.about_button_menu_options:
|
||||
i = new Intent(this, About.class);
|
||||
startActivity(i);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void updateLastContactInfo() {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if(Core.hasSim)
|
||||
setContentView(R.layout.status);
|
||||
else
|
||||
setContentView(R.layout.statusnosim);
|
||||
|
||||
// Core.loadLastValues(getApplicationContext());
|
||||
// showLastValues();
|
||||
// updateLastContactInfo();
|
||||
//setButtonEvents();
|
||||
}
|
||||
//TODO maybe remove duplicate from onCreate
|
||||
@Override
|
||||
public void onResume(){
|
||||
super.onResume();
|
||||
|
||||
if(Core.hasSim)
|
||||
setContentView(R.layout.status);
|
||||
else
|
||||
setContentView(R.layout.statusnosim);
|
||||
|
||||
new GetLastValuesAsyncTask().execute();
|
||||
|
||||
updateLastContactInfo();
|
||||
|
||||
}
|
||||
|
||||
public void onStart(){
|
||||
super.onStart();
|
||||
|
||||
// Update the UI each second
|
||||
h.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
new GetLastValuesAsyncTask().execute();
|
||||
|
||||
updateLastContactInfo();
|
||||
|
||||
h.postDelayed(this, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//For options
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.options_menu, menu);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
Intent i;
|
||||
switch (item.getItemId()) {
|
||||
case R.id.help_button_menu_options:
|
||||
i = new Intent(this, Help.class);
|
||||
startActivity(i);
|
||||
break;
|
||||
case R.id.about_button_menu_options:
|
||||
i = new Intent(this, About.class);
|
||||
startActivity(i);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public class GetLastValuesAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
Core.loadLastValues(getApplicationContext());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void unused)
|
||||
{
|
||||
showLastValues();
|
||||
}
|
||||
|
||||
|
||||
}// end onPostExecute
|
||||
|
||||
|
||||
|
||||
private void updateLastContactInfo() {
|
||||
long lastContact = Core.lastContact;
|
||||
int contactError = Core.contactError;
|
||||
boolean alarmEnabled = Core.alarmEnabled;
|
||||
Date date = new Date();
|
||||
long timestamp = date.getTime() / 1000;
|
||||
long timeAgo = -1;
|
||||
|
||||
//loading until error or connects
|
||||
TextView lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
long timestamp = date.getTime() / 1000;
|
||||
long timeAgo = -1;
|
||||
|
||||
//loading until error or connects
|
||||
TextView lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#FF0000"));
|
||||
lastContactInfo.setText(getString(R.string.loading));
|
||||
|
||||
if(lastContact != -1){
|
||||
timeAgo = timestamp - lastContact;
|
||||
}
|
||||
|
||||
|
||||
if(lastContact != -1){
|
||||
timeAgo = timestamp - lastContact;
|
||||
}
|
||||
|
||||
int interval = Core.interval;
|
||||
|
||||
if(timeAgo >= interval) {
|
||||
timeAgo = 0;
|
||||
}
|
||||
|
||||
String stringAgo = "";
|
||||
|
||||
if(!alarmEnabled){
|
||||
lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#FF0000"));
|
||||
lastContactInfo.setText(getString(R.string.contact_stopped_str));
|
||||
}
|
||||
|
||||
else if(contactError == 1) {
|
||||
lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#FF0000"));
|
||||
lastContactInfo.setText(getString(R.string.conctact_error_str));
|
||||
|
||||
}
|
||||
else if(lastContact == -1) {
|
||||
stringAgo = getString(R.string.never_str);
|
||||
}
|
||||
else if(timeAgo == 0) {
|
||||
stringAgo = getString(R.string.now_str);
|
||||
}
|
||||
//TODO
|
||||
else if(contactError == 0) {
|
||||
stringAgo = timeAgo + " " + getString(R.string.seconds_str);
|
||||
lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#00FF00"));
|
||||
lastContactInfo.setText(getString(R.string.last_contact_str) + stringAgo);
|
||||
}
|
||||
|
||||
}//end updateLastContactInfo
|
||||
|
||||
if(timeAgo >= interval) {
|
||||
timeAgo = 0;
|
||||
}
|
||||
|
||||
String stringAgo = "";
|
||||
|
||||
if(!alarmEnabled){
|
||||
lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#FF0000"));
|
||||
lastContactInfo.setText(getString(R.string.contact_stopped_str));
|
||||
}
|
||||
|
||||
else if(contactError == 1) {
|
||||
lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#FF0000"));
|
||||
lastContactInfo.setText(getString(R.string.conctact_error_str));
|
||||
|
||||
}
|
||||
else if(lastContact == -1) {
|
||||
stringAgo = getString(R.string.never_str);
|
||||
}
|
||||
else if(timeAgo == 0) {
|
||||
stringAgo = getString(R.string.now_str);
|
||||
}
|
||||
//TODO
|
||||
else if(contactError == 0) {
|
||||
stringAgo = timeAgo + " " + getString(R.string.seconds_str);
|
||||
lastContactInfo = (TextView) this.findViewById(R.id.lastContactInfo_label_str);
|
||||
lastContactInfo.setTextColor(Color.parseColor("#00FF00"));
|
||||
lastContactInfo.setText(getString(R.string.last_contact_str) + stringAgo);
|
||||
}
|
||||
|
||||
}//end updateLastContactInfo
|
||||
|
||||
//Set layout values to current
|
||||
private void showLastValues() {
|
||||
|
||||
private void showLastValues() {
|
||||
|
||||
// latitude
|
||||
TextView textView = (TextView)findViewById(R.id.latitude_value_str);
|
||||
textView.setText("");
|
||||
|
@ -180,23 +196,23 @@ public class Status extends Activity {
|
|||
if (Core.batteryLevel != Core.CONST_INVALID_BATTERY_LEVEL) {
|
||||
textView.setText("" + Core.batteryLevel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
textView = (TextView)findViewById(R.id.orientation_value_str);
|
||||
textView.setText("");
|
||||
|
||||
|
||||
if (Core.orientation != Core.CONST_INVALID_ORIENTATION) {
|
||||
textView.setText("" + Core.orientation);
|
||||
}
|
||||
|
||||
|
||||
textView = (TextView)findViewById(R.id.proximity_value_str);
|
||||
textView.setText("");
|
||||
if (Core.proximity != Core.CONST_INVALID_PROXIMITY) {
|
||||
textView.setText("" + Core.proximity);
|
||||
}
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
// task
|
||||
textView = (TextView)findViewById(R.id.task_value_str);
|
||||
textView.setText("");
|
||||
|
@ -210,7 +226,7 @@ public class Status extends Activity {
|
|||
}
|
||||
textView.setText(text);
|
||||
}
|
||||
|
||||
|
||||
// freeMemory
|
||||
textView = (TextView)findViewById(R.id.memory_value_str);
|
||||
textView.setText("");
|
||||
|
@ -226,7 +242,7 @@ public class Status extends Activity {
|
|||
if (Core.upTime != 0) {
|
||||
textView.setText("" + Core.upTime+" "+ getString(R.string.seconds));
|
||||
}
|
||||
|
||||
|
||||
//Only set values if sim present
|
||||
//if no sim these views aren't present as different layout is loaded
|
||||
if (Core.hasSim) {
|
||||
|
@ -234,48 +250,48 @@ public class Status extends Activity {
|
|||
textView = (TextView)findViewById(R.id.sim_id_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.simID);
|
||||
|
||||
|
||||
// networkOperator
|
||||
textView = (TextView)findViewById(R.id.network_operator_value);
|
||||
textView.setText("");
|
||||
if (Core.networkOperator != null) {
|
||||
textView.setText("" + Core.networkOperator);
|
||||
}
|
||||
|
||||
|
||||
// networkType
|
||||
textView = (TextView)findViewById(R.id.network_type_value);
|
||||
textView.setText("");
|
||||
if (Core.networkType != null) {
|
||||
textView.setText("" + Core.networkType);
|
||||
}
|
||||
|
||||
|
||||
// phoneType
|
||||
textView = (TextView)findViewById(R.id.phone_type_value);
|
||||
textView.setText("");
|
||||
if(Core.phoneType != null)
|
||||
textView.setText("" + Core.phoneType);
|
||||
|
||||
|
||||
// signalStrength
|
||||
textView = (TextView)findViewById(R.id.signal_strength_value);
|
||||
textView.setText("");
|
||||
if(Core.signalStrength != 0)
|
||||
textView.setText("" + Core.signalStrength+"dB");
|
||||
|
||||
|
||||
// SMSReceived
|
||||
textView = (TextView)findViewById(R.id.sms_received_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.SMSReceived);
|
||||
|
||||
|
||||
// SMSSent
|
||||
textView = (TextView)findViewById(R.id.sms_sent_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.SMSSent);
|
||||
|
||||
|
||||
// incomingCalls
|
||||
textView = (TextView)findViewById(R.id.incoming_calls_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.incomingCalls);
|
||||
|
||||
|
||||
// missedCalls
|
||||
textView = (TextView)findViewById(R.id.missed_calls_value);
|
||||
textView.setText("");
|
||||
|
@ -285,28 +301,28 @@ public class Status extends Activity {
|
|||
textView = (TextView)findViewById(R.id.outgoing_calls_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.outgoingCalls);
|
||||
|
||||
|
||||
// receiveBytes
|
||||
textView = (TextView)findViewById(R.id.receive_bytes_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.receiveBytes);
|
||||
|
||||
|
||||
// transmiteBytes
|
||||
textView = (TextView)findViewById(R.id.transmit_bytes_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.transmitBytes);
|
||||
|
||||
|
||||
// roaming
|
||||
textView = (TextView)findViewById(R.id.roaming_value);
|
||||
textView.setText("");
|
||||
textView.setText("" + Core.roaming);
|
||||
|
||||
|
||||
}//end simID if
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//For debugging
|
||||
|
||||
|
||||
/* For debugging
|
||||
private void setButtonEvents() {
|
||||
// Set update button events
|
||||
|
@ -314,49 +330,49 @@ public class Status extends Activity {
|
|||
Button xml = (Button) findViewById(R.id.get_xml);
|
||||
Button hidexml = (Button) findViewById(R.id.hide_xml);
|
||||
Button stop = (Button) findViewById(R.id.stop);
|
||||
|
||||
|
||||
|
||||
|
||||
xml.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
updateLastXML();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
hidexml.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
hideLastXML();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
stop.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
Core.stopAgentListener();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
start.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
Core.restartAgentListener(getApplicationContext());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}//end button events
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void updateLastXML() {
|
||||
|
||||
|
||||
TextView xml = (TextView) this.findViewById(R.id.xml);
|
||||
SharedPreferences agentPreferences = PandroidAgent.getSharedPrefs();
|
||||
|
||||
|
||||
String lastXML = agentPreferences.getString("lastXML", "[no data]");
|
||||
xml.setText("Last XML builded: \n\n" + lastXML);
|
||||
|
||||
|
||||
}
|
||||
private void hideLastXML(){
|
||||
TextView xml = (TextView) this.findViewById(R.id.xml);
|
||||
xml.setText("");
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue