service

Should i use StartService or StartForegroundService for API >= 26?

ぐ巨炮叔叔 提交于 2021-01-29 05:45:39
问题 I'm a bit confused because i read some posts where i'm supposed too use ContextCompat.StartForegroundService(); if the API is >= 26. Now I still just use StartService and it works even though i'm supposed to get an IllegalStateException on an API >= 26 ( current api on phone is 27) according to this post. https://medium.com/mindorks/mastering-android-service-of-2018-a4a1df5ed5a6 I know Service is an old concept. Let me assure you we will not discuss the basics and we will learn the recent

Background Service error while using as async Task

五迷三道 提交于 2021-01-29 03:14:36
问题 I have a background service in Xamarin Android but the problem is I cannot use it as Async method, it gives an error. return type must be 'StartCommandResult' to match overridden member 'Service.OnStartCommand(Intent, StartCommandFlags, int) The actual overridden method is void but to use await I have to change it to async Task<T> and then it produces the error. I searched everywhere but couldn't find a proper solution on this. The code snippet for entire class is here: { [Service

How to write a file inside system/etc/wifi/wpa_supplicant.conf file using android program?

别等时光非礼了梦想. 提交于 2021-01-28 22:58:15
问题 I am working on wifi related app, which takes the user giving username password and need to write(edit/append)in a file which is located in system/etc/wifi/ path. I searched in stackoverflow and got some answers and then tried but there is no luck. This is rooted device. I did remount and su too. I can able to read the same file. I placed all the permissions in manifest too. What I missed? try { String[] command = new String[]{"/system/bin/ls", "-l", "/system/etc/wifi/wpa_supplicant.conf" };

Broadcast receiver with wifi scan not working

99封情书 提交于 2021-01-28 12:23:10
问题 I have the following code in a service which is called with an AlarmManager (this works well) but when when I start the wifi scan (which returns true) I never receive the results in the BroadcastReceiver I created: public class WifiCheckerService extends IntentService { WifiManager wifiManager; List<Wifi> savedWifis; List<Wifi> wifisInRange; List<ScanResult> wifisInRangeResults; BroadcastReceiver broadcastReceiver; public WifiCheckerService() { super("WifiCheckerService"); } @Override public

Windows Service application in c#

非 Y 不嫁゛ 提交于 2021-01-28 12:12:54
问题 I have created a Windows Service application using c# . I have followed the steps from this msdn documentation but the service is not listing in the services section in Computer -> Manage -> Service pane . Am I missing something? its Windows 7 . Want to run my service to check the functionality. Thanks 回答1: You need to install your service for the Windows Service Control Manager (SCM) to know about it (by virtue of a resulting registry entry). You have (at least) two options to do this: sc

Pystray icon available when running as a service

孤街醉人 提交于 2021-01-28 11:10:04
问题 Using: Python (3.7.5) Pyinstaller (3.5) Pywin32 (223) Pystray (Current) I have a python program that uses Pystray to show an icon which allows me to make Tkinter window available. It took a while but, thanks to stack overflow, this functionality works fine. I then create an executable for this using PyInstaller and this also runs fine. Up to here everything is great, executing the program starts its webservice and shows the icon. I call this program from a service created with pywin32. The

Add elements to rxjs BehaviorSubject or Subject of an array in Angular2+

无人久伴 提交于 2021-01-28 08:11:52
问题 I was reading up on how to share data between unrelated components in Angular from the "Unrelated Components: Sharing Data with a Service" section of the tutorial here. I see how this example works for the string they are trying to share across their components, but my data type is a little more complex: Namely, I think my BehaviorSubject should look like this: private currentPopulationSource: BehaviorSubject<Population> = new BehaviorSubject<Population>(new Population(new Array<Organism>()))

Starting GUI application from Windows Service - Approaches

橙三吉。 提交于 2021-01-28 05:34:02
问题 Note: Despite appearing as yet another question of the same matter, it's not, but choosing the right title seems hard so more appropriate title change is welcome. I'm trying to solve an issue of starting up GUI application (Windows Forms, .NET) from a service application on Windows 7 Embedded (POS ready), and have come across several solutions, but none of them worked, with one exception I discovered along the way: Using a batch file as a helper file. Background: There are several posts like

Android Google Services Location costs and limitations

我的未来我决定 提交于 2021-01-28 05:27:46
问题 I would use in my app the location service provided by Google Services and I am in trouble understanding how it works. I need to check user position for an amount higher then 1000 times so I need to enable the function that allows me to do 150 000 requests every 24h (or maybe I am in wrong?). I have a Developer account on Google Play (paid 1 time for ever). To be able to check user position higher then 1000 times for day what have I to do? Do I pay for this ? How much ? What I found : https:/

Releasing memory from activity of foreground service

佐手、 提交于 2021-01-28 00:11:25
问题 I have an app with a foreground service and one activity. The service can either start on its own on boot, or be started from within the activity. I have noticed when the service starts itself on boot, the memory usage is ~3mB. Once I open the activity, memory usage jumps up to about ~9mB. Once the activity has been opened (and then closed either by back or home button), the memory never drops back down to 3mB, even after many hours and other apps opening. My question is, should the memory