File 2 Layout \ main. xml:
<? XML version = "1.0" encoding = "UTF-8"?> <Linearlayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Orientation = "vertical" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent"> <button Android: id = "@ + ID/button0" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> <button Android: id = "@ + ID/button1" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </Button> <buttonandroid: Id = "@ + ID/button2" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> <buttonandroid: id = "@ + ID/button3" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> <buttonandroid: id = "@ + ID/button4" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> <buttonandroid: id = "@ + ID/button5" Android: layou T_width = "wrap_content" Android: layout_height = "wrap_content"> </button> <linearlayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Orientation = "horizontal" Android: layout_width = "fill_parent" Android: layout_height = "wrap_content"> <buttonandroid: Id = "@ + ID/button6" Android: text = "@ string/sleep" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> <buttonan Droid: Id = "@ + ID/button7" Android: text = "@ string/reboot" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> </linearlayout> <buttonandroid: Id = "@ + ID/button8" Android: text = "@ string/useractivity" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> </button> </linearlayout> file 3 values \ strings. XML: <? XML version = "1.0" encoding = "UTF-8"?> <Resources> <string name = "hello"> Hello world, mainactivity! </String> <string name = "app_name"> powermangersample </string> <string name = "acquire_partial"> acquire partial_wake_lock </string> <string name = "release_partial"> release partial_wake_lock </string> <string name = "unlock"> acquire screen_dim_wake_lock </string> <string name = "release_screen_dim"> release screen_dim_wake_lock </string> <string name = "unlock"> acquire screen_bright_wake _ Lock </string> <string name = "release_screen_bright"> release unlock </string> <string name = "unlock"> acquire full_wake_lock_wake_lock </string> <string name = "release_full_wake_lock"> release full_wake_lock_wake_lock </string> <string name = "combineflag0"> combine with acquire_causes_wakeup </string> <string name = "notcombineflag0"> not combine with release </strin G> <string name = "combineflag1"> combine with on_after_release </string> <string name = "notcombineflag1"> not combine with on_after_release </string> <string name = "sleep"> go sleep </string> <string name = "reboot"> Reboot </string> <string name = "useractivity"> useractivity </string> </resources> file 4 values \ IDs. XML: <resources> <item type = "ID" name = "statekey"/> <item type = "ID" name = "textturnonkey"/> <item type =" ID "name =" textturnoffkey "/> </resources> File 5 androidmanifest. xml: <? XML version = "1.0" encoding = "UTF-8"?> <Manifest xmlns: Android = "http://schemas.android.com/apk/res/android" package = "com. teleca. robin "Android: versioncode =" 1 "Android: versionname =" 1.0 "> <application Android: icon =" @ drawable/icon "Android: label = "@ string/app_name"> <activity Android: Name = ". mainactivity "Android: Label =" @ string/app_name "> <intent-filter> <action Android: Name =" android. intent. action. main "/> <category Android: Name =" android. intent. category. launcher "/> </intent-filter> </activity> </Application> <uses-SDK Android: minsdkversion =" 8 "/> <uses-Permission Android: name = "android. permission. wake_lock "/> <uses-Permission Android: Name =" android. permission. device_power "/> <uses-Permission Android: Name =" android. permission. reboot "/> </manifest>