您的位置:首页 > 移动开发 > Android开发

How to add C daemon to android project and run it?

2016-02-01 00:00 453 查看
http://stackoverflow.com/questions/21299109/how-to-add-c-daemon-to-android-project-and-run-it

I have a daemon written in C language. I also have an android
application that uses this daemon via socket. Daemon run with system. Is
it possible to add compilled C daemon to android application and run it
from application?

++++++++++ answer

I guess it is possible, but just in case your device is rooted.You should include the daemon as part of your application, see NDK if you don't know how to do it, and somwhere in your application code call it like

Runtime.getRuntime().exec("su root " + "path to daemon");


where 'su' is super user utility, which forks your application and
executes daemon in sepparate proccess with elevated permissions.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: