Android.os.Build
Build.board//MotherboardBuild.brand//Android System CustomizerBuild.cpu_abi//CPU Instruction SetBuild.device//Device ParametersBuild.display//Display ParametersBuild.fingerprint//Hardware nameBuild.HOSTBuild.ID//Revised version listBuild.manufacturer//Hardware ManufacturersBuild.model//versionBuild.product//Mobile phone ManufacturersBuild.tags//label that describes the buildBuild.TIMEBuild.TYPE//Builder TypeBuild.user//Run Results/*board:unknownbrand:genericcpu Abi:armeabidevice:genericdisplay:google_sdk-eng 2.1 ERD79 22607 Test-keysfinger PR Int:generic/google_sdk/generic/:2.1/erd79/22607:eng/test-keyshost:genki.mtv.corp.google.comid: Erd79manufacturer:unknownmodel:google_sdkproduct:google_sdktags:test-keystime:1261185425000type:enguser: Android-build*/
Build.version
//Current Development CodeBuild.VERSION.CODENAME//Source Control Version numberBuild.VERSION.INCREMENTAL//Version stringBuild.VERSION.RELEASE//Version numberBuild.VERSION.SDK//Version numberBuild.VERSION.SDK_INT//Results/*REL226072.177*///Build.VERSION.SDK_INT can be paired with switchSwitch(Build.VERSION.SDK_INT) { CaseBuild.version_codes. BASE://1.0 Break; CaseBuild.version_codes. Base_1_1://1.1 Break; CaseBuild.version_codes. Cupcake://1.5 Break; CaseBuild.version_codes. Cur_development://Current Dev version Break; CaseBuild.version_codes. Donut://1.6 Break; CaseBuild.version_codes. Eclair://2.0 Break; CaseBuild.version_codes. Eclair_0_1://2.0.1 Break; CaseBuild.version_codes. ECLAIR_MR1://2.1 Break;}
Android.os.SystemClock
System.currenttimemillis () is described in the document, which means that it is not suitable for places where time intervals are required, such as Thread.Sleep, Object.wait, because you can change its value by System.setcurrenttimemillis.
To use the time interval, we recommend using the relevant methods in Systemclock.
Systemclock.currentthreadtimemillis ();//Elapsed time in the current threadSystemclock.elapsedrealtime ();//milliseconds from power on to now (sleep) is also included in the time of the phoneSystemclock.uptimemillis ();//milliseconds from power on to now (phone sleep time not included)Systemclock.sleep (100);//similar to Thread.Sleep (100); But the method ignores interruptedexceptionSystemclock.setcurrenttimemillis (1000);//set the clock time, similar to System.setcurrenttimemillis//time intervalLongTimeInterval = Systemclock.uptimemillis ()-Lasttime;//Do something with TimeInterval
Android.os.PowerManager
The meaning of PowerManager's flag:
//general usage of PowerManager, request and release wake-up lockPowerManager powermgr =(PowerManager) Getsystemservice (context.power_service);intFlags = Powermanager.screen_bright_wake_lock |Powermanager.acquire_causes_wakeup; WakeLock WakeLock= Powermgr.newwakelock (Flags, "for debug purpose Tag"); Wakelock.acquire (); //get wake-up lockWakelock.release ();//release wake-up lock//in the game, the acquire is placed in the Onresume, and the release is placed in OnPause so that the screen constants can be maintained while the program is running, and the original settings are restored when the program is in the background. //use of other APIs for PowerManagerPowermgr.gotosleep (Systemclock.uptimemillis () + 100);//100ms after entering sleepPowermgr.isscreenon ();//is the screen lit ?Powermgr.useractivity (Systemclock.uptimemillis () +100,true);//equivalent to pressing the home key will cause activation from sleep//other APIs for WakelockWakelock.acquire (1000);//get the wake-up lock and release after 1000msWakelock.isheld ();//is currently holding a wake-up lock//whether to use reference counting, which is enabled by default. The reference count should be 1 for the first request, plus 1 for the second, plus 1 for the next time. //when released, only a reference count of 0 o'clock is considered to be completely released (so call release multiple times)Wakelock.setreferencecounted (true);
Use of some classes in the Android.os package (RPM)