This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.create(new Observable.OnSubscribeFunc<Cursor>() { | |
@Override | |
public Subscription onSubscribe(Observer<? super Cursor> observer) { | |
try { | |
Cursor cursor = getCursor(); | |
observer.onNext(cursor); | |
observer.onCompleted(); | |
} catch (Exception e) { | |
observer.onError(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void avcallback_audio(ToxAv *tox_av, int32_t call_id, int16_t *pcm_data, int pcm_data_length, void *user_data) | |
{ | |
tox_av_jni_globals_t *globals = (tox_av_jni_globals_t *) user_data; | |
JNIEnv *env; | |
jbyteArray output; | |
ATTACH_THREAD(globals, env); | |
//create java byte array from pcm data | |
jbyte _output[pcm_data_length]; | |
output = (*env)->NewByteArray(env, pcm_data_length); | |
(*env)->SetByteArrayRegion(env, output, 0, pcm_data_length, _output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package im.tox.antox.tox; | |
import android.app.Notification; | |
import android.app.NotificationManager; | |
import android.app.Service; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.IBinder; | |
import android.os.PowerManager; | |
import android.support.v4.app.NotificationCompat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jclass us_enum; | |
jfieldID fieldID1,fieldID2; | |
jobject enum1, enum2; | |
us_enum = (*env)->FindClass(env, "path/to/enum/someEnum"); | |
fieldID1 = (*env)->GetStaticFieldID(env, us_enum, "ENUM_FIELD_1", "Lpath/to/enum/someEnum;"); | |
fieldID2 = (*env)->GetStaticFieldID(env, us_enum, "ENUM_FIELD_2", "Lpath/to/enum/someEnum;"); | |
enum1 = (*env)->GetStaticObjectField(env, us_enum, fieldID1); | |
enum2 = (*env)->GetStaticObjectField(env, us_enum, fieldID2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void callback_statusmessage(Tox *tox, int32_t friendnumber, uint8_t *newstatus, uint16_t length, void *rptr) | |
{ | |
tox_jni_globals_t *ptr = (tox_jni_globals_t *) rptr; | |
JNIEnv *env; | |
jclass handlerclass; | |
jmethodID handlermeth; | |
jclass jtoxclass; | |
jmethodID jtoxmeth; | |
jbyteArray _newstatus; |
NewerOlder