Languages

Menu
Sites
Language
How to run service app from UI app.

hello.
I am developing an application that periodically obtains location information from a background service app with a UI.
This service is not destroyed when the application is destroyed.
That is, it is always running.

By the way, I don't know how to run service app from UI app.

In the sample code, the service app is a single application.
Can I have a UI app and a service app in one application (one package)?

Please provide a reference url or code.

Responses

3 Replies
William Thompson

Hello!

Yes, it is possible to have both a UI app and a service app within a single application package in Android. To run a service app from a UI app, you can use the startService() method to start the service from your UI app's code.

Stephanie Reed

Find out if there are new versions of your browser and SmartViewSDK to install. Updating both guarantees compatibility and fixes any difficulties that may have arisen.