2012-08-03 Mark Holland <mark@mark-holland.me.uk>

* res/layout/password_entry.xml: UI tweaks

	* res/layout/setup.xml: Added mobile console
	textview and button

	* res/layout/setupnosim.xml: Added mobile console
	textview and button

	* res/layout/status.xml: Added roaming view

	* res/values/strings.xml: string for roaming, 
	roaming report, mobile site

	* src/pandroid/agent/core.java: Added variables
	for roaming and mobile site url

	* src/pandroid/agent/PandroidAgentListener.java: 
 	Added roaming report method and variables then add
	to xml

	* src/pandroid/agent/setup.java: Added mobile site
	view and full screen password input

	* src/pandroid/agent/status.java: Added roaming view

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6843 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
markholland 2012-08-03 04:54:40 +00:00
parent 0c685638d4
commit b342dbc978
16 changed files with 675 additions and 488 deletions

View File

@ -66,6 +66,7 @@
<uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_SMS"/> <uses-permission android:name="android.permission.READ_SMS"/>
<uses-feature android:name="android.hardware.sensor.light" /> <uses-feature android:name="android.hardware.sensor.light" />
<uses-feature android:name="android.hardware.location" /> <uses-feature android:name="android.hardware.location" />

View File

@ -1,4 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pandroid.agent" package="pandroid.agent"
android:versionCode="2" android:versionCode="2"
@ -51,6 +66,7 @@
<uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_SMS"/> <uses-permission android:name="android.permission.READ_SMS"/>
<uses-feature android:name="android.hardware.sensor.light" /> <uses-feature android:name="android.hardware.sensor.light" />
<uses-feature android:name="android.hardware.location" /> <uses-feature android:name="android.hardware.location" />

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:orientation="vertical" > android:orientation="vertical" >
<RelativeLayout <RelativeLayout

View File

@ -25,12 +25,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="16dp" android:layout_marginTop="85dp"
android:ems="10" android:ems="10"
android:inputType="textPassword" > android:inputType="textPassword" />
<requestFocus />
</EditText>
<Button <Button
android:id="@+id/password_back_button" android:id="@+id/password_back_button"
@ -38,8 +35,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignRight="@+id/password_entry_input" android:layout_alignRight="@+id/password_entry_input"
android:layout_below="@+id/password_entry_input" android:layout_below="@+id/password_entry_input"
android:layout_marginRight="38dp" android:layout_marginTop="29dp"
android:layout_marginTop="24dp"
android:text="@string/back" /> android:text="@string/back" />
<Button <Button
@ -49,7 +45,16 @@
android:layout_alignBaseline="@+id/password_back_button" android:layout_alignBaseline="@+id/password_back_button"
android:layout_alignBottom="@+id/password_back_button" android:layout_alignBottom="@+id/password_back_button"
android:layout_alignLeft="@+id/password_entry_input" android:layout_alignLeft="@+id/password_entry_input"
android:layout_marginLeft="24dp"
android:text="@string/enter" /> android:text="@string/enter" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="36dp"
android:text="@string/alert_dialog_password"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout> </RelativeLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
// Pandora FMS - http://pandorafms.com // Pandora FMS - http://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas // Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
@ -12,273 +12,284 @@
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
--> -->
<LinearLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/setup"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
> >
<ScrollView
android:layout_width="fill_parent" <LinearLayout
android:layout_height="fill_parent" android:layout_width="fill_parent"
> android:layout_height="fill_parent" >
<LinearLayout
android:orientation="vertical" <ScrollView
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="fill_parent" >
>
<TextView <LinearLayout
android:id="@+id/field1" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical" >
android:text="@string/serverAddr"
android:paddingTop="5dp" <TextView
/> android:id="@+id/field1"
<EditText android:layout_width="fill_parent"
android:id="@+id/serverAddrInput" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:paddingTop="5dp"
android:layout_height="wrap_content" android:text="@string/serverAddr" />
android:singleLine="true"
/> <EditText
<TextView android:id="@+id/serverAddrInput"
android:id="@+id/field2" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:singleLine="true" />
android:text="@string/serverPort"
/> <TextView
<EditText android:id="@+id/field2"
android:id="@+id/serverPortInput" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/serverPort" />
android:singleLine="true"
android:inputType="number" <EditText
/> android:id="@+id/serverPortInput"
<TextView android:layout_width="fill_parent"
android:id="@+id/field3" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:inputType="number"
android:layout_height="wrap_content" android:singleLine="true" />
android:text="@string/interval"
/> <TextView
<EditText android:id="@+id/field3"
android:id="@+id/intervalInput" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/interval" />
android:singleLine="true"
android:inputType="number" <EditText
/> android:id="@+id/intervalInput"
<TextView android:layout_width="fill_parent"
android:id="@+id/field4" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:inputType="number"
android:layout_height="wrap_content" android:singleLine="true" />
android:text="@string/agent"
/> <TextView
<EditText android:id="@+id/field4"
android:id="@+id/agentNameInput" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/agent" />
android:singleLine="true"
/> <EditText
android:id="@+id/agentNameInput"
<CheckBox android:layout_width="fill_parent"
android:id="@+id/checkGpsReport" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:singleLine="true" />
android:layout_height="wrap_content"
android:text="@string/gpsReport" <TextView
android:textSize="14dip" android:id="@+id/field5"
android:textColor="#bbbbbb" android:layout_width="fill_parent"
/> android:layout_height="wrap_content"
<CheckBox android:text="@string/webname" />
android:id="@+id/checkBatteryLevelReport"
android:layout_width="wrap_content" <EditText
android:layout_height="wrap_content" android:id="@+id/webNameInput"
android:text="@string/BatteryLevelReport" android:layout_width="fill_parent"
android:textSize="14dip" android:layout_height="wrap_content"
android:textColor="#bbbbbb" android:singleLine="true" />
/> <Button
<CheckBox android:id="@+id/goToWebButton"
android:id="@+id/checkTaskReport" android:layout_width="fill_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/go_to_web" />
android:text="@string/taskReport"
android:textSize="14dip" <CheckBox
android:textColor="#bbbbbb" android:id="@+id/checkGpsReport"
android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
<CheckBox android:text="@string/gpsReport"
android:id="@+id/checkMemoryReport" android:textColor="#bbbbbb"
android:layout_width="wrap_content" android:textSize="14dip" />
android:layout_height="wrap_content"
android:text="@string/memoryReport" <CheckBox
android:textSize="14dip" android:id="@+id/checkBatteryLevelReport"
android:textColor="#bbbbbb" android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
<CheckBox android:text="@string/BatteryLevelReport"
android:id="@+id/checkSimIDReport" android:textColor="#bbbbbb"
android:layout_width="wrap_content" android:textSize="14dip" />
android:layout_height="wrap_content"
android:text="@string/simIDReport" <CheckBox
android:textSize="14dip" android:id="@+id/checkTaskReport"
android:textColor="#bbbbbb" android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
android:text="@string/taskReport"
<CheckBox android:textColor="#bbbbbb"
android:id="@+id/checkDeviceUpTimeReport" android:textSize="14dip" />
android:layout_width="wrap_content"
android:layout_height="wrap_content" <CheckBox
android:text="@string/uptimeReport" android:id="@+id/checkMemoryReport"
android:textSize="14dip" android:layout_width="wrap_content"
android:textColor="#bbbbbb" android:layout_height="wrap_content"
android:text="@string/memoryReport"
/> android:textColor="#bbbbbb"
<CheckBox android:textSize="14dip" />
android:id="@+id/checkNetworkOperatorReport"
android:layout_width="wrap_content" <CheckBox
android:layout_height="wrap_content" android:id="@+id/checkSimIDReport"
android:text="@string/NetworkOperatorReport" android:layout_width="wrap_content"
android:textSize="14dip" android:layout_height="wrap_content"
android:textColor="#bbbbbb" android:text="@string/simIDReport"
android:textColor="#bbbbbb"
/> android:textSize="14dip" />
<CheckBox
android:id="@+id/checkNetworkTypeReport" <CheckBox
android:layout_width="wrap_content" android:id="@+id/checkDeviceUpTimeReport"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:text="@string/NetworkTypeReport" android:layout_height="wrap_content"
android:textSize="14dip" android:text="@string/uptimeReport"
android:textColor="#bbbbbb" android:textColor="#bbbbbb"
android:textSize="14dip" />
/>
<CheckBox <CheckBox
android:id="@+id/checkPhoneTypeReport" android:id="@+id/checkNetworkOperatorReport"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/PhoneTypeReport" android:text="@string/NetworkOperatorReport"
android:textSize="14dip" android:textColor="#bbbbbb"
android:textColor="#bbbbbb" android:textSize="14dip" />
/> <CheckBox
<CheckBox android:id="@+id/checkNetworkTypeReport"
android:id="@+id/checkSignalStrengthReport" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/NetworkTypeReport"
android:text="@string/SignalStrengthReport" android:textColor="#bbbbbb"
android:textSize="14dip" android:textSize="14dip" />
android:textColor="#bbbbbb"
<CheckBox
/> android:id="@+id/checkPhoneTypeReport"
<CheckBox android:layout_width="wrap_content"
android:id="@+id/checkReceivedSMSReport" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="@string/PhoneTypeReport"
android:layout_height="wrap_content" android:textColor="#bbbbbb"
android:text="@string/ReceivedSMSReport" android:textSize="14dip" />
android:textSize="14dip"
android:textColor="#bbbbbb" <CheckBox
android:id="@+id/checkSignalStrengthReport"
/> android:layout_width="wrap_content"
<CheckBox android:layout_height="wrap_content"
android:id="@+id/checkSentSMSReport" android:text="@string/SignalStrengthReport"
android:layout_width="wrap_content" android:textColor="#bbbbbb"
android:layout_height="wrap_content" android:textSize="14dip" />
android:text="@string/SentSMSReport"
android:textSize="14dip" <CheckBox
android:textColor="#bbbbbb" android:id="@+id/checkReceivedSMSReport"
android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
<CheckBox android:text="@string/ReceivedSMSReport"
android:id="@+id/checkIncomingCallsReport" android:textColor="#bbbbbb"
android:layout_width="wrap_content" android:textSize="14dip" />
android:layout_height="wrap_content"
android:text="@string/IncomingCallsReport" <CheckBox
android:textSize="14dip" android:id="@+id/checkSentSMSReport"
android:textColor="#bbbbbb" android:layout_width="wrap_content"
android:layout_height="wrap_content"
/> android:text="@string/SentSMSReport"
<CheckBox android:textColor="#bbbbbb"
android:id="@+id/checkMissedCallsReport" android:textSize="14dip" />
android:layout_width="wrap_content"
android:layout_height="wrap_content" <CheckBox
android:text="@string/MissedCallsReport" android:id="@+id/checkIncomingCallsReport"
android:textSize="14dip" android:layout_width="wrap_content"
android:textColor="#bbbbbb" android:layout_height="wrap_content"
android:text="@string/IncomingCallsReport"
/> android:textColor="#bbbbbb"
<CheckBox android:textSize="14dip" />
android:id="@+id/checkOutgoingCallsReport"
android:layout_width="wrap_content" <CheckBox
android:layout_height="wrap_content" android:id="@+id/checkMissedCallsReport"
android:text="@string/OutgoingCallsReport" android:layout_width="wrap_content"
android:textSize="14dip" android:layout_height="wrap_content"
android:textColor="#bbbbbb" android:text="@string/MissedCallsReport"
android:textColor="#bbbbbb"
/> android:textSize="14dip" />
<CheckBox
android:id="@+id/checkBytesReceivedReport" <CheckBox
android:layout_width="wrap_content" android:id="@+id/checkOutgoingCallsReport"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:text="@string/BytesReceivedReport" android:layout_height="wrap_content"
android:textSize="14dip" android:text="@string/OutgoingCallsReport"
android:textColor="#bbbbbb" android:textColor="#bbbbbb"
android:textSize="14dip" />
/>
<CheckBox <CheckBox
android:id="@+id/checkBytesSentReport" android:id="@+id/checkBytesReceivedReport"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/BytesSentReport" android:text="@string/BytesReceivedReport"
android:textSize="14dip" android:textColor="#bbbbbb"
android:textColor="#bbbbbb" android:textSize="14dip" />
/> <CheckBox
<CheckBox android:id="@+id/checkBytesSentReport"
android:id="@+id/checkHelloSignalReport" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/BytesSentReport"
android:text="@string/HelloSignalReport" android:textColor="#bbbbbb"
android:textSize="14dip" android:textSize="14dip" />
android:textColor="#bbbbbb"
<CheckBox
/> android:id="@+id/checkHelloSignalReport"
android:layout_width="wrap_content"
<TextView android:layout_height="wrap_content"
android:id="@+id/field5" android:text="@string/HelloSignalReport"
android:layout_width="fill_parent" android:textColor="#bbbbbb"
android:layout_height="wrap_content" android:textSize="14dip" />
android:text="@string/task"
/> <CheckBox
<LinearLayout android:id="@+id/checkRoamingReport"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:text="@string/RoamingReport"
> android:textColor="#bbbbbb"
<ProgressBar android:textSize="14dip" />
android:id="@+id/loading_task_anim"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:id="@+id/field5"
/> android:layout_width="fill_parent"
<Spinner android:layout_height="wrap_content"
android:id="@+id/processes_combo" android:text="@string/task" />
android:layout_width="fill_parent"
android:layout_height="wrap_content" <LinearLayout
android:visibility="gone" android:layout_width="fill_parent"
/> android:layout_height="wrap_content"
</LinearLayout> android:orientation="horizontal" >
<Button
android:id="@+id/set_password" <ProgressBar
android:layout_width="fill_parent" android:id="@+id/loading_task_anim"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:text="@string/set_password" android:layout_height="wrap_content" />
/>
<Button <Spinner
android:id="@+id/update" android:id="@+id/processes_combo"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/update" android:visibility="gone" />
/> </LinearLayout>
<Button
android:id="@+id/set_password"
</LinearLayout> android:layout_width="fill_parent"
</ScrollView> android:layout_height="wrap_content"
</LinearLayout> android:text="@string/set_password" />
<Button
android:id="@+id/update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/update" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>

View File

@ -12,166 +12,180 @@
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
--> -->
<LinearLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/setupnosim"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
> >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/field1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/serverAddr"
android:paddingTop="5dp"
/>
<EditText
android:id="@+id/serverAddrInput"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<TextView
android:id="@+id/field2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/serverPort"
/>
<EditText
android:id="@+id/serverPortInput"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="number"
/>
<TextView
android:id="@+id/field3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/interval"
/>
<EditText
android:id="@+id/intervalInput"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="number"
/>
<TextView
android:id="@+id/field4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/agent"
/>
<EditText
android:id="@+id/agentNameInput"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<CheckBox <LinearLayout
android:id="@+id/checkGpsReport" android:layout_width="fill_parent"
android:layout_width="wrap_content" android:layout_height="fill_parent" >
android:layout_height="wrap_content"
android:text="@string/gpsReport" <ScrollView
android:textSize="14dip" android:layout_width="fill_parent"
android:textColor="#bbbbbb" android:layout_height="fill_parent" >
/>
<CheckBox <LinearLayout
android:id="@+id/checkBatteryLevelReport" android:layout_width="fill_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical" >
android:text="@string/BatteryLevelReport"
android:textSize="14dip" <TextView
android:textColor="#bbbbbb" android:id="@+id/field1"
android:layout_width="fill_parent"
/> android:layout_height="wrap_content"
<CheckBox android:paddingTop="5dp"
android:id="@+id/checkMemoryReport" android:text="@string/serverAddr" />
android:layout_width="wrap_content"
android:layout_height="wrap_content" <EditText
android:text="@string/memoryReport" android:id="@+id/serverAddrInput"
android:textSize="14dip" android:layout_width="fill_parent"
android:textColor="#bbbbbb" android:layout_height="wrap_content"
android:singleLine="true" />
/>
<CheckBox <TextView
android:id="@+id/checkTaskReport" android:id="@+id/field2"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/taskReport" android:text="@string/serverPort" />
android:textSize="14dip"
android:textColor="#bbbbbb" <EditText
android:id="@+id/serverPortInput"
/> android:layout_width="fill_parent"
<CheckBox android:layout_height="wrap_content"
android:id="@+id/checkDeviceUpTimeReport" android:inputType="number"
android:layout_width="wrap_content" android:singleLine="true" />
android:layout_height="wrap_content"
android:text="@string/uptimeReport" <TextView
android:textSize="14dip" android:id="@+id/field3"
android:textColor="#bbbbbb" android:layout_width="fill_parent"
android:layout_height="wrap_content"
/> android:text="@string/interval" />
<CheckBox
android:id="@+id/checkHelloSignalReport" <EditText
android:layout_width="wrap_content" android:id="@+id/intervalInput"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:text="@string/HelloSignalReport" android:layout_height="wrap_content"
android:textSize="14dip" android:inputType="number"
android:textColor="#bbbbbb" android:singleLine="true" />
/> <TextView
android:id="@+id/field4"
<TextView android:layout_width="fill_parent"
android:id="@+id/field5" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="@string/agent" />
android:layout_height="wrap_content"
android:text="@string/task" <EditText
/> android:id="@+id/agentNameInput"
<LinearLayout android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:singleLine="true" />
android:orientation="horizontal"
> <TextView
<ProgressBar android:id="@+id/field5"
android:id="@+id/loading_task_anim" android:layout_width="fill_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/webname" />
/>
<Spinner <EditText
android:id="@+id/processes_combo" android:id="@+id/webNameInput"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:singleLine="true" />
/>
</LinearLayout> <Button
<Button android:id="@+id/goToWebButton"
android:id="@+id/set_password" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/go_to_web" />
android:text="@string/set_password"
/> <CheckBox
<Button android:id="@+id/checkGpsReport"
android:id="@+id/update" android:layout_width="wrap_content"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/gpsReport"
android:text="@string/update" android:textColor="#bbbbbb"
/> android:textSize="14dip" />
<CheckBox
android:id="@+id/checkBatteryLevelReport"
</LinearLayout> android:layout_width="wrap_content"
</ScrollView> android:layout_height="wrap_content"
</LinearLayout> android:text="@string/BatteryLevelReport"
android:textColor="#bbbbbb"
android:textSize="14dip" />
<CheckBox
android:id="@+id/checkMemoryReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/memoryReport"
android:textColor="#bbbbbb"
android:textSize="14dip" />
<CheckBox
android:id="@+id/checkTaskReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/taskReport"
android:textColor="#bbbbbb"
android:textSize="14dip" />
<CheckBox
android:id="@+id/checkDeviceUpTimeReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/uptimeReport"
android:textColor="#bbbbbb"
android:textSize="14dip" />
<CheckBox
android:id="@+id/checkHelloSignalReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/HelloSignalReport"
android:textColor="#bbbbbb"
android:textSize="14dip" />
<TextView
android:id="@+id/field5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/task" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ProgressBar
android:id="@+id/loading_task_anim"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/processes_combo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
</LinearLayout>
<Button
android:id="@+id/set_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/set_password" />
<Button
android:id="@+id/update"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/update" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>

View File

@ -468,6 +468,28 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
/> />
</TableRow> </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="14dip"
android:textStyle="bold"
/>
<TextView
android:id="@+id/roaming_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</TableRow>
</TableLayout> </TableLayout>

View File

@ -104,5 +104,10 @@
<string name="password">password</string> <string name="password">password</string>
<string name="password_length">password must be longer than 6 characters!</string> <string name="password_length">password must be longer than 6 characters!</string>
<string name="password_incorrect">Wrong password!</string> <string name="password_incorrect">Wrong password!</string>
<string name="roaming">Roaming:</string>
<string name="roaming_value"/>
<string name="RoamingReport">Report if Roaming</string>
<string name="webname">Mobile server url:</string>
<string name="go_to_web">View Mobile site</string>
</resources> </resources>

View File

@ -82,7 +82,7 @@
<string name="network_type_value"/> <string name="network_type_value"/>
<string name="phone_type">Tipo movil:</string> <string name="phone_type">Tipo movil:</string>
<string name="phone_type_value"/> <string name="phone_type_value"/>
<string name="signal_strength">Potencia senyal:</string> <string name="signal_strength">Potencia señal:</string>
<string name="signal_strength_value"/> <string name="signal_strength_value"/>
<string name="incoming_Calls">Llamadas recibidas:</string> <string name="incoming_Calls">Llamadas recibidas:</string>
<string name="incoming_Calls_value"/> <string name="incoming_Calls_value"/>
@ -94,20 +94,20 @@
<string name="receive_bytes_value"/> <string name="receive_bytes_value"/>
<string name="transmit_bytes">Bytes transmitidos:</string> <string name="transmit_bytes">Bytes transmitidos:</string>
<string name="transmit_bytes_value"/> <string name="transmit_bytes_value"/>
<string name="alert_dialog_password">Introducir contrasenya</string> <string name="alert_dialog_password">Introducir contraseña</string>
<string name="password_no_match">Las contrasenyas son diferentes!</string> <string name="password_no_match">Las contraseñas son diferentes!</string>
<string name="password_error">error</string> <string name="password_error">error</string>
<string name="password">contrasenya</string> <string name="password">contraseña</string>
<string name="password_length">La contrasenya debe contener mas de 6 caracteres!</string> <string name="password_length">La contraseña debe contener mas de 6 caracteres!</string>
<string name="password_incorrect">Contrasenya incorrecta</string> <string name="password_incorrect">Contraseña incorrecta</string>
<string name="password_set">Crear contrasenya</string> <string name="password_set">Crear contraseña</string>
<string name="password_enter">Introducir contrasenya</string> <string name="password_enter">Introducir contraseña</string>
<string name="password_repeat">Repetir contrasenya</string> <string name="password_repeat">Repetir contraseña</string>
<string name="password_choose_text">Quieres poner una contrasenya?</string> <string name="password_choose_text">Quieres poner una contraseña?</string>
<string name="password_checkbox">No vuelkves a preguntar</string> <string name="password_checkbox">No vuelkves a preguntar</string>
<string name="password_created">Contrasenya creada</string> <string name="password_created">Contraseña creada</string>
<string name="password_removed">Sin contrasenya</string> <string name="password_removed">Sin contraseña</string>
<string name="set_password">Crear/Cambiar contrasenya</string> <string name="set_password">Crear/Cambiar contraseña</string>
<string name="enter">Intro</string> <string name="enter">Intro</string>
<string name="back">Volver</string> <string name="back">Volver</string>
@ -119,7 +119,7 @@
<string name="NetworkOperatorReport">Reporta operador de red</string> <string name="NetworkOperatorReport">Reporta operador de red</string>
<string name="NetworkTypeReport">Reporta tipo de red</string> <string name="NetworkTypeReport">Reporta tipo de red</string>
<string name="PhoneTypeReport">Reporta tipo de movil</string> <string name="PhoneTypeReport">Reporta tipo de movil</string>
<string name="SignalStrengthReport">Reporta potencia de senyal</string> <string name="SignalStrengthReport">Reporta potencia de señal</string>
<string name="ReceivedSMSReport">Reporta numero de SMS recibido</string> <string name="ReceivedSMSReport">Reporta numero de SMS recibido</string>
<string name="SentSMSReport">Reporta numero de SMS enviado</string> <string name="SentSMSReport">Reporta numero de SMS enviado</string>
<string name="IncomingCallsReport">Reporta numero de llamadas recibidas</string> <string name="IncomingCallsReport">Reporta numero de llamadas recibidas</string>
@ -127,6 +127,6 @@
<string name="OutgoingCallsReport">Reporta numero de llamadas salientes</string> <string name="OutgoingCallsReport">Reporta numero de llamadas salientes</string>
<string name="BytesReceivedReport">Reporta bytes recibidos</string> <string name="BytesReceivedReport">Reporta bytes recibidos</string>
<string name="BytesSentReport">Reporta bytes enviados</string> <string name="BytesSentReport">Reporta bytes enviados</string>
<string name="HelloSignalReport">Reporta senyal de saludo</string> <string name="HelloSignalReport">Reporta señal de saludo</string>
</resources> </resources>

View File

@ -119,6 +119,10 @@
<string name="back">back</string> <string name="back">back</string>
<string name="yes">yes</string> <string name="yes">yes</string>
<string name="no">no</string> <string name="no">no</string>
<string name="roaming_value"/>
<string name="roaming">Roaming:</string>
<string name="webname">Mobile server url:</string>
<string name="go_to_web">View Mobile site</string>
<string name="uptimeReport">Report device up time</string> <string name="uptimeReport">Report device up time</string>
<string name="NetworkOperatorReport">Report network operator</string> <string name="NetworkOperatorReport">Report network operator</string>
@ -134,7 +138,7 @@
<string name="BytesSentReport">Report amount of sent mobile data</string> <string name="BytesSentReport">Report amount of sent mobile data</string>
<string name="HelloSignalReport">Report Hello Signal</string> <string name="HelloSignalReport">Report Hello Signal</string>
<string name="BatteryLevelReport">Report battery level</string> <string name="BatteryLevelReport">Report battery level</string>
<string name="RoamingReport">Report if roaming</string>
</resources> </resources>

View File

@ -46,6 +46,7 @@ public class Core {
static volatile public String defaultServerPort = "41121"; static volatile public String defaultServerPort = "41121";
static volatile public int defaultInterval = 300; static volatile public int defaultInterval = 300;
static volatile public String defaultAgentName = "pandroid"; static volatile public String defaultAgentName = "pandroid";
static volatile public String defaultWebName = "firefly.artica.es/pandora_console/mobile";
static volatile public String defaultGpsStatus = "enabled"; // "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 defaultBatteryLevelReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultMemoryStatus = "enabled"; // "disabled" or "enabled" static volatile public String defaultMemoryStatus = "enabled"; // "disabled" or "enabled"
@ -65,6 +66,7 @@ public class Core {
static volatile public String defaultBytesReceivedReport = "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 defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled" static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultRoamingReport = "enabled"; // "disabled" or "enabled"
static volatile public boolean defaultHasSim = false; static volatile public boolean defaultHasSim = false;
@ -92,7 +94,7 @@ public class Core {
static volatile public long defaultReceiveBytes = 0; static volatile public long defaultReceiveBytes = 0;
static volatile public long defaultTransmitBytes = 0; static volatile public long defaultTransmitBytes = 0;
static volatile public int defaultHelloSignal = 2; static volatile public int defaultHelloSignal = 2;
static volatile public int defaultRoaming = 0;
//Temporary //Temporary
static volatile public String defaultPassword = ""; static volatile public String defaultPassword = "";
@ -110,7 +112,8 @@ public class Core {
static volatile public String serverAddr = defaultServerAddr; static volatile public String serverAddr = defaultServerAddr;
static volatile public String serverPort = defaultServerPort; static volatile public String serverPort = defaultServerPort;
static volatile public int interval = defaultInterval; static volatile public int interval = defaultInterval;
static volatile public String agentName = defaultAgentName; static volatile public String agentName = defaultWebName;
static volatile public String webName = defaultAgentName;
static volatile public String gpsStatus = defaultGpsStatus; static volatile public String gpsStatus = defaultGpsStatus;
static volatile public String memoryStatus = defaultMemoryStatus; static volatile public String memoryStatus = defaultMemoryStatus;
static volatile public String taskStatus = defaultTaskStatus; static volatile public String taskStatus = defaultTaskStatus;
@ -132,6 +135,8 @@ public class Core {
static volatile public String BytesSentReport = defaultBytesSentReport; static volatile public String BytesSentReport = defaultBytesSentReport;
static volatile public String HelloSignalReport = defaultHelloSignalReport; static volatile public String HelloSignalReport = defaultHelloSignalReport;
static volatile public String BatteryLevelReport = defaultHelloSignalReport; static volatile public String BatteryLevelReport = defaultHelloSignalReport;
static volatile public String RoamingReport = defaultRoamingReport;
static volatile public boolean hasSim = defaultHasSim; static volatile public boolean hasSim = defaultHasSim;
//temporary //temporary
@ -163,6 +168,7 @@ public class Core {
static volatile public long receiveBytes = defaultReceiveBytes; static volatile public long receiveBytes = defaultReceiveBytes;
static volatile public long transmitBytes = defaultTransmitBytes; static volatile public long transmitBytes = defaultTransmitBytes;
static volatile public int helloSignal = defaultHelloSignal; static volatile public int helloSignal = defaultHelloSignal;
static volatile public int roaming = defaultRoaming;
static volatile public long lastContact = CONST_INVALID_CONTACT; static volatile public long lastContact = CONST_INVALID_CONTACT;
static volatile public int contactError = CONST_CONTACT_ERROR; static volatile public int contactError = CONST_CONTACT_ERROR;
@ -244,7 +250,7 @@ public class Core {
receiveBytes = agentPreferences.getLong("receiveBytes", defaultReceiveBytes); receiveBytes = agentPreferences.getLong("receiveBytes", defaultReceiveBytes);
transmitBytes = agentPreferences.getLong("transmitBytes", defaultTransmitBytes); transmitBytes = agentPreferences.getLong("transmitBytes", defaultTransmitBytes);
helloSignal = agentPreferences.getInt("helloSignal", defaultHelloSignal); helloSignal = agentPreferences.getInt("helloSignal", defaultHelloSignal);
roaming = agentPreferences.getInt("roaming", defaultRoaming);
}// end loadLastValues }// end loadLastValues
@ -262,6 +268,7 @@ public class Core {
interval = agentPreferences.getInt("interval", defaultInterval); interval = agentPreferences.getInt("interval", defaultInterval);
//fix agent name to mark //fix agent name to mark
agentName = agentPreferences.getString("agentName", defaultAgentName+"_"+Installation.id(context)); agentName = agentPreferences.getString("agentName", defaultAgentName+"_"+Installation.id(context));
webName = agentPreferences.getString("webName", defaultWebName);
gpsStatus = agentPreferences.getString("gpsStatus", defaultGpsStatus); gpsStatus = agentPreferences.getString("gpsStatus", defaultGpsStatus);
memoryStatus = agentPreferences.getString("memoryStatus", defaultMemoryStatus); memoryStatus = agentPreferences.getString("memoryStatus", defaultMemoryStatus);
taskStatus = agentPreferences.getString("taskStatus", defaultTaskStatus); taskStatus = agentPreferences.getString("taskStatus", defaultTaskStatus);
@ -285,7 +292,7 @@ public class Core {
BytesSentReport = agentPreferences.getString("BytesSentReport", defaultBytesSentReport); BytesSentReport = agentPreferences.getString("BytesSentReport", defaultBytesSentReport);
HelloSignalReport = agentPreferences.getString("HelloSignalReport", defaultHelloSignalReport); HelloSignalReport = agentPreferences.getString("HelloSignalReport", defaultHelloSignalReport);
BatteryLevelReport = agentPreferences.getString("BatteryLevelReport", defaultBatteryLevelReport); BatteryLevelReport = agentPreferences.getString("BatteryLevelReport", defaultBatteryLevelReport);
RoamingReport = agentPreferences.getString("RoamingReport", defaultRoamingReport);
}// end loadConf }// end loadConf
@ -296,7 +303,8 @@ public class Core {
incomingCalls, missedCalls, outgoingCalls, receiveBytes, transmitBytes, password, helloSignal, incomingCalls, missedCalls, outgoingCalls, receiveBytes, transmitBytes, password, helloSignal,
passwordCheck, DeviceUpTimeReport, NetworkOperatorReport, NetworkTypeReport, PhoneTypeReport, passwordCheck, DeviceUpTimeReport, NetworkOperatorReport, NetworkTypeReport, PhoneTypeReport,
SignalStrengthReport, ReceivedSMSReport, SentSMSReport, IncomingCallsReport, MissedCallsReport, SignalStrengthReport, ReceivedSMSReport, SentSMSReport, IncomingCallsReport, MissedCallsReport,
OutgoingCallsReport, BytesReceivedReport, BytesSentReport, HelloSignalReport, BatteryLevelReport OutgoingCallsReport, BytesReceivedReport, BytesSentReport, HelloSignalReport, BatteryLevelReport,
RoamingReport, roaming, webName
); );
} }
@ -309,7 +317,7 @@ public class Core {
String _password, int _helloSignal, String _passwordCheck, String _DeviceUpTimeReport, String _NetworkOperatorReport, String _password, int _helloSignal, String _passwordCheck, String _DeviceUpTimeReport, String _NetworkOperatorReport,
String _NetworkTypeReport, String _PhoneTypeReport, String _SignalStrengthReport, String _ReceivedSMSReport, String _NetworkTypeReport, String _PhoneTypeReport, String _SignalStrengthReport, String _ReceivedSMSReport,
String _SentSMSReport, String _IncomingCallsReport, String _MissedCallsReport, String _OutgoingCallsReport, String _BytesReceivedReport, String _SentSMSReport, String _IncomingCallsReport, String _MissedCallsReport, String _OutgoingCallsReport, String _BytesReceivedReport,
String _BytesSentReport, String _HelloSignalReport, String _BatteryLevelReport) { String _BytesSentReport, String _HelloSignalReport, String _BatteryLevelReport, String _RoamingReport, int _roaming, String _webName) {
if (con == null) { if (con == null) {
con = context; con = context;
@ -346,6 +354,7 @@ public class Core {
editor.putString("password", _password); editor.putString("password", _password);
editor.putString("passwordCheck", _passwordCheck); editor.putString("passwordCheck", _passwordCheck);
editor.putInt("helloSignal", _helloSignal); editor.putInt("helloSignal", _helloSignal);
editor.putInt("roaming", _roaming);
editor.putString("DeviceUpTimeReport", _DeviceUpTimeReport); editor.putString("DeviceUpTimeReport", _DeviceUpTimeReport);
editor.putString("NetworkOperatorReport", _NetworkOperatorReport); editor.putString("NetworkOperatorReport", _NetworkOperatorReport);
editor.putString("NetworkTypeReport", _NetworkTypeReport); editor.putString("NetworkTypeReport", _NetworkTypeReport);
@ -360,6 +369,9 @@ public class Core {
editor.putString("BytesSentReport", _BytesSentReport); editor.putString("BytesSentReport", _BytesSentReport);
editor.putString("HelloSignalReport", _HelloSignalReport); editor.putString("HelloSignalReport", _HelloSignalReport);
editor.putString("BatteryLevelReport", _BatteryLevelReport); editor.putString("BatteryLevelReport", _BatteryLevelReport);
editor.putString("RoamingReport", _RoamingReport);
editor.putString("webName", _webName);
if (editor.commit()) { if (editor.commit()) {
return true; return true;
} }

View File

@ -17,7 +17,6 @@ package pandroid.agent;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
//import android.util.Log;
public class EventReceiver extends BroadcastReceiver { public class EventReceiver extends BroadcastReceiver {

View File

@ -53,7 +53,6 @@ import android.os.SystemClock;
import android.telephony.PhoneStateListener; import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength; import android.telephony.SignalStrength;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.util.Log; import android.util.Log;
public class PandroidAgentListener extends Service { public class PandroidAgentListener extends Service {
@ -191,6 +190,8 @@ public class PandroidAgentListener extends Service {
String receiveBytes = getSharedData("PANDROID_DATA", "receiveBytes", ""+Core.defaultReceiveBytes, "long"); String receiveBytes = getSharedData("PANDROID_DATA", "receiveBytes", ""+Core.defaultReceiveBytes, "long");
String transmitBytes = getSharedData("PANDROID_DATA", "transmitBytes", ""+Core.defaultTransmitBytes, "long"); String transmitBytes = getSharedData("PANDROID_DATA", "transmitBytes", ""+Core.defaultTransmitBytes, "long");
String helloSignal = getSharedData("PANDROID_DATA", "helloSignal", ""+Core.defaultHelloSignal, "integer"); String helloSignal = getSharedData("PANDROID_DATA", "helloSignal", ""+Core.defaultHelloSignal, "integer");
String roaming = getSharedData("PANDROID_DATA", "roaming", ""+Core.defaultRoaming, "integer");
String SimIDReport = getSharedData("PANDROID_DATA", "SimIDReport", Core.defaultSimIDReport, "string"); String SimIDReport = getSharedData("PANDROID_DATA", "SimIDReport", Core.defaultSimIDReport, "string");
String DeviceUpTimeReport = getSharedData("PANDROID_DATA", "DeviceUpTimeReport", Core.defaultDeviceUpTimeReport, "string"); String DeviceUpTimeReport = getSharedData("PANDROID_DATA", "DeviceUpTimeReport", Core.defaultDeviceUpTimeReport, "string");
String NetworkOperatorReport = getSharedData("PANDROID_DATA", "NetworkOperatorReport", Core.defaultNetworkOperatorReport, "string"); String NetworkOperatorReport = getSharedData("PANDROID_DATA", "NetworkOperatorReport", Core.defaultNetworkOperatorReport, "string");
@ -206,6 +207,7 @@ public class PandroidAgentListener extends Service {
String BytesSentReport = getSharedData("PANDROID_DATA", "BytesSentReport", Core.defaultBytesSentReport, "string"); String BytesSentReport = getSharedData("PANDROID_DATA", "BytesSentReport", Core.defaultBytesSentReport, "string");
String HelloSignalReport = getSharedData("PANDROID_DATA", "HelloSignalReport", Core.defaultHelloSignalReport, "string"); String HelloSignalReport = getSharedData("PANDROID_DATA", "HelloSignalReport", Core.defaultHelloSignalReport, "string");
String BatteryLevelReport = getSharedData("PANDROID_DATA", "BatteryLevelReport", Core.defaultBatteryLevelReport, "string"); String BatteryLevelReport = getSharedData("PANDROID_DATA", "BatteryLevelReport", Core.defaultBatteryLevelReport, "string");
String RoamingReport = getSharedData("PANDROID_DATA", "RoamingReport", Core.defaultRoamingReport, "string");
if (BatteryLevelReport.equals("enabled")) if (BatteryLevelReport.equals("enabled"))
buffer += buildmoduleXML("battery_level", "The current Battery level", "generic_data", batteryLevel); buffer += buildmoduleXML("battery_level", "The current Battery level", "generic_data", batteryLevel);
@ -267,6 +269,8 @@ public class PandroidAgentListener extends Service {
buffer += buildmoduleXML("receiveBytes","Bytes received(mobile)", "generic_data", receiveBytes); buffer += buildmoduleXML("receiveBytes","Bytes received(mobile)", "generic_data", receiveBytes);
if (BytesSentReport.equals("enabled")) if (BytesSentReport.equals("enabled"))
buffer += buildmoduleXML("transmitBytes","Bytes transmitted(mobile)", "generic_data", transmitBytes); buffer += buildmoduleXML("transmitBytes","Bytes transmitted(mobile)", "generic_data", transmitBytes);
if (RoamingReport.equals("enabled"))
buffer += buildmoduleXML("roaming","Device is roaming", "generic_data", roaming);
}// end if sim card }// end if sim card
if (HelloSignalReport.equals("enabled")) if (HelloSignalReport.equals("enabled"))
buffer += buildmoduleXML("helloSignal","Hello Signal", "generic_data", helloSignal); buffer += buildmoduleXML("helloSignal","Hello Signal", "generic_data", helloSignal);
@ -472,6 +476,7 @@ public class PandroidAgentListener extends Service {
getSignalStrength(); getSignalStrength();
getCalls(); getCalls();
getDataBytes(); getDataBytes();
getRoaming();
} }
} }
@ -788,6 +793,18 @@ public class PandroidAgentListener extends Service {
} }
public void getRoaming()
{
TelephonyManager telephone = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
boolean roaming = telephone.isNetworkRoaming();
if(roaming)
putSharedData("PANDROID_DATA", "roaming", "1", "integer" );
else
putSharedData("PANDROID_DATA", "roaming", "0", "integer" );
}
private void putSharedData(String preferenceName, String tokenName, String data, String type) { private void putSharedData(String preferenceName, String tokenName, String data, String type) {
int mode = Activity.MODE_PRIVATE; int mode = Activity.MODE_PRIVATE;

View File

@ -17,7 +17,6 @@ package pandroid.agent;
import android.app.Activity; import android.app.Activity;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;

View File

@ -25,24 +25,27 @@ import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.Toast; import android.widget.Toast;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.text.TextUtils;
import android.util.Log;
public class Setup extends Activity { public class Setup extends Activity {
@ -60,28 +63,47 @@ public class Setup extends Activity {
listProcesses = new HashMap<String, String>(); listProcesses = new HashMap<String, String>();
Core.loadConf(getApplicationContext()); Core.loadConf(getApplicationContext());
if(Core.hasSim)
setContentView(R.layout.setup);
else
setContentView(R.layout.setupnosim);
loadViews();
loadInBackgroundProcessInExecution();
setButtonEvents();
} }
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
Log.v(LOG_TAG,"password check resume"+Core.passwordCheck);
if(Core.hasSim)
setContentView(R.layout.setup);
else
setContentView(R.layout.setupnosim);
loadViews();
loadInBackgroundProcessInExecution();
setButtonEvents();
if(Core.password.equals(Core.defaultPassword)) if(Core.password.equals(Core.defaultPassword))
{ {
if(Core.passwordCheck.equals("enabled")) if(Core.passwordCheck.equals("enabled"))
passwordChoose(); passwordChoose();
}
else{ }else{
LayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
View view=inflater.inflate(R.layout.setup, null);
RelativeLayout setup = (RelativeLayout)view.findViewById(R.id.setup);
setContentView(setup);
setup.setVisibility(RelativeLayout.INVISIBLE);
enterpass(); enterpass();
} }
} }
//For options //For options
@ -146,6 +168,20 @@ public class Setup extends Activity {
} }
});
Button webButton = (Button) findViewById(R.id.goToWebButton);
webButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
Uri uri = Uri.parse(Core.webName);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
}); });
}// end setButtonEvents }// end setButtonEvents
@ -239,6 +275,9 @@ public class Setup extends Activity {
button = (Button)findViewById(R.id.set_password); button = (Button)findViewById(R.id.set_password);
button.setEnabled(true); button.setEnabled(true);
button = (Button)findViewById(R.id.goToWebButton);
button.setEnabled(true);
} }
}// end onPostExecute }// end onPostExecute
@ -262,6 +301,9 @@ public class Setup extends Activity {
editText = (EditText) findViewById(R.id.agentNameInput); editText = (EditText) findViewById(R.id.agentNameInput);
Core.agentName = editText.getText().toString(); Core.agentName = editText.getText().toString();
editText = (EditText) findViewById(R.id.webNameInput);
Core.webName = editText.getText().toString();
checkBox = (CheckBox) findViewById(R.id.checkGpsReport); checkBox = (CheckBox) findViewById(R.id.checkGpsReport);
if (checkBox.isChecked()) if (checkBox.isChecked())
@ -379,6 +421,12 @@ public class Setup extends Activity {
Core.BytesSentReport = "enabled"; Core.BytesSentReport = "enabled";
else else
Core.BytesSentReport = "disabled"; Core.BytesSentReport = "disabled";
checkBox = (CheckBox) findViewById(R.id.checkRoamingReport);
if (checkBox.isChecked())
Core.RoamingReport = "enabled";
else
Core.RoamingReport = "disabled";
}// end if sim card }// end if sim card
checkBox = (CheckBox) findViewById(R.id.checkHelloSignalReport); checkBox = (CheckBox) findViewById(R.id.checkHelloSignalReport);
@ -406,6 +454,9 @@ public class Setup extends Activity {
editText = (EditText) findViewById(R.id.agentNameInput); editText = (EditText) findViewById(R.id.agentNameInput);
editText.setText(Core.agentName); editText.setText(Core.agentName);
editText = (EditText) findViewById(R.id.webNameInput);
editText.setText(Core.webName);
checkBox = (CheckBox) findViewById(R.id.checkGpsReport); checkBox = (CheckBox) findViewById(R.id.checkGpsReport);
checkBox.setChecked(Core.gpsStatus.equals("enabled")); checkBox.setChecked(Core.gpsStatus.equals("enabled"));
@ -459,6 +510,9 @@ public class Setup extends Activity {
checkBox = (CheckBox) findViewById(R.id.checkBytesSentReport); checkBox = (CheckBox) findViewById(R.id.checkBytesSentReport);
checkBox.setChecked(Core.BytesSentReport.equals("enabled")); checkBox.setChecked(Core.BytesSentReport.equals("enabled"));
checkBox = (CheckBox) findViewById(R.id.checkRoamingReport);
checkBox.setChecked(Core.RoamingReport.equals("enabled"));
}//end if sim card }//end if sim card
checkBox = (CheckBox) findViewById(R.id.checkHelloSignalReport); checkBox = (CheckBox) findViewById(R.id.checkHelloSignalReport);
@ -617,11 +671,12 @@ public class Setup extends Activity {
public void enterpass() { public void enterpass() {
//set up dialog //set up dialog
final Dialog dialog = new Dialog(this); final Dialog dialog = new Dialog(this,android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.setContentView(R.layout.password_entry); dialog.setContentView(R.layout.password_entry);
dialog.setTitle(getString(R.string.password_enter)); dialog.setTitle(getString(R.string.password_enter));
dialog.setCancelable(false); dialog.setCancelable(false);
dialog.getWindow().setSoftInputMode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); dialog.getWindow().setSoftInputMode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
dialog.getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN, LayoutParams.FLAG_FULLSCREEN);
//there are a lot of settings, for dialog, check them all out! //there are a lot of settings, for dialog, check them all out!
//set up text //set up text
@ -645,6 +700,29 @@ public class Setup extends Activity {
InputMethodManager im = (InputMethodManager)getSystemService(getApplicationContext().INPUT_METHOD_SERVICE); InputMethodManager im = (InputMethodManager)getSystemService(getApplicationContext().INPUT_METHOD_SERVICE);
im.hideSoftInputFromWindow(text.getWindowToken(), 0); im.hideSoftInputFromWindow(text.getWindowToken(), 0);
dialog.dismiss(); dialog.dismiss();
if(Core.hasSim){
LayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
View view=inflater.inflate(R.layout.setup, null);
RelativeLayout setup = (RelativeLayout)view.findViewById(R.id.setup);
setContentView(setup);
loadViews();
loadInBackgroundProcessInExecution();
setButtonEvents();
setup.setVisibility(RelativeLayout.VISIBLE);
}
else{
LayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
View view=inflater.inflate(R.layout.setupnosim, null);
RelativeLayout setupnosim = (RelativeLayout)view.findViewById(R.id.setupnosim);
setContentView(setupnosim);
loadViews();
loadInBackgroundProcessInExecution();
setButtonEvents();
setupnosim.setVisibility(RelativeLayout.VISIBLE);
}
} }
else else
{ {
@ -676,7 +754,7 @@ public class Setup extends Activity {
}); });
dialog.show(); dialog.show();
}// end enterPass }// end enterPass
/** /**

View File

@ -17,7 +17,8 @@ package pandroid.agent;
import java.util.Date; import java.util.Date;
import android.app.Activity; import android.app.Activity;
import android.content.*; import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -28,7 +29,6 @@ import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
//import android.util.Log; //import android.util.Log;
@ -71,7 +71,7 @@ public class Status extends Activity {
h.postDelayed(this, 1000); h.postDelayed(this, 1000);
} }
}); });
//set to 1 for first contact
} }
//For options //For options
@ -345,6 +345,10 @@ public class Status extends Activity {
textView = (TextView)findViewById(R.id.transmit_bytes_value); textView = (TextView)findViewById(R.id.transmit_bytes_value);
textView.setText(""); textView.setText("");
textView.setText("" + Core.transmitBytes); textView.setText("" + Core.transmitBytes);
textView = (TextView)findViewById(R.id.roaming_value);
textView.setText("");
textView.setText("" + Core.roaming);
}//end simID if }//end simID if