Detailed analysis of the process steps for the micro-letter SDK sharing function of Android programming _android

Source: Internet
Author: User
Tags md5

This article illustrates the detailed analysis of the process steps of the micro-letter SDK sharing function of Android programming. Share to everyone for your reference, specific as follows:

I've already analyzed how to share micro-information with official demos. Here I will no longer say, which about in their own application sharing is very simple, the author is also after a lot of toss to get success, in order to make everyone less detours, decided to introduce here from beginning to end how to share the function in their own applications

Note: The order can not be disorderly!!

1, the establishment of their own application testsharewx

(1) The application package name is Com.freeson.test, and then a test activity is established, named Testactivity, which has a button and EditText
(2) Run the program, please remember that at this time you compile the runtime, with the Android default Debug.keystore signature.

2, to the official website Http://open.weixin.qq.com/download/?lang=zh_CN Download Development Kit, decompression, will Libammsdk.jar copied to the Libs, and add it to the build path.

3, to the official website http://open.weixin.qq.com/agreement Register your application,

Here you omit the basic operations in front of you, and here you should take note of the following steps.

One step is to sign our program with a APK tool, because our program is already installed, so download the installation directly, Then enter the package name in the box on the phone (I'm com.freeson.test here, the package name can not be filled in the wrong OH), click the Generate button, this time will generate a MD5 value, input it into the registration page box (at this point we note that if our application has not been installed on the phone, the signing tool will be prompted not to find the relevant Package description, at this time we are conscious of what? )

Then enter the package name (I am here is com.freeson.test, the package name can not be filled in the wrong OH), and then submitted for review. The next is to wait for the micro-letter mm audit.

4, in step three we have got the AppID, in accordance with the SDK demo inside the provision method in our Testactivity test, OK all successful, whether there is a sense of achievement.

5, the days of the yard is really TM sad ah, I overtime code AH code ah, days past, the project developed to the last, after testing, all normal, with the official signature of the file to formally pack. And then test again. Oh,my God,what happened!!! , why have just been able to share the micro-letter, now Click Unexpectedly did not respond. Suddenly caught in fear .... Don't be afraid, I'll tell you why.

6, in fact, in the first step, it has been said, we apply in the official website of the AppID when filling in the application signature is generated by Debug.keystore. However, the APK that we are running on the phone at this time are signed with our own generated signatures (Xxx.keystore), and two signatures are inconsistent, so it's a matter of course that sharing fails. Because the micro-letter to the application of our verification, is through this signature to authenticate.

7, don't worry, there's a way to fix it, use our official signature file Xxx.keystore to formally package the program, then install to the phone, then run the micro-letter that signed APK tool, say our package name input to the inside, regenerate a MD5 signature, then to the official website http ://open.weixin.qq.com/agreement, find your previous level application, pull to the end, click Modify, enter the signature you just generated into it, and then save the resubmit review.

8, after doing the above things, all you have to do is to wait for the changes just resubmitted to pass the audit, or your micro-letter will not be able to share success.

9, one day, the registration of the application through the audit, run our packaged procedures, click on the micro-letter, Oh, yes. Found that we can share, finally can breathe a sigh of relief.

Note:

In the process of sharing, the author also encountered a lot of problems, here and you talk about, let everyone a little attention later.

1, or a signature problem, a project, a few people completed, if everyone is using their own default Debug.keystore to run, in the debug version, the micro-credit sharing function is certainly only in the application of the micro-letter AppID machine production apk can be normal.

2, on the micro-letter information to share the results of feedback, this should be noted that the following two points, or must not be sure to receive share feedback.

(1) The name of this activity must be wxentryactivity
(2) Wxentryactivity This class must be based on the application package name +WXAPI package (such as the above works, when the package name should be COM.FREESON.TEST.WXAPI)

Write here, finally to the end, the author is also toss a long time to understand the principle of micro-letter authentication. In a word, it's important to understand the signature.

I hope this article will help you with the Android program.

Related Article

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.