Yanshof
Yanshof

Reputation: 9926

How to Start android service without activity

I created an application that contain a Service that start from button click of Activity.

But I want to create a new application that doing the same as the last one - but don't have any GUI interface => that mean without any Activity.

I want to make the application to start on device boot and never stop (until the device is shutdown) .

How to do it ? Is there any way ?

Upvotes: 0

Views: 2993

Answers (1)

Onik
Onik

Reputation: 19949

How to do it ?

By using Context.startService() or Context.bindService() methods.

where Context might be Activity, Application, argument of the onReceive() method of BroadcastReceiver etc.

Upvotes: 2

Related Questions