2013-12-11 Miguel de Dios <miguel.dedios@artica.es>

* tablet/src/pandroid/agent/PandroidAgentListener.java,

	tablet/src/pandroid/agent/Core.java,

	tablet/src/pandroid/agent/Setup.java,

	tablet/res/layout/setupnosim.xml: added modules for to check the

	bytes send and receive.

	

	* mobile/res/drawable-xhdpi/about.png,

	mobile/res/drawable-xhdpi/help.png,

	mobile/res/drawable-hdpi/help.png,

	mobile/res/drawable-hdpi/about.png,

	mobile/res/drawable-ldpi/help.png,

	mobile/res/drawable-ldpi/about.png: update the icons, thanks Carla.






git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9208 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-12-11 12:45:11 +00:00
parent fd3228dbc9
commit fc92ed1c62
11 changed files with 115 additions and 8 deletions

View File

@ -1,4 +1,19 @@
2013-08-11 Miguel de Dios <miguel.dedios@artica.es>
2013-12-11 Miguel de Dios <miguel.dedios@artica.es>
* tablet/src/pandroid/agent/PandroidAgentListener.java,
tablet/src/pandroid/agent/Core.java,
tablet/src/pandroid/agent/Setup.java,
tablet/res/layout/setupnosim.xml: added modules for to check the
bytes send and receive.
* mobile/res/drawable-xhdpi/about.png,
mobile/res/drawable-xhdpi/help.png,
mobile/res/drawable-hdpi/help.png,
mobile/res/drawable-hdpi/about.png,
mobile/res/drawable-ldpi/help.png,
mobile/res/drawable-ldpi/about.png: update the icons, thanks Carla.
2013-12-11 Miguel de Dios <miguel.dedios@artica.es>
* mobile/src/pandroid/agent/Setup.java,
mobile/res/drawable-mdpi/help.png,
@ -8,20 +23,20 @@
tablet/res/drawable-mdpi/about.png, tablet/res/layout/about.xml,
tablet/res/values-es/strings.xml: some changes.
2013-08-10 Miguel de Dios <miguel.dedios@artica.es>
2013-12-10 Miguel de Dios <miguel.dedios@artica.es>
* tablet/*: updated the tablet version.
2013-08-10 Miguel de Dios <miguel.dedios@artica.es>
2013-12-10 Miguel de Dios <miguel.dedios@artica.es>
* mobile/AndroidManifest.xml: update the version number, and added
tiny hack to make diferent apk for google market.
2013-08-09 Miguel de Dios <miguel.dedios@artica.es>
2013-12-09 Miguel de Dios <miguel.dedios@artica.es>
* mobile/src/pandroid/agent/Core.java: fixed the copy & paste bug.
2013-08-09 Miguel de Dios <miguel.dedios@artica.es>
2013-12-09 Miguel de Dios <miguel.dedios@artica.es>
* mobile: moved the all code of android to this folder.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -188,6 +188,22 @@
android:text="@string/uptimeReport"
android:textColor="#bbbbbb"
android:textSize="14sp" />
<CheckBox
android:id="@+id/checkBytesReceivedReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/BytesReceivedReport"
android:textColor="#bbbbbb"
android:textSize="14sp" />
<CheckBox
android:id="@+id/checkBytesSentReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/BytesSentReport"
android:textColor="#bbbbbb"
android:textSize="14sp" />
<CheckBox
android:id="@+id/checkInventoryReport"

View File

@ -57,7 +57,8 @@ public class Core {
static volatile public String defaultInventoryReport = "disabled"; // "disabled" or "enabled"
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultNotificationCheck = "enabled"; // "disabled" or "enabled"
static volatile public String defaultBytesReceivedReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
// //
// DEFAULT MODULE VALUES //
@ -71,6 +72,9 @@ public class Core {
static volatile public int defaultContactError = 0;
static volatile public long defaultUpTime = 0;
static volatile public int defaultHelloSignal = 2;
static volatile public long defaultReceiveBytes = 0;
static volatile public long defaultTransmitBytes = 0;
static volatile public String defaultPassword = "";
@ -122,6 +126,11 @@ public class Core {
static volatile public long lastContact = CONST_INVALID_CONTACT;
static volatile public int contactError = CONST_CONTACT_ERROR;
static volatile public String BytesReceivedReport = defaultBytesReceivedReport;
static volatile public String BytesSentReport = defaultBytesSentReport;
static volatile public long receiveBytes = defaultReceiveBytes;
static volatile public long transmitBytes = defaultTransmitBytes;
public Core() {
@ -181,6 +190,9 @@ public class Core {
upTime = agentPreferences.getLong("upTime", Core.defaultUpTime);
helloSignal = agentPreferences.getInt("helloSignal", defaultHelloSignal);
contactError = agentPreferences.getInt("contactError", defaultContactError);
receiveBytes = agentPreferences.getLong("receiveBytes", defaultReceiveBytes);
transmitBytes = agentPreferences.getLong("transmitBytes", defaultTransmitBytes);
}// end loadLastValues
@ -238,7 +250,11 @@ public class Core {
HelloSignalReport,
password,
passwordCheck,
NotificationCheck
NotificationCheck,
receiveBytes,
BytesReceivedReport,
transmitBytes,
BytesSentReport
);
}// end updateConf
@ -263,7 +279,11 @@ public class Core {
String _HelloSignalReport,
String _password,
String _passwordCheck,
String _NotificationCheck ) {
String _NotificationCheck,
long _receiveBytes,
String _BytesReceivedReport,
long _transmitBytes,
String _BytesSentReport) {
if (con == null) {
con = context;
@ -293,6 +313,11 @@ public class Core {
editor.putString("HelloSignalReport", _HelloSignalReport);
editor.putString("password", _password);
editor.putString("passwordCheck", _passwordCheck);
editor.putLong("receiveBytes", _receiveBytes);
editor.putString("BytesReceivedReport", _BytesReceivedReport);
editor.putLong("transmitBytes", _transmitBytes);
editor.putString("BytesSentReport", _BytesSentReport);
if (editor.commit()) {

View File

@ -44,6 +44,7 @@ import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.TrafficStats;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
@ -405,10 +406,16 @@ public class PandroidAgentListener extends Service {
String helloSignal = getSharedData("PANDROID_DATA", "helloSignal", ""+Core.defaultHelloSignal, "integer");
String receiveBytes = getSharedData("PANDROID_DATA", "receiveBytes", ""+Core.defaultReceiveBytes, "long");
String transmitBytes = getSharedData("PANDROID_DATA", "transmitBytes", ""+Core.defaultTransmitBytes, "long");
String DeviceUpTimeReport = getSharedData("PANDROID_DATA", "DeviceUpTimeReport", Core.defaultDeviceUpTimeReport, "string");
String HelloSignalReport = getSharedData("PANDROID_DATA", "HelloSignalReport", Core.defaultHelloSignalReport, "string");
String BatteryLevelReport = getSharedData("PANDROID_DATA", "BatteryLevelReport", Core.defaultBatteryLevelReport, "string");
String InventoryReport = getSharedData("PANDROID_DATA", "InventoryReport", Core.defaultInventoryReport, "string");
String BytesReceivedReport = getSharedData("PANDROID_DATA", "BytesReceivedReport", Core.defaultBytesReceivedReport, "string");
String BytesSentReport = getSharedData("PANDROID_DATA", "BytesSentReport", Core.defaultBytesSentReport, "string");
if (InventoryReport.equals("enabled"))
{
@ -452,6 +459,11 @@ public class PandroidAgentListener extends Service {
if (HelloSignalReport.equals("enabled"))
buffer += buildmoduleXML("helloSignal","Hello Signal", "generic_data", helloSignal);
if (BytesReceivedReport.equals("enabled"))
buffer += buildmoduleXML("receiveBytes","Bytes received", "generic_data", receiveBytes);
if (BytesSentReport.equals("enabled"))
buffer += buildmoduleXML("transmitBytes","Bytes transmitted", "generic_data", transmitBytes);
buffer += "</agent_data>";
@ -695,6 +707,8 @@ public class PandroidAgentListener extends Service {
getTaskStatus();
getMemoryStatus();
getUpTime();
getDataBytes();
}
private void getMemoryStatus() {
@ -873,6 +887,21 @@ public class PandroidAgentListener extends Service {
nMgr.cancel(notifyId);
}
/**
* Retrieves the number of sent/received bytes using the mobile network
*/
private void getDataBytes()
{
long receiveBytes = TrafficStats.getTotalRxBytes();
long transmitBytes = TrafficStats.getTotalTxBytes();
if (receiveBytes != TrafficStats.UNSUPPORTED && transmitBytes != TrafficStats.UNSUPPORTED)
{
putSharedData("PANDROID_DATA", "receiveBytes", ""+receiveBytes, "long" );
putSharedData("PANDROID_DATA", "transmitBytes", ""+transmitBytes, "long" );
}
}
// ///////////////////////////////////////////

View File

@ -368,6 +368,20 @@ public class Setup extends Activity {
Core.HelloSignalReport = "enabled";
else
Core.HelloSignalReport = "disabled";
// bytesReceivedReport
checkBox = (CheckBox) findViewById(R.id.checkBytesReceivedReport);
if (checkBox.isChecked())
Core.BytesReceivedReport = "enabled";
else
Core.BytesReceivedReport = "disabled";
// bytesSentReport
checkBox = (CheckBox) findViewById(R.id.checkBytesSentReport);
if (checkBox.isChecked())
Core.BytesSentReport = "enabled";
else
Core.BytesSentReport = "disabled";
// update saved values with new ones retrieved from view
Core.updateConf(getApplicationContext());
@ -429,6 +443,14 @@ public class Setup extends Activity {
// inventoryReport
checkBox = (CheckBox) findViewById(R.id.checkInventoryReport);
checkBox.setChecked(Core.InventoryReport.equals("enabled"));
// bytesReceivedReport
checkBox = (CheckBox) findViewById(R.id.checkBytesReceivedReport);
checkBox.setChecked(Core.BytesReceivedReport.equals("enabled"));
// bytesSentReport
checkBox = (CheckBox) findViewById(R.id.checkBytesSentReport);
checkBox.setChecked(Core.BytesSentReport.equals("enabled"));
// helloSignalReport
checkBox = (CheckBox) findViewById(R.id.checkHelloSignalReport);