1

I have a few lines of code in a C file, and I like to print the value of a int variable to the screen. My source file is Here and my header file is here I want to see the value in the variable 'fd'. The relevant lines from the source file are:

{
    int fd;
    ...
    fd = open("/dev/tbtcom", O_RDWR);
    ...
}

My understanding is that I can use logging to get this information, and if you look at the complete source file, you see I have log statements, but I do not see any of them. I really like to see the fd result on my phone where I run the app. I just can not find the procedures for passing the int value to my Android Project's main activity. I know there are corresponding JNI primitive types; but I do not know if I have to use them for this purpose. Most JNI content I have read talks about more elaborate data structures. Do I perhaps need to pass this to an object and then point to that object with (*env)?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user3326293
  • 817
  • 1
  • 14
  • 37
  • [What is the Log API to call from an Android JNI program?](http://stackoverflow.com/questions/5465941/what-is-the-log-api-to-call-from-an-android-jni-program) – Onik Sep 16 '15 at 21:12
  • @Onik-I thought I have to use #define to create the tag. I have these statements in my code. Please have a look at my entire code posted as hyperlinks. I am however interested in putting print aka output statements in my code that would show up on the phone. – user3326293 Sep 16 '15 at 21:19

0 Answers0