XAM210 - Backgrounding (Class with René, 2014-09-11)

rene_ruppertrene_ruppert DEXamarin Team, University, XamUProfessors Xamurai

We had very nice discussions today during the class. Thanks to all students for the contributions!

There was one question I could not answer and promised to investigate: Are all Android Services public and available to other apps?

Short answer: no.

Long answer: Services are by default internal to the app and cannot be accessed from the outside. If we want a Service to be available to other apps, we will have to use Intent Filters.

[IntentFilter(new String[]{"com.xamarin.DemoService"})]
public class DemoService : Service

this makes the service available via:

StartService (new Intent ("com.xamarin.DemoService"));

You can find additional information about the topic at: http://developer.xamarin.com/guides/android/application_fundamentals/services/part_1_-_started_services/

Hope that helps.


Sign In or Register to comment.