[android-developers] Re: How to power off the screen?
Sansiro I want to know , Did you created the Power class in your own project? or other ways? Pls tell me... On Wed, Jul 22, 2009 at 1:55 PM, Sansiro wangjiangfeng0...@gmail.comwrote: emm,I'm Sorry to say that the result I just said before is not right. By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri -- Sincerely! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
Stephen I did not create Power class. The Power class is packaged in android.os.Power by Google But it's so strange that you can not find it in SDK documents On 7月22日, 下午3时15分, Stephen Le yangle...@gmail.com wrote: Sansiro I want to know , Did you created the Power class in your own project? or other ways? Pls tell me... On Wed, Jul 22, 2009 at 1:55 PM, Sansiro wangjiangfeng0...@gmail.comwrote: emm,I'm Sorry to say that the result I just said before is not right. By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri -- Sincerely! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
As you say, I tried to import this class into my Activity..But It is doesn't work..Do you have any demo project to give me ? I've traped at this place for a long times and need your kindly help...Sincerely! On Wed, Jul 22, 2009 at 3:53 PM, Sansiro wangjiangfeng0...@gmail.comwrote: Stephen I did not create Power class. The Power class is packaged in android.os.Power by Google But it's so strange that you can not find it in SDK documents On 7月22日, 下午3时15分, Stephen Le yangle...@gmail.com wrote: Sansiro I want to know , Did you created the Power class in your own project? or other ways? Pls tell me... On Wed, Jul 22, 2009 at 1:55 PM, Sansiro wangjiangfeng0...@gmail.com wrote: emm,I'm Sorry to say that the result I just said before is not right. By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri -- Sincerely! -- Sincerely! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
都是中国人,就不用什么鸟英语了,直接汉字。 Power 类在应用的时候,我不知道是否有权限的问题。也许正如上面Yuri所说,也许在Activity下使用有可能有权限限制。 因为我写的程序是没有activity的,而且拥有最高的权限,貌似部分系统进程都没他高,所以才能实现。 我是通过把代码放到源码中重新编译得到如此高权限的程序的。 On 7月22日, 下午4时26分, Stephen Le yangle...@gmail.com wrote: As you say, I tried to import this class into my Activity..But It is doesn't work..Do you have any demo project to give me ? I've traped at this place for a long times and need your kindly help...Sincerely! On Wed, Jul 22, 2009 at 3:53 PM, Sansiro wangjiangfeng0...@gmail.comwrote: Stephen I did not create Power class. The Power class is packaged in android.os.Power by Google But it's so strange that you can not find it in SDK documents On 7月22日, 下午3时15分, Stephen Le yangle...@gmail.com wrote: Sansiro I want to know , Did you created the Power class in your own project? or other ways? Pls tell me... On Wed, Jul 22, 2009 at 1:55 PM, Sansiro wangjiangfeng0...@gmail.com wrote: emm,I'm Sorry to say that the result I just said before is not right. By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri -- Sincerely! -- Sincerely! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
o...这样!我试过的了,只要用到系统进程,都要求有google的数字签名。所以关屏幕是不好使的!模拟器上是可以关的,一部署到机器上就要求和你使用的google程序进程签名一样才可以了。。 你写的程序是不是直接在他的package里面自己写了一个java类调用这个Power类?那是怎样实现在Activity里面调用你这个程序的呢?因为这个类,没有在Android.jar里面? On Wed, Jul 22, 2009 at 5:34 PM, Sansiro wangjiangfeng0...@gmail.comwrote: 都是中国人,就不用什么鸟英语了,直接汉字。 Power 类在应用的时候,我不知道是否有权限的问题。也许正如上面Yuri所说,也许在Activity下使用有可能有权限限制。 因为我写的程序是没有activity的,而且拥有最高的权限,貌似部分系统进程都没他高,所以才能实现。 我是通过把代码放到源码中重新编译得到如此高权限的程序的。 On 7月22日, 下午4时26分, Stephen Le yangle...@gmail.com wrote: As you say, I tried to import this class into my Activity..But It is doesn't work..Do you have any demo project to give me ? I've traped at this place for a long times and need your kindly help...Sincerely! On Wed, Jul 22, 2009 at 3:53 PM, Sansiro wangjiangfeng0...@gmail.com wrote: Stephen I did not create Power class. The Power class is packaged in android.os.Power by Google But it's so strange that you can not find it in SDK documents On 7月22日, 下午3时15分, Stephen Le yangle...@gmail.com wrote: Sansiro I want to know , Did you created the Power class in your own project? or other ways? Pls tell me... On Wed, Jul 22, 2009 at 1:55 PM, Sansiro wangjiangfeng0...@gmail.com wrote: emm,I'm Sorry to say that the result I just said before is not right. By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri -- Sincerely! -- Sincerely! -- Sincerely! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
Hi, By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out it does not work for me, still rc=2. What did you use in your manifest file? I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator here I have sdk 1.5r2, tried building with 1.1 level and 1.5 level, both failed on device and emulator. Now I'm trying to get SDK 1.1 to work again, but it will take some time. Thanks, Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
But, When I use the PowerManager class, it doesn't work.The emulator doesn't go to sleep. BTW, I use the goToSleep() method in this class, and I didn't get a PowerManaget instance from Context. On Jul 21, 6:06 am, Yusuf T. Mobile yusuf.s...@t-mobile.com wrote: PowerManager is part of the SDK and available to any third-party application, and can make the device sleep, but cannot just turn off the screen. Do you want to put the device to sleep, or just the screen? Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 18, 6:43 am, Yuri Dario mc6...@mclink.it wrote: Hi, I'm looking for a way to power off the device screen from my program. I see that PowerManager is only for system apps, and I can't find other ways. Can you help me? thanks, Yuri- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
On 21 Lug, 07:30, Sansiro wangjiangfeng0...@gmail.com wrote: BTW, I use the goToSleep() method in this class, and I didn't get a PowerManaget instance from Context. with the DEVICE_POWER right in manifest, I got a PowerManager instance, but goToSleep is still not usable. the screen. Do you want to put the device to sleep, or just the screen? also device sleep. Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
In Android Souccr code, I find a Power class packaged in android.os. This class is not provided in SDK,But this is really a public class. This class has five native method: public static native void shutdown() public static native void reboot(String reason) throws IOException public static native int setLastUserActivityTimeOut(long ms) public static native int setScreenState(boolean on) public static native int setLightBrightness(int mask,int brightness) You can try the fourth method. On Jul 18, 9:43 pm, Yuri Dario mc6...@mclink.it wrote: Hi, I'm looking for a way to power off the device screen from my program. I see that PowerManager is only for system apps, and I can't find other ways. Can you help me? thanks, Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
Same result with you. But the code I wrote is a system process with all the permission(Even one time, the system is crashed, my process is still running!! O(∩_∩) O~) So why is this result? On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
emm,I'm Sorry to say that the result I just said before is not right. By using the native method setScreenState(), I make my device's screen off.The code is: int x=Power.setScreenState(false);//make the screen off System.out.println(x);//0 will be print out Thread.sleep(3000); x=Power.setScreenState(true);//make the screen on System.out.println(x);//0 will be print out I tried this code on emulator, it works too. PS: I use the 1.1r1 SDK and emulator On Jul 21, 9:17 pm, Yuri Dario mc6...@mclink.it wrote: Hi, public static native int setScreenState(boolean on) tried this one, but calling it does nothing, and always returns 2; since this is a native method, I think it means EACCESS (permission denied). thanks, Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to power off the screen?
PowerManager is part of the SDK and available to any third-party application, and can make the device sleep, but cannot just turn off the screen. Do you want to put the device to sleep, or just the screen? Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 18, 6:43 am, Yuri Dario mc6...@mclink.it wrote: Hi, I'm looking for a way to power off the device screen from my program. I see that PowerManager is only for system apps, and I can't find other ways. Can you help me? thanks, Yuri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---