Start C/C++daemon from Android application

400 views
Skip to first unread message

Siddartha

unread,
Sep 1, 2010, 1:50:44 AM9/1/10
to android-platform
Hi ,


How do we start a C / C++ daemon from Android application? The
requirement could be that there is UI settings (on/off , say from
Settings like application) to start / stop the C/C++ daemon.
We already have the C daemon running from Android emulator (adb shell)
by running ./mydaemon from the prompt.

What is the best practice to start/stop the daemon from the Android
application?
Any suggestion would be greatly appreciated

Thanks!

Pavan Savoy

unread,
Sep 1, 2010, 12:44:18 PM9/1/10
to android-...@googlegroups.com
Most daemons are run by having a service in the init.rc
as in

service my_daemon_service mydaemon <args>
     user root
     ... group permissions.. etc..

and in your c/c++ application you would do a property_set("ctl.start", "my_daemon_service");


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
--Pavan Savoy

Pavan Savoy

unread,
Sep 2, 2010, 10:55:06 AM9/2/10
to pothapragad...@wipro.com, android-...@googlegroups.com
Yes, correct ..
look at wpa_supplicant for example..

On Thu, Sep 2, 2010 at 9:51 AM, <pothapragad...@wipro.com> wrote:
 
Thanks for the reply!
I was just wondering if if i put 'disabled' in init.rc for 'mydaemon', then it would not be started by default during bootup process. Isn't so?
 
Thanks again for the information
 
Rgds,
Siddartha
 
 


From: android-...@googlegroups.com [mailto:android-...@googlegroups.com] On Behalf Of Pavan Savoy
Sent: Wednesday, September 01, 2010 10:14 PM
To: android-...@googlegroups.com
Subject: Re: Start C/C++daemon from Android application

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com




--
--Pavan Savoy

Reply all
Reply to author
Forward
0 new messages