mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
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
@ -17,76 +17,77 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="pandroid.agent"
|
||||
android:versionCode="2"
|
||||
android:versionName="1.5">
|
||||
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.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">
|
||||
<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: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" />
|
||||
<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">
|
||||
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" />
|
||||
|
||||
<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"
|
||||
/>
|
||||
android:theme="@android:style/Theme.Dialog" />
|
||||
<activity
|
||||
android:name=".Help"
|
||||
android:label="@string/help_str"
|
||||
android:theme="@android:style/Theme.Dialog"
|
||||
/>
|
||||
android:theme="@android:style/Theme.Dialog" />
|
||||
|
||||
<receiver android:name=".SMSBroadcastReceiver">
|
||||
<receiver android:name=".SMSBroadcastReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED" >
|
||||
</action>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="8" />
|
||||
|
||||
|
||||
<uses-sdk android:minSdkVersion="8"/>
|
||||
</manifest>
|
@ -1,3 +1,22 @@
|
||||
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
|
||||
|
Binary file not shown.
@ -32,24 +32,24 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pandroid_agent_copyright"
|
||||
/>
|
||||
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"
|
||||
/>
|
||||
android:text="@string/licensed_under_gpl_str" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/develop_team_str"
|
||||
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"
|
||||
/>
|
||||
android:gravity="center_horizontal" />
|
||||
|
||||
</LinearLayout>
|
@ -14,14 +14,12 @@
|
||||
// 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"
|
||||
@ -32,7 +30,6 @@
|
||||
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"
|
||||
@ -28,7 +29,6 @@
|
||||
android:layout_marginTop="50dp"
|
||||
android:text="@string/yes" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/no_button"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
|
@ -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"
|
||||
@ -36,10 +36,10 @@
|
||||
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"
|
||||
@ -228,7 +228,6 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/restartAgent" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
@ -2,5 +2,6 @@
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="#00FF00">
|
||||
android:textColor="#00FF00" >
|
||||
|
||||
</TextView>
|
@ -14,12 +14,9 @@
|
||||
// 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"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
|
||||
>
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
@ -29,8 +26,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/last_values_label_str"
|
||||
@ -39,21 +35,18 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/last_values"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
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"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_logo"
|
||||
@ -61,8 +54,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/logo"
|
||||
/>
|
||||
android:src="@drawable/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/latitude_label_str"
|
||||
@ -71,15 +63,13 @@
|
||||
android:layout_below="@id/lastContactInfo_label_str"
|
||||
android:text="@string/latitude"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
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"
|
||||
/>
|
||||
android:layout_below="@id/latitude_label_str" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/longitude_label_str"
|
||||
@ -88,15 +78,13 @@
|
||||
android:layout_below="@id/latitude_value_str"
|
||||
android:text="@string/longitude"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
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"
|
||||
/>
|
||||
android:layout_below="@id/longitude_label_str" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/battery_label_str"
|
||||
@ -105,15 +93,13 @@
|
||||
android:layout_below="@id/longitude_value_str"
|
||||
android:text="@string/battery_level"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
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"
|
||||
/>
|
||||
android:layout_below="@id/battery_label_str" />
|
||||
|
||||
<!--
|
||||
<TextView
|
||||
@ -155,14 +141,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/task"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/task_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/memory_label_str"
|
||||
@ -170,45 +154,41 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/memory"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/memory_value_str"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.18"
|
||||
>
|
||||
android:layout_weight="1.18" >
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="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"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/uptime_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sim_id"
|
||||
@ -216,44 +196,38 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sim_id"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sim_id_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<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"
|
||||
android:paddingRight="5dip"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_operator_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_type"
|
||||
@ -261,22 +235,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/network_type"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/network_type_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/phone_type"
|
||||
@ -284,21 +254,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/phone_type"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/phone_type_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/signal_strength"
|
||||
@ -306,21 +273,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/signal_strength"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/signal_strength_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_received"
|
||||
@ -328,21 +292,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sms_received"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_received_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_sent"
|
||||
@ -350,21 +311,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sms_sent"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_sent_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_calls"
|
||||
@ -372,21 +330,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/incoming_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missed_calls"
|
||||
@ -394,21 +349,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/missed_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missed_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/outgoing_calls"
|
||||
@ -416,21 +368,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/outgoing_calls"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/outgoing_calls_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receive_bytes"
|
||||
@ -438,21 +387,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/receive_bytes"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/receive_bytes_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transmit_bytes"
|
||||
@ -460,41 +406,36 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/transmit_bytes"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transmit_bytes_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="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"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roaming_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
|
||||
<!-- for debugging
|
||||
<!--
|
||||
for debugging
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
android:layout_width="fill_parent"
|
||||
@ -529,6 +470,6 @@
|
||||
android:text="Hide xml" />
|
||||
-->
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -17,10 +17,6 @@
|
||||
android:paddingTop="20dp"
|
||||
android:src="@drawable/pandroid_large" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -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">
|
||||
<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"
|
||||
/>
|
||||
android:title="@string/help_label_str"/>
|
||||
<item
|
||||
android:id="@+id/about_button_menu_options"
|
||||
android:title="@string/about_label_str"
|
||||
android:icon="@drawable/about"
|
||||
/>
|
||||
android:title="@string/about_label_str"/>
|
||||
|
||||
</menu>
|
@ -236,8 +236,8 @@ public class Core {
|
||||
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);
|
||||
// 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);
|
||||
|
@ -83,27 +83,27 @@ public class PandroidAgentListener extends Service {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
||||
// try {
|
||||
// notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
// } catch (Exception e) {
|
||||
// Log.e("notification", e.toString());
|
||||
// }
|
||||
//
|
||||
// if(Core.NotificationCheck == "enabled"){
|
||||
//
|
||||
// Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
|
||||
// System.currentTimeMillis());
|
||||
// Intent notificationIntent = new Intent(this,PandroidAgent.class);
|
||||
// notificationIntent.setAction("android.intent.action.MAIN");
|
||||
// notificationIntent.addCategory("android.intent.category.LAUNCHER");
|
||||
// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, Notification.FLAG_NO_CLEAR);
|
||||
// notification.setLatestEventInfo(this, getText(R.string.notification_title), getText(R.string.notification_message), pendingIntent);
|
||||
// notification.flags |= Notification.FLAG_ONGOING_EVENT;
|
||||
// notificationManager.notify(1, notification);
|
||||
// }
|
||||
// else{
|
||||
// CancelNotification(getApplicationContext(),42);
|
||||
// }
|
||||
// try {
|
||||
// notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
// } catch (Exception e) {
|
||||
// Log.e("notification", e.toString());
|
||||
// }
|
||||
//
|
||||
// if(Core.NotificationCheck == "enabled"){
|
||||
//
|
||||
// Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
|
||||
// System.currentTimeMillis());
|
||||
// Intent notificationIntent = new Intent(this,PandroidAgent.class);
|
||||
// notificationIntent.setAction("android.intent.action.MAIN");
|
||||
// notificationIntent.addCategory("android.intent.category.LAUNCHER");
|
||||
// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, Notification.FLAG_NO_CLEAR);
|
||||
// notification.setLatestEventInfo(this, getText(R.string.notification_title), getText(R.string.notification_message), pendingIntent);
|
||||
// notification.flags |= Notification.FLAG_ONGOING_EVENT;
|
||||
// notificationManager.notify(1, notification);
|
||||
// }
|
||||
// else{
|
||||
// CancelNotification(getApplicationContext(),42);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,83 @@ public class PandroidAgentListener extends Service {
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyWakeLock");
|
||||
wakeLock.acquire();
|
||||
Core.loadConf(this);
|
||||
new loadConfThenContinueAsyncTask().execute();
|
||||
|
||||
|
||||
wakeLock.release();
|
||||
|
||||
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// private void contact(){
|
||||
// Date date = new Date();
|
||||
//
|
||||
// putSharedData("PANDROID_DATA", "contactError", "0", "integer");
|
||||
// putSharedData("PANDROID_DATA", "lastContact", Long.toString(date.getTime() / 1000), "long");
|
||||
//
|
||||
// // Keep lastXML sended if is not empty (empty means error sending it)
|
||||
// String lastXML = buildXML();
|
||||
//
|
||||
//
|
||||
// String agentName = getSharedData("PANDROID_DATA", "agentName", Core.defaultAgentName, "string");
|
||||
//
|
||||
// String destFileName = agentName + "." + System.currentTimeMillis() + ".data";
|
||||
//
|
||||
// writeFile(destFileName, lastXML);
|
||||
//
|
||||
// String[] tentacleData = {
|
||||
// "-a",
|
||||
// getSharedData("PANDROID_DATA", "serverAddr", "", "string"),
|
||||
// "-p",
|
||||
// Core.defaultServerPort,
|
||||
// "-v",
|
||||
// "/data/data/pandroid.agent/files/" + destFileName
|
||||
// };
|
||||
//
|
||||
// int tentacleRet = new tentacle_client().tentacle_client(tentacleData);
|
||||
//
|
||||
// // Deleting the file after send it
|
||||
// File file = new File("/data/data/pandroid.agent/files/" + destFileName);
|
||||
// file.delete();
|
||||
//
|
||||
// if(tentacleRet == 0) {
|
||||
// putSharedData("PANDROID_DATA", "lastXML", lastXML, "string");
|
||||
// if (Core.helloSignal >= 1)
|
||||
// Core.helloSignal = 0;
|
||||
// Core.updateConf(getApplicationContext());
|
||||
// }
|
||||
// else {
|
||||
// putSharedData("PANDROID_DATA", "contactError", "1", "integer");
|
||||
// }
|
||||
//
|
||||
// updateValues();
|
||||
// }
|
||||
|
||||
/**
|
||||
* To ensure that the Core values are loaded before continuing
|
||||
* @author markholland
|
||||
*
|
||||
*/
|
||||
public class loadConfThenContinueAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
Core.loadConf(getApplicationContext());
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void unused)
|
||||
{
|
||||
|
||||
updateValues();
|
||||
contact();
|
||||
|
||||
@ -121,11 +197,11 @@ public class PandroidAgentListener extends Service {
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
|
||||
System.currentTimeMillis());
|
||||
Intent notificationIntent = new Intent(this,PandroidAgent.class);
|
||||
Intent notificationIntent = new Intent(getApplicationContext(),PandroidAgent.class);
|
||||
notificationIntent.setAction("android.intent.action.MAIN");
|
||||
notificationIntent.addCategory("android.intent.category.LAUNCHER");
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, Notification.FLAG_NO_CLEAR);
|
||||
notification.setLatestEventInfo(this, getText(R.string.notification_title), getText(R.string.notification_message), pendingIntent);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, notificationIntent, Notification.FLAG_NO_CLEAR);
|
||||
notification.setLatestEventInfo(getApplicationContext(), getText(R.string.notification_title), getText(R.string.notification_message), pendingIntent);
|
||||
notification.flags |= Notification.FLAG_ONGOING_EVENT;
|
||||
|
||||
|
||||
@ -142,65 +218,8 @@ public class PandroidAgentListener extends Service {
|
||||
Log.e("notification", e.toString());
|
||||
}
|
||||
|
||||
|
||||
finally{
|
||||
wakeLock.release();
|
||||
}
|
||||
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// private void contact(){
|
||||
// Date date = new Date();
|
||||
//
|
||||
// putSharedData("PANDROID_DATA", "contactError", "0", "integer");
|
||||
// putSharedData("PANDROID_DATA", "lastContact", Long.toString(date.getTime() / 1000), "long");
|
||||
//
|
||||
// // Keep lastXML sended if is not empty (empty means error sending it)
|
||||
// String lastXML = buildXML();
|
||||
//
|
||||
//
|
||||
// String agentName = getSharedData("PANDROID_DATA", "agentName", Core.defaultAgentName, "string");
|
||||
//
|
||||
// String destFileName = agentName + "." + System.currentTimeMillis() + ".data";
|
||||
//
|
||||
// writeFile(destFileName, lastXML);
|
||||
//
|
||||
// String[] tentacleData = {
|
||||
// "-a",
|
||||
// getSharedData("PANDROID_DATA", "serverAddr", "", "string"),
|
||||
// "-p",
|
||||
// Core.defaultServerPort,
|
||||
// "-v",
|
||||
// "/data/data/pandroid.agent/files/" + destFileName
|
||||
// };
|
||||
//
|
||||
// int tentacleRet = new tentacle_client().tentacle_client(tentacleData);
|
||||
//
|
||||
// // Deleting the file after send it
|
||||
// File file = new File("/data/data/pandroid.agent/files/" + destFileName);
|
||||
// file.delete();
|
||||
//
|
||||
// if(tentacleRet == 0) {
|
||||
// putSharedData("PANDROID_DATA", "lastXML", lastXML, "string");
|
||||
// if (Core.helloSignal >= 1)
|
||||
// Core.helloSignal = 0;
|
||||
// Core.updateConf(getApplicationContext());
|
||||
// }
|
||||
// else {
|
||||
// putSharedData("PANDROID_DATA", "contactError", "1", "integer");
|
||||
// }
|
||||
//
|
||||
// updateValues();
|
||||
// }
|
||||
|
||||
}// end onPostExecute
|
||||
|
||||
|
||||
private void contact(){
|
||||
@ -359,8 +378,8 @@ public class PandroidAgentListener extends Service {
|
||||
// MODULES //
|
||||
// //
|
||||
|
||||
// String orientation = getSharedData("PANDROID_DATA", "orientation", "361", "float");
|
||||
// String proximity = getSharedData("PANDROID_DATA", "proximity", "-1.0", "float");
|
||||
// String orientation = getSharedData("PANDROID_DATA", "orientation", "361", "float");
|
||||
// String proximity = getSharedData("PANDROID_DATA", "proximity", "-1.0", "float");
|
||||
String batteryLevel = getSharedData("PANDROID_DATA", "batteryLevel", "-1", "integer");
|
||||
String taskStatus = getSharedData("PANDROID_DATA", "taskStatus", "disabled", "string");
|
||||
String taskRun = getSharedData("PANDROID_DATA", "taskRun", "false", "string");
|
||||
@ -413,13 +432,13 @@ public class PandroidAgentListener extends Service {
|
||||
if (BatteryLevelReport.equals("enabled"))
|
||||
buffer += buildmoduleXML("battery_level", "The current Battery level", "generic_data", batteryLevel);
|
||||
|
||||
// if(!orientation.equals("361.0")) {
|
||||
// buffer += buildmoduleXML("orientation", "The actually device orientation (in degrees)", "generic_data", orientation);
|
||||
// }
|
||||
//
|
||||
// if(!proximity.equals("-1.0")) {
|
||||
// buffer += buildmoduleXML("proximity", "The actually device proximity detector (0/1)", "generic_data", proximity);
|
||||
// }
|
||||
// if(!orientation.equals("361.0")) {
|
||||
// buffer += buildmoduleXML("orientation", "The actually device orientation (in degrees)", "generic_data", orientation);
|
||||
// }
|
||||
//
|
||||
// if(!proximity.equals("-1.0")) {
|
||||
// buffer += buildmoduleXML("proximity", "The actually device proximity detector (0/1)", "generic_data", proximity);
|
||||
// }
|
||||
|
||||
if (taskStatus.equals("enabled")) {
|
||||
buffer += buildmoduleXML("taskHumanName", "The task's human name.", "async_string", taskHumanName);
|
||||
@ -565,7 +584,7 @@ public class PandroidAgentListener extends Service {
|
||||
|
||||
private void gpsLocation() {
|
||||
// Starts with GPS, if no GPS then gets network location
|
||||
//
|
||||
//
|
||||
LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||
List<String> providers = lm.getProviders(true);
|
||||
Log.d("PANDROID providers count", "" + providers.size());
|
||||
@ -1043,8 +1062,8 @@ public class PandroidAgentListener extends Service {
|
||||
|
||||
private void putSharedData(String preferenceName, String tokenName, String data, String type) {
|
||||
|
||||
SharedPreferences agentPreferences = this.getSharedPreferences(
|
||||
this.getString(R.string.const_string_preferences),
|
||||
SharedPreferences agentPreferences = getApplicationContext().getSharedPreferences(
|
||||
getApplicationContext().getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
Editor editor = agentPreferences.edit();
|
||||
@ -1075,8 +1094,8 @@ public class PandroidAgentListener extends Service {
|
||||
|
||||
private String getSharedData(String preferenceName, String tokenName, String defaultValue, String type) {
|
||||
|
||||
SharedPreferences agentPreferences = this.getSharedPreferences(
|
||||
this.getString(R.string.const_string_preferences),
|
||||
SharedPreferences agentPreferences = getApplicationContext().getSharedPreferences(
|
||||
getApplicationContext().getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
if(type == "boolean") {
|
||||
@ -1152,30 +1171,30 @@ public class PandroidAgentListener extends Service {
|
||||
|
||||
|
||||
|
||||
// ///////////////////////////////////////////
|
||||
// // Getting values from device functions
|
||||
// ///////////////////////////////////////////
|
||||
//
|
||||
// public class MyLocationListener implements LocationListener {
|
||||
//
|
||||
// @Override
|
||||
// public void onLocationChanged(Location loc) {
|
||||
// putSharedData("PANDROID_DATA", "latitude", Double.valueOf(loc.getLatitude()).toString(), "float");
|
||||
// putSharedData("PANDROID_DATA", "longitude", Double.valueOf(loc.getLongitude()).toString(), "float");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onProviderDisabled(String provider) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onProviderEnabled(String provider) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
// }
|
||||
//
|
||||
// }/* End of Class MyLocationListener */
|
||||
// ///////////////////////////////////////////
|
||||
// // Getting values from device functions
|
||||
// ///////////////////////////////////////////
|
||||
//
|
||||
// public class MyLocationListener implements LocationListener {
|
||||
//
|
||||
// @Override
|
||||
// public void onLocationChanged(Location loc) {
|
||||
// putSharedData("PANDROID_DATA", "latitude", Double.valueOf(loc.getLatitude()).toString(), "float");
|
||||
// putSharedData("PANDROID_DATA", "longitude", Double.valueOf(loc.getLongitude()).toString(), "float");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onProviderDisabled(String provider) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onProviderEnabled(String provider) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
// }
|
||||
//
|
||||
// }/* End of Class MyLocationListener */
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ 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";
|
||||
|
@ -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;
|
||||
@ -40,9 +41,9 @@ public class Status extends Activity {
|
||||
else
|
||||
setContentView(R.layout.statusnosim);
|
||||
|
||||
// Core.loadLastValues(getApplicationContext());
|
||||
// showLastValues();
|
||||
// updateLastContactInfo();
|
||||
// Core.loadLastValues(getApplicationContext());
|
||||
// showLastValues();
|
||||
// updateLastContactInfo();
|
||||
//setButtonEvents();
|
||||
}
|
||||
//TODO maybe remove duplicate from onCreate
|
||||
@ -55,9 +56,7 @@ public class Status extends Activity {
|
||||
else
|
||||
setContentView(R.layout.statusnosim);
|
||||
|
||||
Core.loadLastValues(getApplicationContext());
|
||||
|
||||
showLastValues();
|
||||
new GetLastValuesAsyncTask().execute();
|
||||
|
||||
updateLastContactInfo();
|
||||
|
||||
@ -71,9 +70,7 @@ public class Status extends Activity {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Core.loadLastValues(getApplicationContext());
|
||||
|
||||
showLastValues();
|
||||
new GetLastValuesAsyncTask().execute();
|
||||
|
||||
updateLastContactInfo();
|
||||
|
||||
@ -105,6 +102,25 @@ public class Status extends Activity {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user