Home » Android » Android daemon process

Android daemon process

Posted by: admin June 15, 2020 Leave a comment

Questions:

Is it possible (without violating any licenses) to write a native C/C++ application on top of the Android OS and make it run as a daemon process?

There are already several daemon process’ running which one can see with the ‘ps’ command, the legal part concerns me the most. And also the lack of documentation on how to exactly do this.

For the writing part, I guess one could use basic Linux programming concepts, since Android supports at least to some level the standard Posix API. To make it run as the phone boots, some modifications is of course required in init as well.

I have no plans to have this app in the Android Market, so installing it manually to the phone is not a problem. As long as it does not require re-compiling the whole OS or kernel.

I really appreciate all info on this topic, since there’s isn’t much available.

Thanks.

How to&Answers:

Is it possible (without violating any
licenses) to write a native C/C++
application on top of the Android OS
and make it run as a daemon process?

Not cleanly.

And also the lack of documentation on how to exactly do this.

Because you’re not supposed to be doing this, except by modifying the firmware.

To make it run as the phone boots, some modifications is of course required in init as well.

Which will only be possible on a rooted phone (at best) or via modifying the firmware (at worst).

Android’s NDK is designed to create libraries to connect to Java applications via the JNI. If you are looking for a general-purpose Linux environment, Android is not the answer.

Answer:

Legally it’s not a problem at all, they’re not Apple.

The application fundamentals explain how to do that in java, the NDK explain how to do stuff in C/C++, I guess you can somehow figure it out.