reboot

Determine if phone has been rebooted

烈酒焚心 提交于 2019-12-02 04:56:18
问题 I'm trying to detect if an Android device has rebooted since the last time a preference value is set. Ideally, I'd like to do it without the android.permission.RECEIVE_BOOT_COMPLETED permission. One way I'm thinking about doing this is storing another preference value that contains some sort of session ID. When I update the preference value in question, I'd update the session value as well. When I check the value in the preference for the session value, if it equals the current session value

iOS app with iBeacon must restart device

十年热恋 提交于 2019-12-02 04:05:32
I built a simple ios app with IBeacon . I ran this app on an iPhone 4s whit ios7.1 while running an IBeacon base station.Everything is working right in background or foreground(exit region have 30 seconds delay in background).But over a period of time,about 3 hours,this app can not monitor any event though device setting were not change(blueTooth and locate is normal).This situation must restart the device. Please tell me what should i do aboult this situation? Thanks! davidgyoung I wonder if iOS Bluetooth scanning is slowing down when your app is in the background such that it appears that

Determine if phone has been rebooted

梦想的初衷 提交于 2019-12-02 02:17:11
I'm trying to detect if an Android device has rebooted since the last time a preference value is set. Ideally, I'd like to do it without the android.permission.RECEIVE_BOOT_COMPLETED permission. One way I'm thinking about doing this is storing another preference value that contains some sort of session ID. When I update the preference value in question, I'd update the session value as well. When I check the value in the preference for the session value, if it equals the current session value then there has not been a reboot. If the current session value is different than what's saved, then

Restart Mac OS X ungracefully using a C++ call?

爱⌒轻易说出口 提交于 2019-12-01 13:16:30
问题 How do I restart Mac OS X using C++ ( not Objetive-C ) without invoking any child processes? Don't care if it's ungraceful . system("reboot"); //Is not acceptable as it relies on invoking a process 回答1: I can't think why you wouldn't want to create a new process, but if you really don't want to, then execve("reboot",0,0) will run reboot , replacing the current process. You'll need to include <unistd.h> . I'm assuming this is available on Mac OS; it should be on all POSIX platforms. UPDATE It

Reconfigure and reboot a Hudson/Jenkins slave as part of a build

柔情痞子 提交于 2019-11-30 10:51:02
问题 I have a Jenkins (Hudson) server setup that runs tests on a variety of slave machines. What I want to do is reconfigure the slave (using remote APIs), reboot the slave so that he changes take effect, then continue with the rest of the test. There are two hurdles that I've encountered so far: Once a Jenkins job begins to run on the slave, the slave cannot go down or break the network connection to the server otherwise Jenkins immediately fails the test. Normally, I would say this is completely

How to reboot emulator to test ACTION_BOOT_COMPLETED?

帅比萌擦擦* 提交于 2019-11-30 10:29:47
问题 Well, I have searched a lot. People say that I need to close the window of emulator to close it. However, I need to reboot the emulator to catch ACTION_BOOT_COMPLETED by my BroadcastReceiver. How can I do that? 回答1: You can use the following command from adb: adb shell am activity/service/broadcast -a ACTION -c CATEGORY -n NAME for example: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n package_name/class_name Note that class name and package

Setting environment variables requires reboot on 64-bit

青春壹個敷衍的年華 提交于 2019-11-30 08:10:40
I am working on an installer using Wix 3.5 that needs to set the system PATH environment variable. This is how I am setting the environment variable: <Directory Id="DirectoryName"> <Component Id="ComponentID" Guid="{BE20AF67-5943-4AF4-BE66-226E2D4B844F}"> <Environment Id="EnvironmentID" Name="PATH" Action="set" Value="the path" Part="last" Separator=";" System="yes" /> </Component> </Directory> This seems to be working on 32-bit systems without requiring a reboot for the changes to be recognized. However, when I try it on 64-bit Windows 7 a reboot is required. Is this a known issue on 64-bit

Why widget does not work after reboot?

戏子无情 提交于 2019-11-29 23:22:01
问题 I have this simple widget and when I click on it, it should open my activity, it works, but it doesn't work after reboot. I must delete and then again add widget to my homescreen, because when I click on widget widget doesn't respond and doesn't open my activity. So where is the problem? Code: public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int N = appWidgetIds.length; for(int i=0; i<N; i++){ int appWidgetId = appWidgetIds[i]; context

Re launch JVM with bigger heap space

只愿长相守 提交于 2019-11-29 14:50:35
I want to be able to execute the .Jar file, and if the heap space isn't set big enough, it should launch a new JVM with the same .Jar file, but set with a bigger heap space, and then close the first JVM and .Jar. I've tried using the ProcessBuilder, but I can't get it to work. It has to work cross platform. -ONi I have found the solution, and it works cross platform. To restart the JVM from code, use the following. This answer is taken from another question I found after hours of search in here. If you want, you can follow it with an System.exit(0), to terminate the JVM that started the new

Alarm doesn't trigger after reboot

北慕城南 提交于 2019-11-29 14:40:20
I have an alarm to reset a data connection say every 15 minutes. The problem is, once the phone is rebooted, the application gets killed and the alarm (service) doesn't trigger anymore. (This is not a duplicate, the other similar questions on SO do not solve my problem.) <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <receiver android:name="com.sang.mobiledata.ResetBroadcastReceiver" android:exported="false" > <intent-filter> <action android:name="com.sang.mobiledata.IntentAction.RECEIVE_RESETCONN_UPDATE" /> <action android:name="android.intent.action.BOOT