摘要:百度超過千億的中文網(wǎng)頁(yè)數(shù)據(jù)庫(kù),可以瞬間找到相關(guān)的搜索結(jié)果。小程序類型正式版,測(cè)試版,體驗(yàn)版小程序小程序頁(yè)面地址自定義圖標(biāo)需要集成圖片庫(kù)
SocialComponent
社會(huì)化組件
集成步驟1、依賴library庫(kù)
2、給Project的build.gradle文件添加如下代碼:
allprojects { repositories { google() jcenter() mavenCentral() maven { url "https://dl.bintray.com/thelasterstar/maven/" } } }
3、配制AndroidManifest.xml,添加如下代碼:
4、在自己的包名下添加wxapi包及里面的所有java文件
5、在自定義的Application中初始化
//初始化數(shù)據(jù) SocialHelper.get().setQqAppId("1107009250") .setWxAppId("wx2847b18acb41e535") .setWxAppSecret("78f713b76c61a38242e63ccdb3a96d68") .setWbAppId("2214687859") .setWbRedirectUrl("https://github.com/fengqingxiuyi");功能詳情
各功能使用詳情,請(qǐng)參考MainActivity.java
例如:
/** * 分享 */ public void jump2Share(View view) { ShareDataBean shareDataBean = new ShareDataBean(); HashMapshareTypeList = new HashMap<>(); shareTypeList.put(ISocialType.SOCIAL_WX_SESSION, WXShareHelper.TYPE_WEB); shareTypeList.put(ISocialType.SOCIAL_WX_TIMELINE, WXShareHelper.TYPE_WEB); shareTypeList.put(ISocialType.SOCIAL_WX_MINIPROGRAM, WXShareHelper.TYPE_MINIPROGRAM); shareTypeList.put(ISocialType.SOCIAL_QQ, QQShareHelper.TYPE_IMAGE_TEXT); shareTypeList.put(ISocialType.SOCIAL_WB, WBShareHelper.TYPE_TEXT); shareDataBean.shareType = shareTypeList; shareDataBean.shareTitle = "百度一下,你就知道"; shareDataBean.shareDesc = "全球最大的中文搜索引擎、致力于讓網(wǎng)民更便捷地獲取信息,找到所求。百度超過千億的中文網(wǎng)頁(yè)數(shù)據(jù)庫(kù),可以瞬間找到相關(guān)的搜索結(jié)果。"; shareDataBean.shareImage = "https://www.baidu.com/img/bd_logo1.png"; shareDataBean.shareUrl = "https://www.baidu.com/"; shareDataBean.shareMiniType = 0; //小程序類型 - 正式版:0,測(cè)試版:1,體驗(yàn)版:2 shareDataBean.shareMiniAppId = "gh_64c734bc4b8d"; //小程序AppId shareDataBean.shareMiniPage = "pages/fitting-room/index"; //小程序頁(yè)面地址 ArrayList socialTypeBeans = new ArrayList<>(); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_WX_SESSION)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_WX_TIMELINE)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_SMS)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_COPY)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_REFRESH)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_CUSTOM, "https://img.ezprice.com.tw/is/c.rimg.com.tw/s1/4/7e/29/21628111029801_843_s.jpg", "自定義圖標(biāo)需要集成圖片庫(kù)")); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_QQ)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_WB)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_WX_MINIPROGRAM)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_ALIPAY)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_COLLECTION)); socialTypeBeans.add(new SocialTypeBean(ISocialType.SOCIAL_SHOW_ALL)); SocialHelper.get().share(this, socialTypeBeans, shareDataBean, new IShareCallback() { @Override public void onSuccess(int socialType, String msg) { Toast.makeText(MainActivity.this, "MainActivity onSuccess, socialType = " + socialType +", msg = " + msg, Toast.LENGTH_SHORT).show(); } @Override public void onError(int socialType, String msg) { Toast.makeText(MainActivity.this, "MainActivity onError, socialType = " + socialType +", msg = " + msg, Toast.LENGTH_SHORT).show(); } @Override public void onCancel(int socialType) { Toast.makeText(MainActivity.this, "MainActivity onCancel, socialType = " + socialType, Toast.LENGTH_SHORT).show(); } }); }
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/76751.html
摘要:我不聽,我就是這么命名。任何服務(wù)啟動(dòng)以后,都會(huì)把自己注冊(cè)到的注冊(cè)表中當(dāng)服務(wù)死亡的時(shí)候,也會(huì)通知。服務(wù)拿到結(jié)果后,會(huì)把結(jié)果緩存在本地的注冊(cè)表里。根據(jù)負(fù)載均衡策略,從注冊(cè)表中選擇一個(gè)真正的實(shí)例地址。 原創(chuàng):小姐姐味道(微信公眾號(hào)ID:xjjdog),歡迎分享,轉(zhuǎn)載請(qǐng)保留出處。 這幾天可真是熱啊,泡個(gè)海澡是再好不過了。玩的正起勁,突然腳底絆上一股暗流,然后我就一直在水里旋轉(zhuǎn)旋轉(zhuǎn)旋轉(zhuǎn)...終于...
閱讀 1383·2023-04-25 16:45
閱讀 1923·2021-11-17 09:33
閱讀 2312·2021-09-27 14:04
閱讀 919·2019-08-30 15:44
閱讀 2638·2019-08-30 14:24
閱讀 3420·2019-08-30 13:59
閱讀 1695·2019-08-29 17:00
閱讀 894·2019-08-29 15:33