Do android have anything like system service? Windows have services, similar. I want to create a application similar to antivirus which should run as system service and other programs should not be able remove it not other programs should be able to modify/ delete its data.
You can create a service based app and install it.
User will be able to install/uninstall as per his wish..
This service can be started as soon as the phone is started with
API's available.
Each app has its own space/memory for it use and it cannot be accessed by other apps unless given permission.
Actually you can create a system service, but you need to modify system image for this. If you can do this you can start it at the init.rc file or SystemServer.java. But for my point of view, Vinay is right - you should make an application with service. The application cannot be uninstalled by other applications, and the data of the application by default cannot be accessed by other applications (each application has its own user id. After that Android apply standard linux file permissions to the files of the applications).
Related
I am developing an application for a business entity. That application should run in the background in every employees' mobile phone. Employees are mostly salesman. The application basically detects location changes and suggest the salesman where they might visit. A kind of reminder application. It also lets other salesmen see where are their teammates.
Right now I am using a foreground activity and it works fine till the system forcefully doesn't kill the service or the phone doesn't reboot due to manual activity or battery discharge.
Ones the application is closed, as of now, the managers in the firm needs to call salespeople to turn on the application once, as on application start it automatically turn on its foreground service. But this is really an extra burden on the management team which can be automated.
I am ok to have any settings based or code based solution. One solution is to root the phones of salespeople and install some extra utility app or write the code based on root APIs, but this will be too much for this simple task.
THe permission RECEIVE_BOOT_COMPLETED was not added properly in the manifest. After adding the permission it worked calmly. In on receive method of the broadcast receiver, I am starting the foreground service.
At the moment, the best way is to use WorkManager https://developer.android.com/topic/libraries/architecture/workmanager/ Yes, it still alpha, but works very good.
From other side, you could work on automating the task "managers in the firm needs to call salespeople to turn on the application once". I mean, an app/backend could automatically call the salesman (with some pre-recorded message) or send SMS to them.
I have for example 20 apps:
app1
app2
app20
Each of this app have background service. I need to somehow detect from other apps if service in app number x is working and then make action to not run it from other apps. If app number x is going to be uninstalled, then run service from next app.
Times to run service are different, one starts at 8:01, second 8:07, depends to install time.
I tried with package manager and shared prefs(single app). Each solution give me results:
service is running only from initiator app
service will not run anywhere
service will run everywhere x20 ;/
Any possible solution?
i can't use shared preferences between apps, package name is not constant, i cannot put the list of packages and access to each app
though about server, json file changing by service and restoring by cron jobs when service need to be restored
maybe some SD card file? (problem is that every android device have different path to SD) and what if app what created service will be deleted by user?
I'm writing a remote management app for an android based device. The app currently runs under sharedUserId android.uid.system to enable access to restricted parts of the file system.
As a side effect of running under the system uid the app cannot access /mnt/extsd and a warning is logged every time we call sendBroadcast.
I'm looking for a way to run only the code that needs priviledged access as android.uid.system while the rest of the code can run as a standard uid. Is there any means to achieve this?
I want to create an apk, without an user interface in android. And I need to start a Service as soon as the Applicaton gets installed on the Device. Is there any possible way to create an apk without UI.
Thanks in advance.
And I need to start a Service as soon as the Applicaton gets installed on the Device.
Fortunately, that is not possible for an app installed through normal channels (e.g., the Play Store), for security reasons, since Android 3.1. Nothing of your app will run until something on the device uses an explicit Intent to start up one of your components, and that most certainly does not occur when your app is installed.
You are welcome to build your hardware, or your own custom ROM, that has your app pre-installed. In that case, you can arrange to be able to run right away.
yes, you have juste to create a Service or a BrodcastReceiver which do something you want
I want to disable/unregister intents registered by other apps so that they would not get broadcast messages sent by the system?
Something like this:
Gemini app
(3rd screenshot)
Is there any similar app with the open source code?
Also, it is possible to remove permissions registered by another app?
I want to disable/unregister intents registered by other apps so that they would not get broadcast messages sent by the system?
Fortunately, that is not possible, except on rooted devices.
Something like this: Gemini app (3rd screenshot)
As the app notes, this requires root.
Also, it is possible to remove permissions registered by another app?
As JonTraex notes in his linked-to answer, this is not possible even with root.
I answered a similar question here:
https://stackoverflow.com/a/9106832/529691
If you had bothered to look at their permissions you could see how they are doing it.
SYSTEM TOOLS
KILL BACKGROUND PROCESSES Allows an application to kill background
processes of other applications, even if memory isn't low.
KILL BACKGROUND PROCESSES Allows an application to kill background
processes of other applications, even if memory isn't low.
FORCE STOP OTHER APPLICATIONS Allows an application to forcibly stop
other applications.
MEASURE APPLICATION STORAGE SPACE Allows an application to retrieve
its code, data, and cache sizes