微信朋友圈分享、QQ分享

1、首先微信开放平台、腾讯开放平台申请权限并获取APPID:及需要的相关信息,百度有好多

我使用的是sharesdk --下载链接:点击此处下载即可

一、获取sharesdk的key,可参考快速集成开发指南

二、配置清单文件,在中添加以下权限

[html]  view plain  copy
  1. <span style="font-family:'KaiTi_GB2312';font-size:14px;"><uses-permission android:name="android.permission.GET_TASKS" />  
  2.  <uses-permission android:name="android.permission.INTERNET" />  
  3.  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />  
  4.  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />  
  5.  <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />  
  6.  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />  
  7.  <uses-permission android:name="android.permission.READ_PHONE_STATE" />  
  8.  <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>  
  9.  <uses-permission android:name="android.permission.GET_ACCOUNTS"/>  
  10.  <!-- 蓝牙分享所需的权限 -->  
  11.   <uses-permission android:name="android.permission.BLUETOOTH" />  
  12.   <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /></span>  

三、添加ShareSDK必要的activity


[html]  view plain  copy
  1. <activity  
  2.         android:name="com.mob.tools.MobUIShell"  
  3.         android:theme="@android:style/Theme.Translucent.NoTitleBar"  
  4.         android:configChanges="keyboardHidden|orientation|screenSize"  
  5.         android:screenOrientation="portrait"  
  6.        android:windowSoftInputMode="stateHidden|adjustResize" >  
  7.  <!-- QQ和QQ空间分享 QQ登录的回调必须要配置的 -->  
  8.     <intent-filter>  
  9.            <data android:scheme="tencent100371282" />  
  10.            <action android:name="android.intent.action.VIEW" />  
  11.            <category android:name="android.intent.category.BROWSABLE" />  
  12.            <category android:name="android.intent.category.DEFAULT" />  
  13.     </intent-filter>  
  14.   
  15.     <!-- 新浪微博客户端分享回调必须配置 -->  
  16.         <intent-filter>  
  17.                 <action android:name="com.sina.weibo.sdk.action.ACTION_SDK_REQ_ACTIVITY" />  
  18.                 <category android:name="android.intent.category.DEFAULT" />  
  19.         </intent-filter>  
  20.  </activity>  
注:上面intent, QQ的回调intent,实现QQ的分享必须要添加,并且保证您assets下的sharesdk.xml里配置的QQ的appid与这里的tencent后面的appid保持一致,否则QQ分享是没有回调的,注意替换的时候tencent保留,只替换后面的appid (不需要QQ或者微博可以不配置intent过滤,但是mobuishell这个activity必须要有)


然后配置微信回调Activity 

[html]  view plain  copy
  1. <!--微信分享回调 -->  
  2.  <activity  
  3.      android:name=".wxapi.WXEntryActivity"  
  4.      android:theme="@android:style/Theme.Translucent.NoTitleBar"  
  5.      android:configChanges="keyboardHidden|orientation|screenSize"  
  6.      android:exported="true"  
  7.      android:screenOrientation="portrait" />   
  8.   
  9. <!--易信分享回调 -->  
  10.  <activity  
  11.     android:name=".yxapi.YXEntryActivity"  
  12.     android:theme="@android:style/Theme.Translucent.NoTitleBar"  
  13.     android:configChanges="keyboardHidden|orientation|screenSize"  
  14.     android:exported="true"  
  15.     android:screenOrientation="portrait" />  
  16.   
  17.  <!-- 支付宝分享回调 -->  
  18. <activity  
  19.     android:name=".apshare.ShareEntryActivity"  
  20.     android:theme="@android:style/Theme.Translucent.NoTitleBar"  
  21.     android:configChanges="keyboardHidden|orientation|screenSize"  
  22.     android:exported="true"/>  

微信签名生成工具 :(微信官方平台可下载)点击此处下载




后续待补。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值