Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6684642
  • 博文数量: 1159
  • 博客积分: 12444
  • 博客等级: 上将
  • 技术积分: 12570
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-13 21:34
文章分类

全部博文(1159)

文章存档

2016年(126)

2015年(350)

2014年(56)

2013年(91)

2012年(182)

2011年(193)

2010年(138)

2009年(23)

分类: Android平台

2015-12-03 15:32:23



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.


阅读(782) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~