2013-05-01 Mark Holland <mark@mark-holland.me.uk>

* Connect to new svn


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8092 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
markholland 2013-05-01 02:05:27 +00:00
parent b2c0ec28a9
commit 1a933356a2
12 changed files with 217 additions and 160 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -14,23 +14,21 @@
// 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="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dip"
>
android:padding="10dip" >
<ImageView
android:layout_weight="0"
android:id="@+id/img_logo_about"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center"
android:padding="5dp"
android:contentDescription="@string/about_desc"
android:src="@drawable/pandorafms_logo"
/>
android:id="@+id/img_logo_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0"
android:contentDescription="@string/about_desc"
android:src="@drawable/pandorafms_logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@ -106,7 +106,8 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:singleLine="true" />
android:maxLines="1"
/>
<TextView
android:id="@+id/field6"

View File

@ -20,10 +20,11 @@
android:layout_height="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="5dp" >
<LinearLayout
android:layout_width="fill_parent"
@ -37,7 +38,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/last_values"
android:textSize="18dip"
android:textSize="18sp"
android:textStyle="bold"
/>
@ -50,7 +51,7 @@
android:id="@+id/lastContactInfo_label_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -59,7 +60,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="5px"
android:padding="5dp"
android:src="@drawable/logo"
/>
@ -69,7 +70,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/lastContactInfo_label_str"
android:text="@string/latitude"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -86,7 +87,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/latitude_value_str"
android:text="@string/longitude"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -103,7 +104,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/longitude_value_str"
android:text="@string/battery_level"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -153,7 +154,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/task"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -168,7 +169,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/memory"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -180,7 +181,7 @@
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1.18"
>
<TableRow
@ -193,7 +194,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/uptime"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -214,7 +215,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sim_id"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -236,7 +237,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/network_operator"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
android:paddingRight="5dip"
/>
@ -259,7 +260,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/network_type"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -282,7 +283,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/phone_type"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -304,7 +305,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/signal_strength"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -326,7 +327,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sms_received"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -348,7 +349,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sms_sent"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -370,7 +371,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/incoming_calls"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -392,7 +393,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/missed_calls"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -414,7 +415,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/outgoing_calls"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -436,7 +437,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/receive_bytes"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -458,7 +459,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/transmit_bytes"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
@ -479,7 +480,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/roaming"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>

View File

@ -19,10 +19,12 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="5sp" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
@ -33,7 +35,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/last_values"
android:textSize="18dip"
android:textSize="18sp"
android:textStyle="bold"
android:layout_gravity="center_horizontal"
/>
@ -45,23 +47,24 @@
android:id="@+id/lastContactInfo_label_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
<ImageView
android:id="@+id/img_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5px"
android:padding="5dp"
android:src="@drawable/logo"
android:layout_alignParentRight="true"
android:contentDescription="Logo"
/>
<TextView
android:id="@+id/latitude_label_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/latitude"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
android:layout_below="@id/lastContactInfo_label_str"
/>
@ -77,7 +80,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/longitude"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
android:layout_below="@id/latitude_value_str"
/>
@ -92,7 +95,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/battery_level"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
android:layout_below="@id/longitude_value_str"
/>
@ -138,7 +141,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/task"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
<TextView
@ -151,7 +154,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/memory"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold"
/>
<TextView
@ -164,7 +167,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/uptime"
android:textSize="14dip"
android:textSize="14sp"
android:textStyle="bold" />
<TextView

View File

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/ImageView1"
android:layout_width="wrap_content"
@ -14,18 +14,22 @@
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:contentDescription="Pandroid logo"
android:paddingTop="20px"
android:paddingTop="20dp"
android:src="@drawable/pandroid_large" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ImageView1"
android:layout_centerHorizontal="true"
android:paddingTop="20px"
android:paddingTop="20dp"
android:text="Version 3.0"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="40px" />
android:textSize="40sp" />
</RelativeLayout>

View File

@ -41,6 +41,10 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.database.Cursor;
import android.location.Criteria;
import android.location.Location;
@ -68,7 +72,13 @@ public class PandroidAgentListener extends Service {
Handler h = new Handler();
String lastGpsContactDateTime = "";
boolean showLastXML = true;
double latitude;
double longitude;
//boolean showLastXML = true;
private LocationManager locmgr = null;
@Override
public void onCreate() {
@ -222,8 +232,8 @@ public class PandroidAgentListener extends Service {
}
new contactTask().execute(xml);
updateValues();
//TODO ensure not a problem
//updateValues();
}//end contact
@ -270,7 +280,7 @@ public class PandroidAgentListener extends Service {
file.delete();
if (Core.helloSignal >= 1)
Core.helloSignal = 0;
Core.updateConf(getApplicationContext());
Core.updateConf(getApplicationContext());
}
if(tentacleRet == -1){
@ -308,7 +318,6 @@ public class PandroidAgentListener extends Service {
File file = new File("/data/data/pandroid.agent/files/" + buffer[i]);
bufferSize += file.length();
}
Log.d("Buffer size:",""+bufferSize);
//Check if size of buffer is less than a value
if((bufferSize/1024) < Core.bufferSize){
@ -551,67 +560,101 @@ public class PandroidAgentListener extends Service {
return module_xml;
}
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());
/* Loop over the array backwards, and if you get an accurate location, then break out the loop*/
Location loc = null;
for (int i=providers.size()-1; i>=0; i--) {
Log.d("PANDROID providers", providers.get(i));
loc = lm.getLastKnownLocation(providers.get(i));
if (loc != null) break;
}
if (loc != null) {
Log.d("PANDROID", "loc != null");
//if(latitude != loc.getLatitude() || longitude != loc.getLongitude()) {
lastGpsContactDateTime = getHumanDateTime(-1);
//}
putSharedData("PANDROID_DATA", "latitude", Double.valueOf(loc.getLatitude()).toString(), "float");
putSharedData("PANDROID_DATA", "longitude", Double.valueOf(loc.getLongitude()).toString(), "float");
}
else {
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE);
criteria.setPowerRequirement(Criteria.POWER_LOW);
criteria.setAltitudeRequired(false);
criteria.setBearingRequired(false);
criteria.setCostAllowed(true);
String bestProvider = lm.getBestProvider(criteria, true);
// If not provider found, abort GPS retrieving
if (bestProvider == null) {
Log.e("LOCATION", "No location provider found!");
return;
}
lm.requestLocationUpdates(bestProvider, Core.defaultInterval, 1000,
new LocationListener() {
public void onLocationChanged(Location location) {
putSharedData("PANDROID_DATA", "latitude",
Double.valueOf(location.getLatitude()).toString(), "float");
putSharedData("PANDROID_DATA", "longitude",
Double.valueOf(location.getLongitude()).toString(), "float");
}
public void onStatusChanged(String s, int i, Bundle bundle) {
}
public void onProviderEnabled(String s) {
// try switching to a different provider
}
public void onProviderDisabled(String s) {
putSharedData("PANDROID_DATA", "enabled_location_provider",
"disabled", "string");
}
});
}
private void gpsLocation(){
}
//Start a location listener
LocationListener onLocationChange=new LocationListener() {
public void onLocationChanged(Location loc) {
Log.d("latitude",""+loc.getLatitude());
Log.d("Longitude",""+loc.getLongitude());
}
public void onProviderDisabled(String provider) {
// required for interface, not used
}
public void onProviderEnabled(String provider) {
// required for interface, not used
}
public void onStatusChanged(String provider, int status,
Bundle extras) {
// required for interface, not used
}
};
locmgr.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,10000.0f,onLocationChange);
}
// 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());
//
//// /* Loop over the array backwards, and if you get an accurate location, then break out the loop*/
//// Location loc = null;
////
//// for (int i=providers.size()-1; i>=0; i--) {
//// Log.d("PANDROID providers", providers.get(i));
//// loc = lm.getLastKnownLocation(providers.get(i));
//// if (loc != null) break;
//// }
////
//// if (loc != null) {
//// Log.d("PANDROID", "loc != null");
//// //if(latitude != loc.getLatitude() || longitude != loc.getLongitude()) {
//// lastGpsContactDateTime = getHumanDateTime(-1);
//// //`}
//// Log.d("LATITUDE",Double.valueOf(loc.getLatitude()).toString());
//// Log.d("LONGITUDE",Double.valueOf(loc.getLongitude()).toString());
//// putSharedData("PANDROID_DATA", "latitude", Double.valueOf(loc.getLatitude()).toString(), "float");
//// putSharedData("PANDROID_DATA", "longitude", Double.valueOf(loc.getLongitude()).toString(), "float");
//// }
//// else {
// Criteria criteria = new Criteria();
// criteria.setAccuracy(Criteria.ACCURACY_COARSE);
// criteria.setPowerRequirement(Criteria.POWER_LOW);
// criteria.setAltitudeRequired(false);
// criteria.setBearingRequired(false);
// criteria.setCostAllowed(true);
// String bestProvider = lm.getBestProvider(criteria, true);
//
// // If not provider found, abort GPS retrieving
// if (bestProvider == null) {
// Log.e("LOCATION", "No location provider found!");
// return;
// }
//
// lm.requestLocationUpdates(bestProvider, Core.defaultInterval, 1000,
// new LocationListener() {
// public void onLocationChanged(Location location) {
// Log.d("Best latitude", Double.valueOf(location.getLatitude()).toString());
// putSharedData("PANDROID_DATA", "latitude",
// Double.valueOf(location.getLatitude()).toString(), "float");
// Log.d("Best longitude", Double.valueOf(location.getLongitude()).toString());
// putSharedData("PANDROID_DATA", "longitude",
// Double.valueOf(location.getLongitude()).toString(), "float");
// }
// public void onStatusChanged(String s, int i, Bundle bundle) {
//
// }
// public void onProviderEnabled(String s) {
// // try switching to a different provider
// }
// public void onProviderDisabled(String s) {
// putSharedData("PANDROID_DATA", "enabled_location_provider",
// "disabled", "string");
// }
// });
// //}
//
// }
private void batteryLevel() {
@ -1137,30 +1180,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 */
}

View File

@ -192,7 +192,7 @@ class tentacle_client {
}
private void log (String msg) {
Log.e("Tentacle",msg);
//Log.e("Tentacle",msg);
//Context context = getApplicationContext();
//int duration = Toast.LENGTH_SHORT;

View File

@ -29,8 +29,8 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@ -53,6 +53,8 @@ import android.widget.Toast;
public class Setup extends Activity {
Handler h = new Handler();
private HashMap<String, String> listProcesses;
@Override
@ -60,7 +62,8 @@ public class Setup extends Activity {
super.onCreate(savedInstanceState);
listProcesses = new HashMap<String, String>();
Core.loadConf(getApplicationContext());
//TODO removed to improve performance, untested
//Core.loadConf(getApplicationContext());
}
public void onResume() {
@ -71,10 +74,11 @@ public class Setup extends Activity {
else
setContentView(R.layout.setupnosim);
loadViews();
loadViews();
loadInBackgroundProcessInExecution();
setButtonEvents();
setButtonEvents();
if(Core.password.equals(Core.defaultPassword))
{
if(Core.passwordCheck.equals("enabled"))

View File

@ -40,9 +40,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
@ -54,10 +54,13 @@ public class Status extends Activity {
setContentView(R.layout.status);
else
setContentView(R.layout.statusnosim);
Core.loadLastValues(getApplicationContext());
showLastValues();
updateLastContactInfo();
}
public void onStart(){