80,493
社区成员
发帖
与我相关
我的任务
分享
static void location_callback(GpsLocation* location)
{
JNIEnv* env = AndroidRuntime::getJNIEnv();
env->CallVoidMethod(mCallbacksObj, method_reportLocation, location->flags,
(jdouble)location->latitude, (jdouble)location->longitude,
(jdouble)location->altitude,
(jfloat)location->speed, (jfloat)location->bearing,
(jfloat)location->accuracy, (jlong)location->timestamp);
checkAndClearExceptionFromCallback(env, __FUNCTION__);
}
private void reportLocation(int flags, double latitude, double longitude, double altitude,
float speed, float bearing, float accuracy, long timestamp) {
if (VERBOSE) Log.v(TAG, "reportLocation lat: " + latitude + " long: " + longitude +
" timestamp: " + timestamp);
...
...
...
Intent intent = new Intent(LocationManager.GPS_FIX_CHANGE_ACTION);
intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, true);
mContext.sendBroadcast(intent);
updateStatus(LocationProvider.AVAILABLE, mSvCount);
public GpsLocationProvider(Context context, ILocationManager locationManager) {
mContext = context;
BtNative(Context context) {
Log.i(TAG, "--------Constuct BtNative OK----------");
mContext = context;
if(mContext == null)
{
Log.i(TAG, "---mContext == NULL---");
}
else
{
Log.i(TAG, "---mContext != NULL---");
}
private void reportPhone(String str) {
Log.i(TAG, "-callbacks---");
Log.i(TAG, "---" + str + "----");
Intent intent = new Intent(ACTION_BT_INCALL);
Log.i(TAG, "---Intent new ok!---");
if (mContext == null) {
Log.i(TAG, "---mContext == NULL---");
} else {
mContext.sendBroadcast(intent);
}
}