From bdab7d8a0220671ac72d2fee2c46e326a5234a2e Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Wed, 15 Oct 2008 17:41:50 -0700 Subject: [PATCH] Updating the Android permissions so we can access all the info we need --- AndroidManifest.xml | 8 ++++++++ src/com/android/droidgap/PhoneGap.java | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 326dab12..9b92f368 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -3,6 +3,13 @@ package="com.android.droidgap" android:versionCode="1" android:versionName="1.0.0"> + + + + + + + @@ -12,4 +19,5 @@ + \ No newline at end of file diff --git a/src/com/android/droidgap/PhoneGap.java b/src/com/android/droidgap/PhoneGap.java index 5cca01a0..c161f409 100644 --- a/src/com/android/droidgap/PhoneGap.java +++ b/src/com/android/droidgap/PhoneGap.java @@ -5,11 +5,14 @@ import android.hardware.SensorManager; import android.location.Location; import android.location.LocationManager; import android.os.Vibrator; +import android.telephony.TelephonyManager; public class PhoneGap { - public GeoTuple location; - public AccelTuple accel; + public static GeoTuple location; + public static AccelTuple accel; + public String uuid = getDeviceId(); + public static String version = "0.1"; private Context mCtx; @@ -17,7 +20,7 @@ public class PhoneGap { this.mCtx = ctx; } - public void updateAccel(AccelTuple accel){ + public void updateAccel() { accel.accelX = SensorManager.DATA_X; accel.accelY = SensorManager.DATA_Y; accel.accelZ = SensorManager.DATA_Z; @@ -49,4 +52,10 @@ public class PhoneGap { String test = "

Test

"; return test; } + + private String getDeviceId(){ + TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE); + String uniqueId = operator.getDeviceId(); + return uniqueId; + } }