mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +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"
|
||||
android:versionCode="1"
|
||||
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">
|
||||
<activity android:name=".DroidGap"
|
||||
android:label="@string/app_name">
|
||||
@ -12,4 +19,5 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -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 = "<p>Test</p>";
|
||||
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