mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-07 14:53:00 +08:00
Updating the Android permissions so we can access all the info we need
This commit is contained in:
parent
9911202d5b
commit
bdab7d8a02
@ -3,6 +3,13 @@
|
|||||||
package="com.android.droidgap"
|
package="com.android.droidgap"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0.0">
|
android:versionName="1.0.0">
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
||||||
<activity android:name=".DroidGap"
|
<activity android:name=".DroidGap"
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name">
|
||||||
@ -12,4 +19,5 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -5,11 +5,14 @@ import android.hardware.SensorManager;
|
|||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
|
||||||
public class PhoneGap {
|
public class PhoneGap {
|
||||||
|
|
||||||
public GeoTuple location;
|
public static GeoTuple location;
|
||||||
public AccelTuple accel;
|
public static AccelTuple accel;
|
||||||
|
public String uuid = getDeviceId();
|
||||||
|
public static String version = "0.1";
|
||||||
|
|
||||||
private Context mCtx;
|
private Context mCtx;
|
||||||
|
|
||||||
@ -17,7 +20,7 @@ public class PhoneGap {
|
|||||||
this.mCtx = ctx;
|
this.mCtx = ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAccel(AccelTuple accel){
|
public void updateAccel() {
|
||||||
accel.accelX = SensorManager.DATA_X;
|
accel.accelX = SensorManager.DATA_X;
|
||||||
accel.accelY = SensorManager.DATA_Y;
|
accel.accelY = SensorManager.DATA_Y;
|
||||||
accel.accelZ = SensorManager.DATA_Z;
|
accel.accelZ = SensorManager.DATA_Z;
|
||||||
@ -49,4 +52,10 @@ public class PhoneGap {
|
|||||||
String test = "<p>Test</p>";
|
String test = "<p>Test</p>";
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getDeviceId(){
|
||||||
|
TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
String uniqueId = operator.getDeviceId();
|
||||||
|
return uniqueId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user