service

Cannot able run Bluetooth Scanning in Foreground service more than 10 - 15 secs even though Notification is provided

喜欢而已 提交于 2021-02-11 06:26:49
问题 I have used Service to keep my scan for android mobiles even when the app is closed. I used Broadcast receiver to restart my service when killed. It restarts the scanning and it works only for some 15 seconds and then stops When i click button1 in {MainActivity} I started the service and have called startdiscovery() in startCommand method in {ExampleService} Please Help me in running the app in background MainActivity.java import android.Manifest; import android.app.ActivityManager; import

Cannot able run Bluetooth Scanning in Foreground service more than 10 - 15 secs even though Notification is provided

£可爱£侵袭症+ 提交于 2021-02-11 06:25:39
问题 I have used Service to keep my scan for android mobiles even when the app is closed. I used Broadcast receiver to restart my service when killed. It restarts the scanning and it works only for some 15 seconds and then stops When i click button1 in {MainActivity} I started the service and have called startdiscovery() in startCommand method in {ExampleService} Please Help me in running the app in background MainActivity.java import android.Manifest; import android.app.ActivityManager; import

passing data from BroadcastReceiver to Service

强颜欢笑 提交于 2021-02-10 22:32:13
问题 My goal is to create a method that gets the data from broadcast receiver. I have a service that register a BroadcastReceiver to monitor battery plug and unplug. How can i get data from BroadcastReceiver ? I want to receive data in this service class: Service: public class myService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { registerReceivers(); return START_NOT_STICKY; } @Nullable @Override public IBinder onBind(Intent intent) { return null;

passing data from BroadcastReceiver to Service

喜欢而已 提交于 2021-02-10 22:19:19
问题 My goal is to create a method that gets the data from broadcast receiver. I have a service that register a BroadcastReceiver to monitor battery plug and unplug. How can i get data from BroadcastReceiver ? I want to receive data in this service class: Service: public class myService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { registerReceivers(); return START_NOT_STICKY; } @Nullable @Override public IBinder onBind(Intent intent) { return null;

jenkins selenium do not run test headlessly

╄→гoц情女王★ 提交于 2021-02-10 06:45:47
问题 I am running pytests selenium tests using jenkins. I ran test on my local machine it works. But when I run through jenkins, it runs on remote jenkins machine(creates workspace on remote jenkins machine) headlessly and it fails with test errors such as 'element not visible' or 'timeout exception due to element not clickable'. After this I ran test on remote machine directly (windows server) in workspace. It launches chrome browser and runs test and passes. Why is it running test headlessly

Intershop 7.10. - fetching payment configuration

若如初见. 提交于 2021-02-10 03:17:55
问题 We would like to fetch the payment configuration from Order in Java class (OrderBO extension). So far we have managed to fetch the service like this: final OrderBOPaymentExtension<OrderBO> paymentExtension = getExtendedObject().getExtension(OrderBOPaymentExtension.EXTENSION_ID); final PaymentBO paymentBO = paymentExtension.getPaymentBOs().stream().findFirst().orElse(null); PaymentServiceBO paymentServiceBO = paymentBO.getPaymentServiceBO(); Now we need to fetch the configuration, so we can

Intershop 7.10. - fetching payment configuration

混江龙づ霸主 提交于 2021-02-10 03:15:46
问题 We would like to fetch the payment configuration from Order in Java class (OrderBO extension). So far we have managed to fetch the service like this: final OrderBOPaymentExtension<OrderBO> paymentExtension = getExtendedObject().getExtension(OrderBOPaymentExtension.EXTENSION_ID); final PaymentBO paymentBO = paymentExtension.getPaymentBOs().stream().findFirst().orElse(null); PaymentServiceBO paymentServiceBO = paymentBO.getPaymentServiceBO(); Now we need to fetch the configuration, so we can

Service not restarting using START_STICKY on devices above API Level 25(Nougat)

我们两清 提交于 2021-02-08 07:45:22
问题 I have got a service in my app which needs to be restarted after app removed from recent task list. Service restarts for API level 25 and below but not for 25 and above versions.Please help me with this issue and would like to know the best way to restart a service which is compatible to all OS versions. public class XMPPMainService extends Service { private static final String TAG = "XMPPMainService"; private static final int RECONNECT_TRY_INTERVAL_MS = 900; // 5 Seconds private

Correct way to register for pre-shutdown notification from C++

心已入冬 提交于 2021-02-07 18:15:28
问题 I write a local service application using C++ and I can't find the correct way of registering for a pre-shut-down notification (for OS later than Windows XP). I believe that SERVICE_CONTROL_PRESHUTDOWN notification has been added since Vista, but when you call SetServiceStatus do we need to specify: dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PRESHUTDOWN; or dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PRESHUTDOWN; 回答1: You cannot accept both a

Correct way to register for pre-shutdown notification from C++

无人久伴 提交于 2021-02-07 18:15:14
问题 I write a local service application using C++ and I can't find the correct way of registering for a pre-shut-down notification (for OS later than Windows XP). I believe that SERVICE_CONTROL_PRESHUTDOWN notification has been added since Vista, but when you call SetServiceStatus do we need to specify: dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PRESHUTDOWN; or dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PRESHUTDOWN; 回答1: You cannot accept both a