mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-04 00:13:20 +08:00
More changes to the namespaces
This commit is contained in:
parent
ceb2dd61c2
commit
b75fdf8610
@ -1,16 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.droidgap"
|
||||
package="com.nitobi.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_GPS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
|
||||
<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"
|
||||
android:debuggable="true">
|
||||
<activity android:name=".DroidGap"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
|
@ -4,13 +4,17 @@ import android.content.Context;
|
||||
import android.hardware.SensorManager;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.location.LocationListener;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Vibrator;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebView;
|
||||
|
||||
public class PhoneGap{
|
||||
|
||||
private static final String LOG_TAG = "PhoneGap";
|
||||
/*
|
||||
* UUID, version and availability
|
||||
*/
|
||||
@ -19,14 +23,17 @@ public class PhoneGap {
|
||||
private Context mCtx;
|
||||
private Handler mHandler;
|
||||
private WebView mAppView;
|
||||
private GpsListener mGps;
|
||||
private NetworkListener mNetwork;
|
||||
|
||||
public PhoneGap(Context ctx, Handler handler, WebView appView) {
|
||||
this.mCtx = ctx;
|
||||
this.mHandler = handler;
|
||||
this.mAppView = appView;
|
||||
mGps = new GpsListener(ctx);
|
||||
mNetwork = new NetworkListener(ctx);
|
||||
}
|
||||
|
||||
|
||||
public void updateAccel(){
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
@ -60,14 +67,13 @@ public class PhoneGap {
|
||||
public void getLocation(final String provider){
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
LocationManager locMan = (LocationManager) mCtx.getSystemService(Context.LOCATION_SERVICE);
|
||||
GeoTuple geoloc = new GeoTuple();
|
||||
if (locMan.isProviderEnabled(provider))
|
||||
Location loc = mGps.hasLocation() ? mGps.getLocation() : mNetwork.getLocation();
|
||||
if (loc != null)
|
||||
{
|
||||
Location myLoc = (Location) locMan.getLastKnownLocation(provider);
|
||||
geoloc.lat = myLoc.getLatitude();
|
||||
geoloc.lng = myLoc.getLongitude();
|
||||
geoloc.ele = myLoc.getAltitude();
|
||||
geoloc.lat = loc.getLatitude();
|
||||
geoloc.lng = loc.getLongitude();
|
||||
geoloc.ele = loc.getAltitude();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -104,4 +110,6 @@ public class PhoneGap {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user