初始化放到application中,执行一次就可以
public class YPBaseApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
ShareSDK.initSDK(this);
}
}
使用shareSDK实现
http://sharesdk.mob.com/#/sharesdk
集成文档
http://wiki.mob.com/Android_%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E6%8C%87%E5%8D%97/
注意:进入ShareSDK解压目录,打开“Share SDK for Android”目录,可以找到“QuickIntegrater.jar”,这个就是快速集成ShareSDK的工具
Windows下
首先确定您已经安装了JDK,并且正确配置了JAVA_HOME和PATH系统变量,此时您可以双击QuickIntegrater启动程序
最后在Res–ShareSDK.xml中,把各个平台的 AppId、 AppKey替换成自己注册的
AppKey = "androidv1101"/>
Id="1"
SortId="1"
AppKey="568898243"
AppSecret="38a4f8204cc784f81f9f0daaf31e02e3"
RedirectUrl="http://www.sharesdk.cn"
ShareByAppClient="true"
Enable="true" />
Id="2"
SortId="2"
AppKey="801307650"
AppSecret="ae36f4ee3946e1cbb98d6965b0b2ff5c"
RedirectUri="http://sharesdk.cn"
Enable="true" />
Id="3"
SortId="3"
AppId="100371282"
AppKey="aed9b0303e3ed1e27bae87c33761161d"
Enable="true" />
Id="4"
SortId="4"
AppId="wx4868b35061f87885"
AppSecret="64020361b8ec4c99936c0e3999a9f249"
BypassApproval="false"
Enable="true" />
Id="5"
SortId="5"
AppId="wx4868b35061f87885"
AppSecret="64020361b8ec4c99936c0e3999a9f249"
BypassApproval="false"
Enable="true" />
Id="6"
SortId="6"
AppId="wx4868b35061f87885"
AppSecret="64020361b8ec4c99936c0e3999a9f249"
Enable="true" />
Id="7"
SortId="7"
AppId="100371282"
AppKey="aed9b0303e3ed1e27bae87c33761161d"
ShareByAppClient="true"
Enable="true" />
Id="8"
SortId="8"
ConsumerKey="107704292745179"
ConsumerSecret="38053202e1a5fe26c80c753071f0b573"
RedirectUrl="http://mob.com"
Enable="true" />
Id="9"
SortId="9"
ConsumerKey="LRBM0H75rWrU9gNHvlEAA2aOy"
ConsumerSecret="gbeWsZvA9ELJSdoBzJ5oLKX0TU09UOwrzdGfo9Tg7DjyGuMe8G"
CallbackUrl="http://mob.com"
Enable="true" />
Id="10"
SortId="10"
AppId="226427"
ApiKey="fc5b8aed373c4c27a05b712acba0f8c3"
SecretKey="f29df781abdd4f49beca5a2194676ca4"
Enable="true" />
Id="11"
SortId="11"
AppKey="358443394194887cee81ff5890870c7c"
AppSecret="da32179d859c016169f66d90b6db2a23"
RedirectUri="http://www.sharesdk.cn"
Enable="true" />
Id="12"
SortId="12"
Enable="true" />
Id="13"
SortId="13"
Enable="true" />
Id="16"
SortId="16"
ApiKey="031a96a3aa8b28af094fc3eaffa17a0d"
Secret="2e675e730571b75d"
RedirectUri="http://mob.com"
Enable="true" />
Id="17"
SortId="17"
HostType="product"
ConsumerKey="dcde25dca105bcc36884ed4534dab940"
ConsumerSecret="d98217b4020e7f1874263795f44838fe"
RedirectUri="http://www.sharesdk.cn/"
Enable="true" />
Id="19"
SortId="19"
HostType="sandbox"
ConsumerKey="sharesdk-7807"
ConsumerSecret="d05bf86993836004"
ShareByAppClient="true"
Enable="true" />
Id="20"
SortId="20"
ApiKey="ejo5ibkye3vo"
SecretKey="cC7B2jpxITqPLZ5M"
RedirectUrl="http://sharesdk.cn"
Enable="true" />
Id="21"
SortId="21"
Enable="true" />
Id="22"
SortId="22"
ClientID="G0ZI20FM30SJAJTX2RIBGD05QV1NE2KVIM2SPXML2XUJNXEU"
ClientSecret="3XHQNSMMHIFBYOLWEPONNV4DOTCDBQH0AEMVGCBG0MZ32XNU"
RedirectUrl="http://www.sharesdk.cn"
Enable="true" />
Id="23"
SortId="23"
ClientId="1432928"
Enable="true" />
Id="24"
SortId="24"
ApiKey="33d833ee6b6fca49943363282dd313dd"
ApiSecret="3a2c5b42a8fbb8bb"
RedirectUri="http://www.sharesdk.cn"
Enable="true" />
Id="25"
SortId="25"
OAuthConsumerKey="2QUXqO9fcgGdtGG1FcvML6ZunIQzAEL8xY6hIaxdJnDti2DYwM"
SecretKey="3Rt0sPFj7u2g39mEVB3IBpOzKnM3JnTtxX2bao2JKk4VV1gtNo"
CallbackUrl="http://sharesdk.cn"
Enable="true" />
Id="26"
SortId="26"
AppKey="i5vw2mex1zcgjcj"
AppSecret="3i9xifsgb4omr0s"
RedirectUri="https://www.sharesdk.cn"
Enable="true" />
Id="27"
SortId="27"
ApplicationId="3921561"
Enable="true" />
Id="28"
SortId="28"
ClientId="ff68e3216b4f4f989121aa1c2962d058"
ClientSecret="1b2e82f110264869b3505c3fe34e31a1"
RedirectUri="http://sharesdk.cn"
Enable="true" />
Id="29"
SortId="29"
AppId="yx0d9a9f9088ea44d78680f3274da1765f"
BypassApproval="true"
Enable="true" />
Id="30"
SortId="30"
AppId="yx0d9a9f9088ea44d78680f3274da1765f"
BypassApproval="true"
Enable="true" />
Id="31"
SortId="31"
AppKey="EEEE9578D1D431D3215D8C21BF5357E3"
AppSecret="5EDE59F37B3EFA8F65EEFB9976A4E933"
RedirectUri="http://sharesdk.cn"
Enable="true" />
Id="32"
SortId="32"
Enable="true" />
Id="33"
SortId="33"
AppKey="48d3f524e4a636b08d81b3ceb50f1003"
Enable="true" />
Id="34"
SortId="34"
AppKey="48d3f524e4a636b08d81b3ceb50f1003"
Enable="true" />
Id="35"
SortId="35"
Enable="true" />
Id="36"
SortId="36"
Enable="true" />
Id="37"
SortId="37"
ConsumerKey="32741-389c565043c49947ba7edf05"
Enable="true" />
Id="38"
SortId="38"
ConsumerKey="4rDJORmcOcSAZL1YpqGHRI605xUvrLbOhkJ07yO0wWrYrc61FA"
ConsumerSecret="GNr1GespOQbrm8nvd7rlUsyRQsIo3boIbMguAl9gfpdL0aKZWe"
Enable="true" />
Id="39"
SortId="39"
AppId="107704292745179"
Enable="true" />
Id="52"
SortId="52"
AppId="2015072400185895"
Enable="true"/>