How to start the service again, after application force-stop by user - android-service

My application is a GPS tracking, after every 2 mins, the latitude and longitude are stored into database. If user manually stops the application from
settings->manage application->our app --->Force stop
I need to start the app again. Is it possible?.
Google play service starts again ,if we force stop the application. Why this one is possible?

I'm not sure why would you want the service to start if the user explicitly chooses to kill the app. However, you can auto start the service at boot time. Refer link: Android -Starting Service at Boot Time

Related

I Want to create a application which display list of installed application with help of android service

I Want to create a application which display list of installed application with help of android service.
Which android service to use in this scenario?
It depends on what you want, you can use WorkManager , it runs synchronously in the background, and it is very flexible, espcially if you want to schedule your work. You can also use Foreground Service if you want to show a notification while your app is running. You can use Bound Service if you want to exchange data between an activty and the service.
Before android Oreo, you could useIntent Service, but starting from Oreo, it started to cause an exception. You can also still use AsyncTask but it has serveral drawbacks and AsyncTask may be deprecated in the future.
This is an overview, you haven't mentioned specific details about your app, hope this overview will help choose which way you go.

How does one interact with the user from a vb.net service?

I've got one for you thats been bugging me for a bit.
If you run a Windows Service as Local System, how can that service display forms or prompts on the user desktop?
I tried this in one of my previous apps and couldn't get it to work; I settled on having an 'invisible' app running in the user context to handle any user interaction. But as time has passed, I've seen some apps that have nothing more than a service running as local system and yet they produce prompts and forms on the user desktop.
Thanks in advance for any info :)

start service from asp.net core web application

I am Building web application on asp.net core.
my application needs some data once in a week.
I have created console application which gets this data (really, it parses some website once in a week and stores that data in a database).
I have configuration file when should that console application start to get that data.
My question is how to start that console application from my web app and is it a good idea to start console application from web application?
IMHO it's not best practice to start a console application from an web application. If you would like to do that, please consider using a Windows Service with an timer or a cron job for that.
What you can do is create a scheduled tasks using Windows Task Scheduler. This task's action will be to State a Program and then you can set Program/Script to your console exe file. You can schedule this task to run once a week.
You can check this task history to ensure the task is executing weekly and can run it manually in case of failure.

VB.Net running as a service

I have built an application that connects to the exchange server and does some scanning tasks on the incoming mail.
Application has a form where i can start and stop scanning,give in an interval, do some other configuration, and a notificationicon in the taskbar to show hide,end and so on..
The problem is that I would like the application to start as a service, because now a user has to log in first on the server before it starts working.
I tried some tools like RunAsService, i had a service, but obviously it didn't run the application.
Of course i understeand now that when the application will run as a service, scanning will be the only thing that will happen, no forms and no notification icons.
However i do not know where to start, should i extract the scanning logic from my configuration as a separate application? What application type should it become then ?
You have two easy options.
First one just create a new Windows Service Project from your New Project button in the Visual Studio, and then just program your app.
Second one, just create a service from the service management window in your computer and add the executable file of your program. It will start running as a service (with visible windows and everything as you coded it).
You should follow this link and schedule your vb.net windows program as windows task
In Your code, at the end ,when everything gets executed you should write Me.Close() to hide your form.

Load Application on Windows Startup Before Login

I'm writing a VB.NET application that I want to load at Windows start up before the user logs in. It's going to run on a server and launch other process and kill and restart them as needed to get around a memory leak issue. It also needs to have a GUI to view the current status of the processes its managing.
Now, I can get the application to load when the user logs in but that's not very helpful because the server could reboot for some reason and no user would be logged on, but this application still needs to run in the background.
How do I do this? Do I need to write it as a service, or is there another way? I tried writing a WinForms app but it wouldn't load until after the user logs in.
You need to write a service. Also, probably best to write a second app that will interact with the service and provide a GUI to control what it does.