navit  0.5.3-trunk
android.c File Reference
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "android.h"
#include <android/log.h>
#include "navit.h"
#include "config_.h"
#include "command.h"
#include "debug.h"
#include "event.h"
#include "callback.h"
#include "country.h"
#include "projection.h"
#include "coord.h"
#include "map.h"
#include "mapset.h"
#include "navit_nls.h"
#include "transform.h"
#include "color.h"
#include "types.h"
#include "search.h"
#include "start_real.h"
#include "track.h"

Data Structures

struct  android_search_priv
 

Functions

JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *aVm, void *aReserved)
 
int android_find_class_global (char *name, jclass *ret)
 
int android_find_method (jclass class, char *name, char *args, jmethodID *ret)
 
int android_find_static_method (jclass class, char *name, char *args, jmethodID *ret)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_navitMain (JNIEnv *env, jobject thiz, jstring lang, jstring path, jstring map_path)
 Starts the Navitlib for Android. More...
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_navitDestroy (JNIEnv *env, jobject thiz)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_sizeChangedCallback (JNIEnv *env, jobject thiz, jlong id, jint w, jint h)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_paddingChangedCallback (JNIEnv *env, jobject thiz, jlong id, jint left, jint top, jint right, jint bottom)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_buttonCallback (JNIEnv *env, jobject thiz, jlong id, jint pressed, jint button, jint x, jint y)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_motionCallback (JNIEnv *env, jobject thiz, jlong id, jint x, jint y)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_keypressCallback (JNIEnv *env, jobject thiz, jlong id, jstring str)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitTimeout_timeoutCallback (JNIEnv *env, jobject thiz, jlong id)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitVehicle_vehicleCallback (JNIEnv *env, jobject thiz, jlong id, jobject location)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitWatch_poll (JNIEnv *env, jobject thiz, jlong func, jint fd, jint cond)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitWatch_watchCallback (JNIEnv *env, jobject thiz, jlong id)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitSensors_sensorCallback (JNIEnv *env, jobject thiz, jlong id, jint sensor, jfloat x, jfloat y, jfloat z)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitTraff_onFeedReceived (JNIEnv *env, jobject thiz, jlong id, jstring feed)
 
void android_return_search_result (struct jni_object *jni_o, int type, struct pcoord *location, const char *address)
 
JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitAppConfig_callbackLocalizedString (JNIEnv *env, jclass thiz, jstring str)
 
JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitGraphics_getDefaultCountry (JNIEnv *env, jobject thiz, jint channel, jstring str)
 
JNIEXPORT jobjectArray JNICALL Java_org_navitproject_navit_NavitGraphics_getAllCountries (JNIEnv *env, jclass thiz)
 
JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitGraphics_getCoordForPoint (JNIEnv *env, jobject thiz, jint x, jint y, jboolean absoluteCoord)
 
JNIEXPORT jobject JNICALL Java_org_navitproject_navit_NavitCallbackHandler_callbackCmdChannel (JNIEnv *env, jclass thiz, jint command)
 
JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel (JNIEnv *env, jclass thiz, jint channel, jstring str)
 
static char * postal_str (struct search_list_result *res, int level)
 
static char * district_str (struct search_list_result *res, int level)
 
static char * town_str (struct search_list_result *res, int level)
 
static void android_search_end (struct android_search_priv *search_priv)
 
static void android_search_idle_result (struct android_search_priv *search_priv, struct search_list_result *res)
 
static void android_search_idle (struct android_search_priv *search_priv)
 
static void start_search (struct android_search_priv *search_priv, const char *search_string)
 
JNIEXPORT jlong JNICALL Java_org_navitproject_navit_NavitAddressSearchActivity_callbackStartAddressSearch (JNIEnv *env, jobject thiz, jint partial, jstring country, jstring str)
 
JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitAddressSearchActivity_callbackCancelAddressSearch (JNIEnv *env, jobject thiz, jlong handle)
 

Variables

JNIEnv * jnienv
 
jobject * android_activity = NULL
 
static enum attr_type android_search_level []
 

Function Documentation

◆ android_find_class_global()

int android_find_class_global ( char *  name,
jclass *  ret 
)

◆ android_find_method()

int android_find_method ( jclass  class,
char *  name,
char *  args,
jmethodID *  ret 
)

References dbg, jnienv, lvl_error, and name.

Referenced by speech_android_init(), and vehicle_android_init().

◆ android_find_static_method()

int android_find_static_method ( jclass  class,
char *  name,
char *  args,
jmethodID *  ret 
)

References dbg, jnienv, lvl_error, and name.

◆ android_return_search_result()

void android_return_search_result ( struct jni_object jni_o,
int  type,
struct pcoord location,
const char *  address 
)

◆ android_search_end()

◆ android_search_idle()

◆ android_search_idle_result()

◆ district_str()

◆ Java_org_navitproject_navit_Navit_navitDestroy()

JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_navitDestroy ( JNIEnv *  env,
jobject  thiz 
)

References dbg, exit, and lvl_debug.

◆ Java_org_navitproject_navit_Navit_navitMain()

JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_navitMain ( JNIEnv *  env,
jobject  thiz,
jstring  lang,
jstring  path,
jstring  map_path 
)

Starts the Navitlib for Android.

Parameters
envprovided by JVM
thizthe calling Navit instance
langa string describing the language
pathrelates to NAVIT_DATA_DIR on linux
map_pathwhere the binfiles are stored

References android_activity, dbg, jnienv, lvl_debug, and main_real().

◆ Java_org_navitproject_navit_NavitAddressSearchActivity_callbackCancelAddressSearch()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitAddressSearchActivity_callbackCancelAddressSearch ( JNIEnv *  env,
jobject  thiz,
jlong  handle 
)

◆ Java_org_navitproject_navit_NavitAddressSearchActivity_callbackStartAddressSearch()

JNIEXPORT jlong JNICALL Java_org_navitproject_navit_NavitAddressSearchActivity_callbackStartAddressSearch ( JNIEnv *  env,
jobject  thiz,
jint  partial,
jstring  country,
jstring  str 
)

◆ Java_org_navitproject_navit_NavitAppConfig_callbackLocalizedString()

JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitAppConfig_callbackLocalizedString ( JNIEnv *  env,
jclass  thiz,
jstring  str 
)

References navit_nls_gettext().

◆ Java_org_navitproject_navit_NavitCallbackHandler_callbackCmdChannel()

JNIEXPORT jobject JNICALL Java_org_navitproject_navit_NavitCallbackHandler_callbackCmdChannel ( JNIEnv *  env,
jclass  thiz,
jint  command 
)

◆ Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel()

◆ Java_org_navitproject_navit_NavitGraphics_buttonCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_buttonCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jint  pressed,
jint  button,
jint  x,
jint  y 
)

References callback_call_4, dbg, and lvl_debug.

◆ Java_org_navitproject_navit_NavitGraphics_getAllCountries()

◆ Java_org_navitproject_navit_NavitGraphics_getCoordForPoint()

JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitGraphics_getCoordForPoint ( JNIEnv *  env,
jobject  thiz,
jint  x,
jint  y,
jboolean  absoluteCoord 
)

◆ Java_org_navitproject_navit_NavitGraphics_getDefaultCountry()

◆ Java_org_navitproject_navit_NavitGraphics_keypressCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_keypressCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jstring  str 
)

References callback_call_1, dbg, lvl_debug, and attr::str.

◆ Java_org_navitproject_navit_NavitGraphics_motionCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_motionCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jint  x,
jint  y 
)

References callback_call_2, dbg, and lvl_debug.

◆ Java_org_navitproject_navit_NavitGraphics_paddingChangedCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_paddingChangedCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jint  left,
jint  top,
jint  right,
jint  bottom 
)

References callback_call_4, dbg, and lvl_debug.

◆ Java_org_navitproject_navit_NavitGraphics_sizeChangedCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitGraphics_sizeChangedCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jint  w,
jint  h 
)

References callback_call_2, dbg, and lvl_debug.

◆ Java_org_navitproject_navit_NavitSensors_sensorCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitSensors_sensorCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jint  sensor,
jfloat  x,
jfloat  y,
jfloat  z 
)

References callback_call_4, dbg, and lvl_debug.

◆ Java_org_navitproject_navit_NavitTimeout_timeoutCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitTimeout_timeoutCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id 
)

References dbg, and lvl_debug.

◆ Java_org_navitproject_navit_NavitTraff_onFeedReceived()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitTraff_onFeedReceived ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jstring  feed 
)

References callback_call_1.

◆ Java_org_navitproject_navit_NavitVehicle_vehicleCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitVehicle_vehicleCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id,
jobject  location 
)

References callback_call_1.

◆ Java_org_navitproject_navit_NavitWatch_poll()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitWatch_poll ( JNIEnv *  env,
jobject  thiz,
jlong  func,
jint  fd,
jint  cond 
)

◆ Java_org_navitproject_navit_NavitWatch_watchCallback()

JNIEXPORT void JNICALL Java_org_navitproject_navit_NavitWatch_watchCallback ( JNIEnv *  env,
jobject  thiz,
jlong  id 
)

References callback_call_0, dbg, and lvl_debug.

◆ JNI_OnLoad()

JNIEXPORT jint JNICALL JNI_OnLoad ( JavaVM *  aVm,
void *  aReserved 
)

References dbg, jnienv, lvl_debug, and lvl_error.

◆ postal_str()

◆ start_search()

◆ town_str()

Variable Documentation

◆ android_activity

◆ android_search_level

enum attr_type android_search_level[]
static
Initial value:
= {
attr_town_or_district_name,
attr_street_name,
attr_house_number
}

Referenced by android_search_idle().

◆ jnienv