Skip to content

Instantly share code, notes, and snippets.

@tshirtman
Created August 11, 2012 00:27
Show Gist options
  • Select an option

  • Save tshirtman/3319331 to your computer and use it in GitHub Desktop.

Select an option

Save tshirtman/3319331 to your computer and use it in GitHub Desktop.
# -------------------------------------------------------------------
# Bluetooth
cdef class Bluetooth(object):
cdef JNIEnv *j_env = SDL_ANDROID_GetJNIEnv()
cdef jclass *j_class = *j_env->FindClass(j_env,
"org/renpy/android/BluetoothConnection")
cdef __init__(self):
constructor = j_env->GetMethod(j_env, j_class, "<init>", "(C)V")
self._jself = j_env->NewObject(j_env, j_class, constructor)
cdef void setUUID(self, uuid):
j_method = j_env->GetMethod(j_env, j_class,
"setUUID",
"(Ljava/lang/String;)V")
j_env->CallVoidMethod(
j_env, j_class, self._jself, j_method,
j_env->NewStringUTF(uuid))
cdef getUUID(self):
j_method = j_env->GetMethod(j_env, j_class,
"getUUID",
"()Ljava/lang/String;")
return j_env->GetStringUTFChars(j_env->CallStringMethod(
j_env, j_class, self._jself, j_method))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment