Summary of Android hot fixes (mainly Ali hundred Chuan)

Source: Internet
Author: User

1. Mainstream hot repair is QQ, and Ali Hundred Chuan

2. I recommend the use of Ali hundred Sichuan Reason first: The team in the nail has a special customer service two, for the novice is very convenient

3. Operation procedure: Ali hundred Chuan's API documentation very detailed I only say some pits:

1 "The following initialization can only be placed in oncreat () in other files does not work

private void Inithotfix () {
String appversion;
try {
appversion = This.getpackagemanager (). Getpackageinfo (This.getpackagename (), 0). Versionname;
} catch (Exception e) {
appversion = "1.0.0";
}
Initialize best placed in front of Attachbasecontext, initialize directly inside the application class, do not encapsulate to other classes
Sophixmanager.getinstance (). SetContext (This)
. Setappversion (appversion)
. Setaeskey (NULL)
. Setsecretmetadata (APPID, Appsecret, Rsasecret)
. Setenabledebug (True)
. Setpatchloadstatusstub (New Patchloadstatuslistener () {
@Override
public void onLoad (final int mode, final int code, final String info, final int handlepatchversion) {

String msg = new StringBuilder (""). Append ("mode:"). Append (Mode)
. Append ("code:"). Append (Code)
. Append ("info:"). Append (Info)
. Append ("Handlepatchversion:"). Append (handlepatchversion). toString ();

LOG.D (TAG, "oncreate://... "+ msg.tostring ());
if (Msgdisplaylistener! = null) {
Msgdisplaylistener.handle (msg);
} else {
Cachemsg.append ("\ n"). Append (msg);
}
Code parameter
Patch Load Callback Notification
if (code = = patchstatus.code_load_success) {
Indicates a successful patch load
} else if (code = = Patchstatus.code_load_relaunch) {
Indicates that a restart is required for the new patch to take effect. The developer can prompt the user or the forced restart;
Recommendation: Users can listen to the background events, and then call killprocesssafely suicide, in order to speed up the application of patches, see 1.3.2.3
} else {
Other error messages, see Patchstatus class description

}
}
}). Initialize ();
/
    
Sophixmanager.getinstance (). Queryandloadnewpatch ();

}
2. Use the patch tool to package Mr. into a jar package to regenerate into a log log or log to empty,
3. Test for patching if prompt for Package name error Check Step 1

Summary of Android hot fixes (mainly Ali-chuan)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.