CodePudding user response:
Android APP tuning a small programA, demand
1, in the morning just to do new demand from our client to jump to its designated small program, our products is APP pull up a small program that specify
Note: the above leadership in April is actually put forward the demand, then through the blogger WeChat open platform, did not find, can only mail the official, the official to reply: temporary not opened the class interface application channels, attention please open platform website announcement information, thank you support!
Second, knowledge scope
The default readers have WeChat open platform registered account, mobile application development, small program (there can skip the second point, directly into the theme)
Readers who never access WeChat SDK (small programs, etc.), can quickly scan WeChat open document
Blogger simple overview WeChat open platform steps are as follows:
Registered WeChat open platform account: WeChat open platform
Login again after management center - mobile applications - to create mobile applications (detailed steps for the reader to see the document should be faster than the blogger understand)
Pay attention to the AppId application, signature with the package name can (download WeChat get signature tool, a blogger here on pit, lifted me up and then write)
Three, the code (full)
CallProgramAcitivity page bo Lord spun off from the project, wrote a page separately, fully meet the requirements and function point
The code is as follows:
Public class CallProgramAcitivity extends AppCompatActivity {
Private Button mBt.
@ Override
Protected void onCreate (@ Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
The setContentView (R.l ayout. Activity_callprogram);
MBt=the findViewById (R.i db t);
MBt. SetOnClickListener (new View. An OnClickListener () {
@ Override
Public void onClick (View v) {
String appId=AppConfig. WEIXIN_APP_ID;//fill in the application AppId
IWXAPI API=WXAPIFactory. CreateWXAPI (CallProgramAcitivity. This, appId);
WXLaunchMiniProgram. The Req the Req=new WXLaunchMiniProgram. The Req ();
The req. UserName=AppConfig. WEIXIN_XIAOCHENGXU_ID;//fill small program original id
The req. Path="/pages/home/home? Kx=KXX ";//pull a small program can take and path of the page, a thin application will not fill the default home page
The req. MiniprogramType=WXLaunchMiniProgram. The req. MINIPTOGRAM_TYPE_RELEASE;//optional open development version, experience and formal version
API. SendReq (the req);
}
});
}
} 12345678910111213141516171819202122232425
Corresponding page layout activity_callprogram. XML
<? The XML version="1.0" encoding="utf-8"?>
Android: layout_width="match_parent"
Android: layout_height="match_parent" & gt;
Android: text="APP tuning up the specified small program"
Android: layout_width="match_parent"
Android: layout_height="wrap_content"/& gt;
12345678910111213
Pay attention to add WeChat dependent libraries in APP build. Gradle
The official document:
WeChat official document
//wechat share login to collect payment, etc.
//the compile 'com. Tencent. Mm. Opensdk: wechat - SDK - android - with - the mta: +'
The compile 'com. Tencent. Mm. Opensdk: wechat - SDK - android - without - the mta: +'
123
Pay attention to add files wxapi add WXEntryActivity
@ Override
Public void onResp (BaseResp BaseResp) {
//2018/8/29 App tuning a small program
If (baseResp. GetType ()==MAND_LAUNCH_WX_MINIPROGRAM ConstantsAPI.COM {
WXLaunchMiniProgram. Resp launchMiniProResp=(WXLaunchMiniProgram. Resp) baseResp;
String extraData=https://bbs.csdn.net/topics/launchMiniProResp.extMsg;//corresponding small program component }
}
CodePudding user response:
Excuse me, can you tell me what you have been implemented from APP evoke WeChat small program, thank you!CodePudding user response:
Hello, our company's latest new requirements and the building, but we have no professional team of IOS and android, our APP is to use the MUI + it + implementation, now let me to do WeChat small programs and APP tune up with each other, but there is no experience and ideas, could you tell me the original poster can discuss in more detailCodePudding user response:
Every day outside the chain can achieve click on the link to jump directly to the WeChat small procedures, the public; Currently support SMS, email, baidu, zhihu, trill, quickly, QQ, WeChat, B stands, today's headlines, weibo, browser, and their development of APP and almost all of the APP, support interface statistics, optimization of perfection!