3

I want to create a system service. My requirements:

  1. The service should be protected by permission. If possible, it should not be accessible to the user (accessible only inside Android system).

  2. Service should be able to return some values. All the tutorials available on the internet give same example of setting int value.

I want to add this service to SystemServer.java so that it will be automatically started. Some of solutions on stackoverflow suggest to create a system app/service, but I will be modifying Android source code to create a custom ROM.

Victor Sergienko
  • 13,115
  • 3
  • 57
  • 91
user1010
  • 369
  • 1
  • 5
  • 18

1 Answers1

1

First, i would suggest you to read the official documentation about Services,

you can't protect service with permission, you can do some logic and protect your data with passwords with MD5 encryption, and with simple search i found for you nice question of starting a service and returning data

EDIT: Please note that it's uncommon for most application, READ THIS BEFORE IMPLEMENTING, EXAMPLE OF HOW TO USE CUSTOM PERMISSION

Good luck

Community
  • 1
  • 1
Udi Oshi
  • 6,787
  • 7
  • 47
  • 65
  • I might have stated my requirements incorrectly. I do not want protect the service itself, but the APIs provided by my service should be protected by permission. For example, LocationManager's APIs are protected by 'ACCESS_COARSE_LOCATION', 'ACCESS_FINE_LOCATION'. – user1010 Jun 05 '13 at 18:22
  • The link you have provided talks about defining custom permissions in Android app (in manifest file). How is it possible to define similar permission for a system service. Is there any manifest file associated with every system service? – user1010 Jun 06 '13 at 04:53