1

I don't know whether i make sense or not. But just wanted to now that can i run the c/c++ code in android without the need of writing JNI wrapper or using Native Activity way?

I mean, I am having a simple C++ Template Matching code which contains main function and I use to run it using g++ in terminal.

Now I want this Template Matching code to be run in android usng NDK. Is there any way? I have googled a lot but all they is to either use JNI wrapper or use SWIG which makes JNI wrapper, but can't actually get into any of them. I need more simpler solution.

Shrikant Ballal
  • 7,067
  • 7
  • 41
  • 61
Rekha
  • 901
  • 1
  • 11
  • 20

1 Answers1

2

If you have a rooted phone, you can compile and run programs as on any linux machine, from the adb shell.

However, that requires a bit of knowledge about Linux.

So, to start:

  • Root your phone (force it to give you admin privileges). That is easy for developer phones/boards, and a kill for regular phones bought at a shop downstreet.

  • compile your app for android and run it from adb as you would do from a linux shell.

Here is a more detailed answer on the matter

How to compile C into an executable binary file and run it in Android from Android Shell?

Community
  • 1
  • 1
Sam
  • 19,708
  • 4
  • 59
  • 82
  • Thanks a lot..Happy to now that there is a way..I am surely going to try it out..and if it works out..this is going to be best answer :-) – Rekha Aug 28 '12 at 07:32
  • Google for instructions on your specific model. For some models there is no info available, for others you need to do a bit of hacking, and for a few of them is as simple as restarting in admin mode. – Sam Aug 28 '12 at 09:04