Make a JNI call.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4200 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -10,6 +10,12 @@ public class MainActivity extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
TextView text = (TextView)findViewById(R.id.my_text);
|
||||
text.setText("Hello, world!");
|
||||
text.setText(getMessage());
|
||||
}
|
||||
|
||||
public native String getMessage();
|
||||
|
||||
static {
|
||||
System.loadLibrary("tildefriends");
|
||||
}
|
||||
}
|
||||
|
8
src/jnitest.c
Normal file
8
src/jnitest.c
Normal file
@ -0,0 +1,8 @@
|
||||
#if defined(__ANDROID__)
|
||||
#include <jni.h>
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_com_unprompted_tildefriends_MainActivity_getMessage(JNIEnv* env, jobject obj)
|
||||
{
|
||||
return (*env)->NewStringUTF(env, "Hello!");
|
||||
}
|
||||
#endif
|
@ -69,7 +69,7 @@ static void _tf_ssb_rpc_blobs_get(tf_ssb_connection_t* connection, uint8_t flags
|
||||
}
|
||||
uint8_t* blob = NULL;
|
||||
size_t size = 0;
|
||||
const int k_send_max = 8192;
|
||||
const size_t k_send_max = 8192;
|
||||
if (tf_ssb_db_blob_get(ssb, id, &blob, &size))
|
||||
{
|
||||
for (size_t offset = 0; offset < size; offset += k_send_max)
|
||||
|
Reference in New Issue
Block a user