[android] add: JNI bridge for track recorder.

This commit is contained in:
Alexander Marchuk 2015-12-01 14:36:43 +03:00 committed by Constantin Shalnev
parent e2b32d04f0
commit b9c147cdbb
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#include "Framework.hpp"
extern "C"
{
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_location_TrackRecorder_nativeSetEnabled(JNIEnv * env, jclass clazz, jboolean enable)
{
frm()->EnableGpsTracking(enable);
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_location_TrackRecorder_nativeIsEnabled(JNIEnv * env, jclass clazz)
{
return frm()->IsGpsTrackingEnabled();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_location_TrackRecorder_nativeSetDuration(JNIEnv * env, jclass clazz, jint hours)
{
frm()->SetGpsTrackingDuration(hours(hours));
}
JNIEXPORT jint JNICALL
Java_com_mapswithme_maps_location_TrackRecorder_nativeGetDuration(JNIEnv * env, jclass clazz)
{
return frm()->GetGpsTrackingDuration();
}
}

View file

@ -0,0 +1,9 @@
package com.mapswithme.maps.location;
public class TrackRecorder
{
public static native void nativeSetEnabled(boolean enable);
public static native boolean nativeIsEnabled();
public static native void nativeSetDuration(int hours);
public static native int nativeGetDuration();
}