I guess you do like this , Create your service in init script and set some 
property in your app UI(using setProperty function) and wait for that 
property in init script to start the service.
Creating service.
service myservice system/bin/myservice 
disabled 

on property:custom_property=1 
  start  myservice 

on property:custom_property=0
  stop myservice 

while closing the app.

I'm not sure but just my thought.

- 
Narrator 

Regard
On Wednesday, 24 September 2014 13:10:43 UTC+5:30, SSI wrote:
>
> Hi,
>
>   In my project I have created Service (Customized service)class to listen 
> events from JNI/HAL. This service I registered in a SystemService.java file 
> of AOSP. So my service is getting add into ServiceManager.java like below
>
>   try {
>                  Slog.i(TAG, "MyService");
>                  ServiceManager.addService("xxx", new MyService(context));
>         }catch (Throwable e){
>                    reportWtf("starting MyService_service", e);
>              }
>
>   Now MyService will call up when device is power on. But I want to start 
> a service when my app is opened from UI. I.e I want to add  MyService.java 
> into a ServiceManger by opening app from UI. How to do in AOSP.
>
>    Where I have to use the above code instead of SystemServer.java
>
> Thanks
>
>

-- 
-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to