0

I am learning Binders in Android, so I want to test whether my sample applications written in C/C++ are working properly. I am on a linux based PC.

When I searched on Google, every example was implementing a JNI layer, which I think don't is required as I can use simple logging facilities.

Is there a way that I can test my (android-based) executables directly on my PC? Hope I am clear.

Community
  • 1
  • 1
Naveen
  • 7,944
  • 12
  • 78
  • 165

1 Answers1

0

Since you're compiling against android/log.h, whatever system you want to run the executable on will have to have the proper instruction set and have android/log.h.

You could easily switch all of your android prints to print to STDOUT (printf, etc.) and then recompile on whatever system that you're using using it's compiler (gcc, etc.).

StephenG
  • 2,851
  • 1
  • 16
  • 36
  • Suppose I made a service using Binder which prints 'hello world'. Now I cannot test it on linux system, because linux do not have binders. I wanted to know that does Android NDK create such testable Android environment where I can test my 'hello world' binder service? – Naveen Jul 22 '15 at 18:20
  • Looking at this [about how binders aren't supposed to be available to the NDK](http://stackoverflow.com/questions/14215462/how-to-create-a-android-native-service-and-use-binder-to-communicate-with-it), I don't think it'd be available. Sorry about that. If you can remove the binder, you can test the rest of the code – StephenG Jul 22 '15 at 18:24