o...这样!我试过的了,只要用到系统进程,都要求有google的数字签名。所以关屏幕是不好使的!模拟器上是可以关的,一部署到机器上就要求和你使用的google程序进程签名一样才可以了。。 你写的程序是不是直接在他的package里面自己写了一个java类调用这个Power类?那是怎样实现在Activity里面调用你这个程序的呢?因为这个类,没有在Android.jar里面?
On Wed, Jul 22, 2009 at 5:34 PM, Sansiro <wangjiangfeng0...@gmail.com>wrote: > 都是中国人,就不用什么鸟英语了,直接汉字。 > > 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 -~----------~----~----~----~------~----~------~--~---