CN103914316A - Method for setting automatic power on and automatic poweroff of Android system - Google Patents

Method for setting automatic power on and automatic poweroff of Android system Download PDF

Info

Publication number
CN103914316A
CN103914316A CN201210594259.4A CN201210594259A CN103914316A CN 103914316 A CN103914316 A CN 103914316A CN 201210594259 A CN201210594259 A CN 201210594259A CN 103914316 A CN103914316 A CN 103914316A
Authority
CN
China
Prior art keywords
time
function
automatic
automatic shutdown
auto
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201210594259.4A
Other languages
Chinese (zh)
Inventor
朱允意
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Simcom Ltd
Original Assignee
Shanghai Simcom Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Simcom Ltd filed Critical Shanghai Simcom Ltd
Priority to CN201210594259.4A priority Critical patent/CN103914316A/en
Publication of CN103914316A publication Critical patent/CN103914316A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method for setting automatic power on and automatic poweroff of an Android system. The method for setting automatic power on of the Android system comprises a first step of setting RTC_POWEROFF_EXT parameters and automatic power-on time, wherein RTC_POWEROFF_EXT shows that the Android system comprises a poweroff alarm clock macro which is of an alarm clock management type; and a second step of setting the RTC_POWEROFF_EXT parameters and the automatic power-on time to an RTC clock of a base layer. Through the method, the automatic power on and poweroff operation which is practical and convenient can be achieved only on an application layer without needing to modify inner core and base layer codes.

Description

The method to set up of Auto Power On and automatic shutdown in Android system
Technical field
The present invention relates to the method to set up of Auto Power On and automatic shutdown in a kind of Android system, particularly a kind of method to set up without revising Auto Power On and automatic shutdown in the Android system of bottom code.
Background technology
Current electronic devices has the function of automatic switching, and, after being provided with start, unused time, equipment can be in then Auto Power On, the shutdown of the time of its setting.
This function can make the more effective electronic equipments such as mobile phone that utilize of busy modern, and to save the power consumption of battery of mobile phone and to save loss, simultaneously real accomplishing advoided harassing and wrecking with radiationless during mobile phone shutdown; In addition, current automatic opening/closing function is mostly realized the design of hommization more---consider when default automatic shutdown time then, mobile phone can according to user at that time the difference of service condition make different processing, for example:
1, cellphone subscriber does not use mobile phone, and automatic shutdown can provide the shutdown prompting frame of a countdown in 10 seconds, gives tacit consent to countdown in 10 seconds and finishes defensive position auto-shut-off;
2, cellphone subscriber converses, and automatic shutdown can be in onset after end of conversation;
3, cellphone subscriber is just in browsing page, the operation such as send short messages, automatic shutdown can provide the shutdown dialog box of a countdown in 10 seconds, in this dialog box, there is " confirmation " and " cancellation " option, " confirmation " option is used for shutting down in advance before countdown in 10 seconds finishes, and " cancellation " option is used for cancelling this automatic shutdown, can certainly wait acquiescence countdown in 10 seconds to finish defensive position auto-shut-off.
But to want at Android(Android be a kind of take Linux as basic open source code operating system, be mainly used in portable equipment.Not yet there is at present unified Chinese, the more people in CONTINENTAL AREA OF CHINA uses " Android " or " peace causes ", Linux, Linux is that (UNIX operating system is the operating system that AT & T company of the U.S. moved on PDP-11 in 1971 for a kind of class Unix operating system of free and open source code.There is the feature of multi-user, multitask, support various processor framework, developed in the Bell Laboratory at AT & T in 1969 by willing Thompson (Kenneth Lane Thompson), Denis Ritchie (Dennis MacAlistair Ritchie) and Douglas McIlroy the earliest)) realize in system difficultly as above-mentioned automatic opening/closing function, mainly face following problem:
1, about automatic shutdown, in prior art, there are a lot of application programs and example, but be mostly that equipment is set to offline mode and not shutdown truly, also has the also problem of be faced with " mobile phone is after deep sleep (general mobile phone goes out to shield and more than 6 seconds will enter deep sleep state), and the automatic shutdown of setting is inoperative " of some examples more;
2, about Auto Power On, in prior art, rarely have implementation, the implementation method that minority can realize Auto Power On but needs to revise the code of kernel and bottom, and the difficulty in practical operation is well imagined.
Summary of the invention
The technical problem to be solved in the present invention is in order to overcome the defect that the automatic switching difficulty that realizes equipment in prior art is large, need to revise the code of kernel and bottom, and a kind of method to set up without revising Auto Power On and automatic shutdown in the Android system of bottom code is provided.
The present invention solves above-mentioned technical matters by following technical proposals:
A method to set up for Auto Power On in Android system, its feature is, it comprises the following steps:
Step S 1, RTC_POWEROFF_EXT parameter and Auto On Time are set, wherein, RTC_POWEROFF_EXT represents that the shutdown alarm clock that contains alarm clock administrative class in Android system is grand;
Step S 2, this RTC_POWEROFF_EXT parameter and this Auto On Time are set on the RTC clock (Real-Time Clock, real-time clock) of bottom.
Preferably, step S 1also comprise before:
Step S 0, Auto Power On is set interface is set, this Auto Power On arranges interface for enabling this automatic turn-on function and this Auto On Time is set for user.
Preferably, step S 0in also comprise:
Step S 01, adopt linear placement generate interface layout's file, this interface layout's file comprises the view for Auto On Time is set, for showing the text view of the set Auto On Time of user and for the check box view of enabling with closing of automatic turn-on function is set;
Step S 02, adopt one to realize class and realize the setting at Auto Power On interface, be necessary file in each android program at AndroidManifest.xml(AndroidManifest.xml.It is positioned at the root directory of whole project, package(bag has been described) the middle assembly exposing, they separately realize class, the data that various energy are processed and enable position) in statement this realize class, wherein, for this adds one first click event monitoring function for the view of Auto On Time is set, this first click event monitoring function is used for creating a set of time dialog box and is used for arranging Auto On Time, and in the time that this Auto On Time setting completes, call onTimeSet (), in onTimeSet (), the on time of setting can be saved in and in application program preference, then upgrade interface, for adding one second, the check box view of enabling with closing for automatic turn-on function is set clicks action listener function, Auto Power On function is opened or closed to this second click action listener function, for the open and close state of automatic turn-on function is saved in to application program preference, to call.Wherein, set of time function is shown as accompanying drawing 5 by set of time dialog box TimePickerDialog() and onTimeSet () jointly complete.OnTimeSet () is a call back function, when set of time dialog box TimePickerDialog has been used at an interface, generally need in this interface, realize an interface OnTimeSetListener, this interface and onTimeSet () are one-to-one relationships.In the time that the time sets up into by " set " button as in this document accompanying drawing 5, Android system guarantees that and then onTimeSet () call back function is performed.In onTimeSet () function, do in the present invention two things: the one, the turn on or off time of setting is saved in preference; The 2nd, the function that calls renewal interface upgrades the newly-installed time.
Preferably, this is realized in class and also comprises for enabling the static function of Auto Power On next time and calling to outer category.
Preferably, step S 2also comprise afterwards:
Step S 3, a radio receiver is set, for receiving this Auto Power On event, and in AndroidManifest.xml, state this radio receiver.
The present invention also provides the method to set up of automatic shutdown in a kind of Android system, and its feature is, it comprises the following steps:
Step S1, RTC_POWEROFF_EXT parameter, automatic shutdown time and automatic shutdown event are set, wherein, RTC_POWEROFF_EXT represents that the shutdown alarm clock that contains alarm clock administrative class in Android system is grand, and this automatic shutdown event is for triggering the operation of automatic shutdown;
Step S 2, a radio receiver is set, for receiving this automatic shutdown event, and in AndroidManifest.xml, state this radio receiver.
Preferably, in this radio receiver, also comprise a talking state monitoring function, for judging whether in talking state.
Preferably, step S 1also comprise before:
Step S 0, automatic shutdown is set interface is set, this automatic shutdown arranges interface for enabling this automatic shut-off function and this automatic shutdown time is set for user.
Preferably, step S 0in also comprise:
Step S 01, adopt linear placement generate interface layout's file, this interface layout's file comprises the view for automatic shutdown time is set, for showing the text view of the set automatic shutdown time of user and for the check box view of enabling with closing of automatic shut-off function is set;
Step S 02, adopt one to realize class and realize the setting at automatic shutdown interface, in AndroidManifest.xml, state that this realizes class, wherein, for this thirdly hits action listener function for the view interpolation one that automatic shutdown time is set, this thirdly hits action listener function for creating a set of time dialog box for automatic shutdown time is set, and in the time that this automatic shutdown time setting completes, call onTimeSet (), in onTimeSet (), the unused time of setting can be saved in and in application program preference, then upgrade interface; For adding one the 4th click event, the check box view of enabling with closing for automatic shut-off function is set monitors function, the 4th click event is monitored function for the open and close state of automatic shut-off function is saved in to application program preference, opens or close automatic shutdown function to call.
Preferably, this is realized in class and also comprises for enabling the static function of automatic shutdown next time and calling to outer category with the static function of cancelling current automatic shutdown.
Positive progressive effect of the present invention is: by method of the present invention, in Android system mobile phone, only can realize practicality and the pure automatic switch machine operation of hommization in application layer without revising kernel and bottom code.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the method to set up of Auto Power On in the Android system described in one embodiment of the invention.
Fig. 2 is the process flow diagram of the method to set up of automatic shutdown in the Android system described in one embodiment of the invention.
Fig. 3 is the interface sectional drawing of mobile phone automatic opening/closing function in an application example of the present invention.
Fig. 4 is the initial interface sectional drawing of mobile phone automatic opening/closing function in an application example of the present invention.
Fig. 5 be in an application example of the present invention in mobile phone automatic opening/closing function the time interface sectional drawing is set.
Fig. 6 is the interface sectional drawing of only enabling automatic turn-on function in an application example of the present invention.
Fig. 7 is the interface sectional drawing of only enabling automatic shut-off function in an application example of the present invention.
Fig. 8 is the interface sectional drawing of simultaneously enabling Auto Power On and automatic shut-off function in an application example of the present invention.
Fig. 9 is the interface sectional drawing of simultaneously closing Auto Power On and automatic shut-off function in an application example of the present invention.
Figure 10 is the interface sectional drawing of countdown automatic shutdown in an application example of the present invention.
Embodiment
Mode below by embodiment further illustrates the present invention, but does not therefore limit the present invention among described scope of embodiments.
With reference to figure 1, introduce the method to set up of Auto Power On in the Android system described in embodiment, it comprises the following steps:
Step 101, arranges RTC_POWEROFF_EXT parameter and Auto On Time, and wherein, RTC_POWEROFF_EXT represents that the shutdown alarm clock that contains alarm clock administrative class in Android system is grand;
Step 102, is set to this RTC_POWEROFF_EXT parameter and this Auto On Time on the RTC clock of bottom.
Wherein, before step 101, also comprise:
Step 100, arranges Auto Power On interface is set, and this Auto Power On arranges interface for enabling this automatic turn-on function and this Auto On Time is set for user.
Specifically, in step 100, also comprise:
Adopt linear placement to generate interface layout's file, this interface layout's file comprises the view for Auto On Time is set, for showing the text view of the set Auto On Time of user and for the check box view of enabling with closing of automatic turn-on function is set;
Employing one realizes class and realizes the setting at Auto Power On interface, in AndroidManifest.xml, state that this realizes class, wherein, for this adds one first click event monitoring function for the view of Auto On Time is set, this first click event monitoring function is used for creating a set of time dialog box and is used for arranging Auto On Time, and in the time that this Auto On Time setting completes, call onTimeSet (), in onTimeSet (), the on time of setting can be saved in and in application program preference, then upgrade interface; For adding one second, the check box view of enabling with closing for automatic turn-on function is set clicks action listener function, Auto Power On function is opened or closed to this second click action listener function, for the open and close state of automatic turn-on function is saved in to application program preference, to call.
More specifically, this is realized in class and also comprises for enabling the static function of Auto Power On next time and calling to outer category.
For the use that this automatic turn-on function can be gone round and begun again, after step 102, also comprise:
One radio receiver is set, for receiving this Auto Power On event, and in AndroidManifest.xml, states this radio receiver.
With reference to figure 2, introduce in the present embodiment the method to set up of automatic shutdown in Android system, it comprises the following steps:
Step 201, RTC_POWEROFF_EXT parameter, automatic shutdown time and automatic shutdown event are set, wherein, RTC_POWEROFF_EXT represents that the shutdown alarm clock that contains alarm clock administrative class in Android system is grand, and this automatic shutdown event is for triggering the operation of automatic shutdown;
Step 202, arranges a radio receiver, for receiving this automatic shutdown event, and in AndroidManifest.xml, states this radio receiver.
In order not affect user's use, in this radio receiver, also comprise a talking state monitoring function, for judging whether in talking state.Can be set to after talking state finishes automatic shutdown again.
Wherein, before step 201, also comprise:
Step 200, arranges automatic shutdown interface is set, and this automatic shutdown arranges interface for enabling this automatic shut-off function and this automatic shutdown time is set for user.
Specifically, in step 200, also comprise:
Adopt linear placement to generate interface layout's file, this interface layout's file comprises the view for automatic shutdown time is set, for showing the text view of the set automatic shutdown time of user and for the check box view of enabling with closing of automatic shut-off function is set;
Employing one realizes class and realizes the setting at automatic shutdown interface, in AndroidManifest.xml, state that this realizes class, wherein, for this thirdly hits action listener function for the view interpolation one that automatic shutdown time is set, this thirdly hits action listener function for creating a set of time dialog box for automatic shutdown time is set, and in the time that this automatic shutdown time setting completes, call onTimeSet (), in onTimeSet (), the unused time of setting can be saved in and in application program preference, then upgrade interface; For adding one the 4th click event, the check box view of enabling with closing for automatic shut-off function is set monitors function, the 4th click event is monitored function for the open and close state of automatic shut-off function is saved in to application program preference, opens or close automatic shutdown function to call.
For the ease of user's use, this is realized in class and also comprises for enabling the static function of automatic shutdown next time and calling to outer category with the static function of cancelling current automatic shutdown.
With reference to figure 3-Figure 10, in conjunction with user's use angle, with a simple application example, again introduce technical scheme of the present invention below.
Fundamental purpose of the present invention is in order to offer a kind of method without revising kernel and bottom code and only can realize in application layer above-mentioned practicality and the pure automatic switch maneuver energy of hommization of Android system mobile phone user.
The present invention has used for reference the implementation method of the shutdown alarm clock (alarm clock is also normally onset under mobile phone shutdown state) of the alarm clock application program that Android system carries dexterously, has mainly realized above-mentioned purpose by alarm clock administrative class AlarmManager is set in application layer.
Specifically, in order to realize Auto Power On, general way need to be revised kernel and bottom code, it is mainly the correlative code that increases Auto Power On in RTC clock, the method that the present invention has used for reference shutdown alarm clock has dexterously realized Auto Power On, grand the shutdown alarm clock that contains alarm clock administrative class RTC_POWEROFF_EXT and Auto On Time is set on the RTC clock of bottom; About the problem of " mobile phone is inoperative at deep sleep state automatic shutdown ", say so more accurately " under deep sleep state; cell phone apparatus can not be waken up ", cause the reason of this problem to be: the grand RTC_WAKEUP of alarm clock administrative class can to wake cell phone apparatus up and trigger Intent(Intent should be distinctive thing in Android in the moment of setting in theory.You can in Intent, designated program will be carried out action (such as view, edit, dial), and program needed data while carrying out this action.After all specifying well, as long as call startActivity (), Android system can Automatic-searching meets you most specifies the application program of requirement, and carry out this program), but in fact this grandly can not really wake cell phone apparatus up under mobile phone deep sleep state, in order to address this problem, the present invention has utilized the grand RTC_POWEROFF_EXT of shutdown alarm clock of alarm clock administrative class can under deep sleep state, wake the characteristic of cell phone apparatus up equally.
Specific implementation is divided following 4 parts:
<1> realizes one interface is set:
At this interface, cellphone subscriber can arrange automatic switching, comprises unlatching, closes and 3 kinds of operations of setup times.User can only open start or shutdown, can open start and open again shutdown, can certainly not open.
This interface is mainly realized by following 2 parts:
[1] interface layout's file auto_power_on_off.xml
This interface layout realizes with the LinearLayout of linear placement, view auto_power_on_container is wherein used for arranging Auto On Time, text view tV_auto_power_on time is for showing the Auto On Time of setting, and CheckBox check box cb_auto_power_on is for arranging the open and close of Auto Power On; View auto_power_off_container is wherein used for arranging automatic shutdown time, text view tV_auto_power_off_time is for showing the automatic shutdown time of setting, and CheckBox check box cb_auto_power_off is for arranging the open and close of automatic shutdown:
[2] realize automatic switching interface is set
This realizes class is AutoPowerOnOffSettingActivity.java, its entrance is placed under the catalogue at the same level of " setting "-> " about mobile phone ", and states that this realizes class in the AndroidManifest.xml file of whole " setting " application.
For Auto Power On, for click event in view auto_power_on_container interpolation is monitored function mPowerOnTimeSetListener, this monitoring function can create a set of time dialog box and be used for arranging Auto On Time, in the time that the time sets up into, can call onTimeSet (), in onTimeSet (), the on time of setting can be saved in application program preference SharedPreferences and then upgrade interface; Represent the open and close state of Auto Power On with whether choosing of check box cb_auto_power_on, for adding upper click event, it monitors function mCBPowerOnListener simultaneously, this monitoring function can be saved in the open and close state of Auto Power On in application program preference SharedPreferences, then calls and opens or close Auto Power On function.
Automatic shutdown is similar to above-mentioned Auto Power On.
In addition, realize and in class, also contain that static function " is opened Auto Power On next time ", " opening automatic shutdown next time " and " cancelling current automatic shutdown " (refers to AutoPowerOnOffCycleReceiver.java here to outer category at this, such goes down for the work that the automatic switch maneuver energy arranging is gone round and begun again, and can in part 2, tell about) use.Code and annotation are as follows:
With reference to figure 3-Figure 10, in this application example, represent that with whether choosing of check box whether the function of Auto Power On and automatic shutdown enable.
The work that <2> goes round and begins again the automatic switch function arranging down:
The way that ratio is easier to expect be by the setRepeating () function of alarm clock administrative class AlarmManager arrange one every 1 day with regard to automatic switching behavior once.But in real work, find that this function can not periodically work.
For the work that the automatic switch function arranging is gone round and begun again down, we realize a radio receiver AutoPowerOnOffCycleReceiver, and this radio receiver registration receives start event, shut down event, change event is set in time zone and set of time changes event.Note in AndroidManifest, stating this radio receiver, code is as follows:
By the ingenious linking of " when mobile phone shutdown; ' Auto Power On is next time set ' ", " when mobile phone power-on; ' automatic shutdown is next time set ' " and " while having revised time of mobile phone or time zone; first ' cancelling current automatic shutdown '; ' open automatic shutdown next time ' again ", complete the function that work that automatic switch function is gone round and begun again down.Code and annotation are as follows:
The realization of <3> automatic turn-on function:
For Auto Power On, as long as RTC_POWEROFF_EXT parameter and on time setting are set on bottom RTC clock by alarm clock administrative class AlarmManager, Android system will arrange on time then, judge that whether mobile phone is in off-mode, if, just start, otherwise, do nothing.
The realization of <4> automatic shut-off function:
For automatic shutdown, realize a radio receiver AutoPowerOffReceiver, this radio receiver registration receives us, in part 1, a self-defining shut down event ACTION_AUTO_SHUTDOWN in interface A utoPowerOnOffSettingActivity.java is set, and this event can be at the automatic shutdown time arranging then by Android system triggers.Note in AndroidManifest, stating this radio receiver, code is as follows:
When this radio receiver receives after self-defined shut down event ACTION_AUTO_SHUTDOWN, judge when whether mobile phone state is " generally " state: if, directly start 10 seconds countdown automatic shutdown interfaces---AutoPowerOffActivity, if not, new call status monitoring function, in this monitoring function, when mobile phone state is when " call " or " incoming call " becomes " generally " state, start 10 seconds countdown automatic shutdown interfaces.Code and annotation are as follows:
At 10 seconds countdown automatic shutdown interfaces---AutoPowerOffActivity.jaVa, can provide the dialog box of a countdown in 10 seconds, in this dialog box, there is " confirmation " and " cancellation " option, " confirmation " option is used for shutting down in advance before countdown in 10 seconds finishes, and " cancellation " option is used for cancelling this automatic shutdown, can certainly wait acquiescence countdown in 10 seconds to finish defensive position auto-shut-off.Mainly realize by countdown class CountDownTimer, reminder dialog frame AlertDialog and Intent.ACTION_REQUEST_SHUTDOWN system closedown event at this interface, and code and annotation are as follows:
The above is only a kind of implementation of code, and those skilled in the art can have multiple concrete implementation according to principle of the present invention.
For example, the user of a mobile phone arranges 8:00 Auto Power On every morning, evening 11:00 automatic shutdown, and specifically, the step of use is such:
<1> finds automatic switching entrance, the function that automatic switching is enabled in preparation, and interface is as shown in Figure 3;
<2> presents automatic switching initial setting up interface, as shown in Figure 4 after clicking and entering automatic switching and arrange;
<3> clicks Auto Power On, and entry time arranges interface, as shown in Figure 5;
<4> arranges after 8:00 Auto Power On, chooses Auto Power On check box, as shown in Figure 6;
<5> clicks automatic shutdown, and entry time arranges interface, as shown in Figure 5;
<6> arranges after 23:00 automatic shutdown, chooses automatic shutdown check box, as shown in Figure 8 (if only open automatic shut-off function, interface as shown in Figure 7).
<7> point every mornings 8, mobile phone meeting Auto Power On;
<8> point every nights 11, mobile phone meeting automatic shutdown;
<9> is in the general use of mobile phone (being not talking state) wherein, countdown in 10 seconds shutdown interface, as shown in figure 10.
In general, after radio receiver receives event, shut down event judges that this event is that shut down event (for example electric weight deficiency, automatic shutdown time that time is up arranges), start event or time or time zone change event, if can arrange Auto Power On next time; If start event, can arrange next automatic shutdown; If time or time zone change event, can cancel current automatic shutdown, next automatic shutdown is set.
After being provided with Auto Power On, can judge that whether mobile phone is in off-mode, if so, row judges whether to be provided with the function of Auto Power On and whether has arrived the Auto On Time arranging again, if so, automatically opens mobile phone.
For automatic shutdown, first judge that whether mobile phone is in open state, if, continue to judge the automatic shutdown time arranging has been enabled and whether arrived to automatic shut-off function whether, if so, judges whether radio receiver has received the shut down event of predefined, if, general use state continues to judge the state of mobile phone, if will shut down after pointing out the user preset time; If converse, after end of conversation, point out user's countdown shutdown.
Below the only introduction of some conventional scenes, not for limiting the present invention.
By method of the present invention, in Android system mobile phone, only can realize practicality and the pure automatic switch machine operation of hommization in application layer without revising kernel and bottom code.
Although more than described the specific embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate, protection scope of the present invention is limited by appended claims.Those skilled in the art is not deviating under the prerequisite of principle of the present invention and essence, can make various changes or modifications to these embodiments, but these changes and modification all fall into protection scope of the present invention.

Claims (10)

1. a method to set up for Auto Power On in Android system, is characterized in that, it comprises the following steps:
Step S 1, RTC_POWEROFF_EXT parameter and Auto On Time are set, wherein, RTC_POWEROFF_EXT represents that the shutdown alarm clock that contains alarm clock administrative class in Android system is grand;
Step S 2, this RTC_POWEROFF_EXT parameter and this Auto On Time are set on the RTC clock of bottom.
2. the method to set up of Auto Power On in Android system as claimed in claim 1, is characterized in that step S 1also comprise before:
Step S 0, Auto Power On is set interface is set, this Auto Power On arranges interface for enabling this automatic turn-on function and this Auto On Time is set for user.
3. the method to set up of Auto Power On in Android system as claimed in claim 2, is characterized in that step S 0in also comprise:
Step S 01, adopt linear placement generate interface layout's file, this interface layout's file comprises the view for Auto On Time is set, for showing the text view of the set Auto On Time of user and for the check box view of enabling with closing of automatic turn-on function is set;
Step S 02, adopt one to realize class and realize the setting at Auto Power On interface, in AndroidManifest.xml, state that this realizes class, wherein, for this adds one first click event monitoring function for the view of Auto On Time is set, this first click event monitoring function is used for creating a set of time dialog box and is used for arranging Auto On Time, and in the time that this Auto On Time setting completes, call onTimeSet (), in onTimeSet (), the on time of setting can be saved in and in application program preference, then upgrade interface; For adding one second, the check box view of enabling with closing for automatic turn-on function is set clicks action listener function, Auto Power On function is opened or closed to this second click action listener function, for the open and close state of automatic turn-on function is saved in to application program preference, to call.
4. the method to set up of Auto Power On in Android system as claimed in claim 3, is characterized in that, this is realized in class and also comprises for enabling the static function of Auto Power On next time and calling to outer category.
5. the method to set up of Auto Power On in Android system as claimed in claim 1, is characterized in that step S 2also comprise afterwards:
Step S 3, a radio receiver is set, for receiving this Auto Power On event, and in AndroidManifest.xml, state this radio receiver.
6. a method to set up for automatic shutdown in Android system, is characterized in that, it comprises the following steps:
Step S 1, RTC_POWEROFF_EXT parameter, automatic shutdown time and automatic shutdown event are set, wherein, RTC_POWEROFF_EXT represents that the shutdown alarm clock that contains alarm clock administrative class in Android system is grand, this automatic shutdown event is for triggering the operation of automatic shutdown;
Step S 2, a radio receiver is set, for receiving this automatic shutdown event, and in AndroidManifest.xml, state this radio receiver.
7. the method to set up of automatic shutdown in Android system as claimed in claim 6, is characterized in that, also comprises a talking state monitoring function, for judging whether in talking state in this radio receiver.
8. the method to set up of automatic shutdown in Android system as claimed in claim 6, is characterized in that step S 1also comprise before:
Step S 0, automatic shutdown is set interface is set, this automatic shutdown arranges interface for enabling this automatic shut-off function and this automatic shutdown time is set for user.
9. the method to set up of automatic shutdown in Android system as claimed in claim 8, is characterized in that step S 0in also comprise:
Step S 01, adopt linear placement generate interface layout's file, this interface layout's file comprises the view for automatic shutdown time is set, for showing the text view of the set automatic shutdown time of user and for the check box view of enabling with closing of automatic shut-off function is set;
Step S 02, adopt one to realize class and realize the setting at automatic shutdown interface, in AndroidManifest.xml, state that this realizes class, wherein, for this thirdly hits action listener function for the view interpolation one that automatic shutdown time is set, this thirdly hits action listener function for creating a set of time dialog box for automatic shutdown time is set, and in the time that this automatic shutdown time setting completes, call onTimeSet (), in onTimeSet (), the unused time of setting can be saved in and in application program preference, then upgrade interface; For adding one the 4th click event, the check box view of enabling with closing for automatic shut-off function is set monitors function, the 4th click event is monitored function for the open and close state of automatic shut-off function is saved in to application program preference, opens or close automatic shutdown function to call.
10. the method to set up of automatic shutdown in Android system as claimed in claim 9, is characterized in that, this is realized in class and also comprises for enabling the static function of automatic shutdown next time and calling to outer category with the static function of cancelling current automatic shutdown.
CN201210594259.4A 2012-12-31 2012-12-31 Method for setting automatic power on and automatic poweroff of Android system Pending CN103914316A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210594259.4A CN103914316A (en) 2012-12-31 2012-12-31 Method for setting automatic power on and automatic poweroff of Android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210594259.4A CN103914316A (en) 2012-12-31 2012-12-31 Method for setting automatic power on and automatic poweroff of Android system

Publications (1)

Publication Number Publication Date
CN103914316A true CN103914316A (en) 2014-07-09

Family

ID=51040021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210594259.4A Pending CN103914316A (en) 2012-12-31 2012-12-31 Method for setting automatic power on and automatic poweroff of Android system

Country Status (1)

Country Link
CN (1) CN103914316A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528309A (en) * 2016-11-30 2017-03-22 武汉斗鱼网络科技有限公司 Update system and update method for updating operation interface
CN111225113A (en) * 2020-01-08 2020-06-02 青岛海信移动通信技术股份有限公司 Communication terminal and starting method thereof
CN112000384A (en) * 2020-09-03 2020-11-27 深圳市智微智能软件开发有限公司 Timing startup and shutdown method and device for Android equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986266A (en) * 2010-10-22 2011-03-16 浙江大学 Method for transplanting Android mobile phone operating system to Atom development board
CN102289279A (en) * 2011-09-01 2011-12-21 上海果壳电子有限公司 Equipment management method and device based on RTC (Real-Time Clock) clock interrupt
CN102821207A (en) * 2012-08-15 2012-12-12 北京小米科技有限责任公司 Implementation method for alarm clock under shutdown state and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986266A (en) * 2010-10-22 2011-03-16 浙江大学 Method for transplanting Android mobile phone operating system to Atom development board
CN102289279A (en) * 2011-09-01 2011-12-21 上海果壳电子有限公司 Equipment management method and device based on RTC (Real-Time Clock) clock interrupt
CN102821207A (en) * 2012-08-15 2012-12-12 北京小米科技有限责任公司 Implementation method for alarm clock under shutdown state and mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MELANIE DENG: "Android自动开关机实现", 《HTTP://WWW.CNBLOGS.COM/MELANIEDENG/ARCHIVE/2012/02/16/2355066.HTML》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528309A (en) * 2016-11-30 2017-03-22 武汉斗鱼网络科技有限公司 Update system and update method for updating operation interface
CN111225113A (en) * 2020-01-08 2020-06-02 青岛海信移动通信技术股份有限公司 Communication terminal and starting method thereof
CN112000384A (en) * 2020-09-03 2020-11-27 深圳市智微智能软件开发有限公司 Timing startup and shutdown method and device for Android equipment

Similar Documents

Publication Publication Date Title
CN102196097A (en) Method and device for automatically closing idle programs of mobile communication terminal background
CN105554316B (en) A kind of realization method and system of reserved intelligent terminal battery capacity
CN102298532B (en) Startup-item-based management method and device
CN102711098B (en) Method for preventing background flow of application program from being lost
CN106055073B (en) A kind for the treatment of method and apparatus based on bright screen lock
CN106256116B (en) A kind of method and terminal controlling application program
CN103064669B (en) The timing wake-up method and system of smart machine
CN101287036B (en) Method and device for preventing mobile phone from being woke-up in stand-by state
CN104486510A (en) Method for reducing power consumption of intelligent terminal, and system for reducing power consumption of intelligent terminal
CN105183137A (en) Mobile terminal and wake lock control method and system thereof
CN101604224A (en) A kind of icon display packing, system and portable terminal of application program
CN103345424A (en) Mobile terminal and control method of application program of mobile terminal
CN103313359A (en) Power saving method and power saving device for mobile terminal and mobile terminal
CN104660777B (en) The function setting method of touch-screen mobile phone and its physical button
CN102917130A (en) Method and system for preventing mis-operation of touch-screen intelligent mobile phone
CN103227851B (en) Method and device for communication terminal recording
CN105335146B (en) The method and portable electronic device of management software data traffic
CN103313427A (en) Method and device for starting data network of mobile terminal and mobile terminal
CN103914316A (en) Method for setting automatic power on and automatic poweroff of Android system
CN102520927A (en) Method, device and terminal for generation logic business of embedded terminal
CN105704758A (en) Method and device of closing social applications based on flow monitoring
CN103327161B (en) Terminal and fast starting method
CN103067938A (en) Mobile terminal dataflow saving method
CN101820471A (en) Setting method of timing automatic executing function of mobile phone
CN104267992A (en) Method and device of mobile terminal shielding wake-up program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140709

WD01 Invention patent application deemed withdrawn after publication