I wish to print the output from printf
statements in my native code(in C
) on to android screen. As I have many outputs that I wish to see on android screen, I want something more than the return statements at the end of a JNI functions which print a single text per function. How to go about it?
EDIT:
For example in my C code, if I wish to print something in the middle of a function like "Hello World
" what should I do? Right now, I am able to print "only from return!
" on the android screen using setText
methods.
jstring Java_com_example_encryptString( JNIEnv* env, jobject thiz)
{
printf("Hello World");
return (*env)->NewStringUTF(env, "only from return!");
}
I know of a method where I call this method from the Java class and use TextViews
to print it on android screen. But, that can take and print only the value returned by the function and nothing else. Can't I print any other value which is not returned by the function?
Thanks.
Note: I am not looking for android logs in logcat.