2011-02-10 Sergio Martin <sergio.martin@artica.es>

* android/src/pandroid/agent/PandroidAgent.java
	android/bin/Copy of Copy of Pandroid Agent.apk
	android/res/drawable-ldpi/logo.png
	android/res/drawable-ldpi/icon.png
	android/res/drawable-mdpi/logo.png
	android/res/drawable-mdpi/icon.png: Removed an unecessary apk
	file, added icons and logos to low and middle quality, 
	fixed xml file deletion, setted farscape as default host 
	and added to the default agent name a unique identifier



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3820 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-02-10 16:22:51 +00:00
parent c7e7cd1116
commit cb4a58d830
8 changed files with 34 additions and 5 deletions

View File

@ -1,3 +1,15 @@
2011-02-10 Sergio Martin <sergio.martin@artica.es>
* android/src/pandroid/agent/PandroidAgent.java
android/bin/Copy of Copy of Pandroid Agent.apk
android/res/drawable-ldpi/logo.png
android/res/drawable-ldpi/icon.png
android/res/drawable-mdpi/logo.png
android/res/drawable-mdpi/icon.png: Removed an unecessary apk
file, added icons and logos to low and middle quality,
fixed xml file deletion, setted farscape as default host
and added to the default agent name a unique identifier
2011-02-07 Sergio Martin <sergio.martin@artica.es>
* android/.project

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -19,6 +19,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.ComponentName;
import android.graphics.Color;
import android.telephony.TelephonyManager;
import java.util.Date;
import java.lang.Thread;
@ -28,8 +29,8 @@ public class PandroidAgent extends Activity {
int defaultInterval = 300;
String defaultServerPort = "41121";
String defaultServerAddr = "10.0.2.2";
String defaultAgentName = "pandroidAgent";
String defaultServerAddr = "farscape.artica.es";
String defaultAgentName = "pandroid";
String defaultGpsStatus = "disabled"; // "disabled" or "enabled"
boolean alarmEnabled;
@ -46,7 +47,10 @@ public class PandroidAgent extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);
// Customize the agent name with the unique Sim ID
defaultAgentName += getSimID();
// Load the stored data into views
loadViews();
@ -82,6 +86,13 @@ public class PandroidAgent extends Activity {
}
}
public String getSimID() {
String simID = null;
String serviceName = Context.TELEPHONY_SERVICE;
TelephonyManager m_telephonyManager = (TelephonyManager) getSystemService(serviceName);
simID = m_telephonyManager.getSimSerialNumber();
return simID;
}
private void putSharedData(String preferenceName, String tokenName, String data, String type) {
int mode = Activity.MODE_PRIVATE;

View File

@ -28,7 +28,10 @@ import android.os.Handler;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.OutputStream;
import java.util.Calendar;
public class PandroidAgentListener extends Service {
@ -89,7 +92,10 @@ public class PandroidAgentListener extends Service {
};
int tentacleRet = new tentacle_client().tentacle_client(tentacleData);
//int tentacleRet = 0;
// 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");
@ -143,7 +149,7 @@ public class PandroidAgentListener extends Service {
FileOutputStream fOut = openFileOutput(fileName,
MODE_WORLD_READABLE);
OutputStreamWriter osw = new OutputStreamWriter(fOut);
// Write the string to the file
osw.write(textToWrite);
/* ensure that everything is