Visit our official website and download the latest version of ShareSDK. After extracting the downloaded file, you will find the following directory structure：
Open the ShareSDK for Android directory, you will find MainLibs and OnekeyShare. ShareSDK is stored in the MainLibs directory, and OnekeyShare is a GUI tool for developers to quickly complete the share feature by ShareSDK.
There are two ways to import ShareSDK into your project: reference to the ShareSDK project or copy the jars and resources into your project. If you select the second way, we provide the following tool to help you quickly finish these operations:
Execute this tool and copy its products into your project.
ShareSDK encourage you integrate ShareSDK by referencing its project, because this will be much simpler. Here are the steps:
(1) Copy the extracted SDK into your workspace of Eclipse
(2) Import the SDK projects:
Select MainLibs and OnekeyShare
(3) Change dependency of your project to OnekeyShare (if you need this GUI tool) or MainLibs
There are three ways to add your applications information into ShareSDK: register on the application console of ShareSDK, configurate the “assets/ShareSDK.xml” file, or modify by ShareSDK.setPlatformDevInfo(String, HashMap) method at runtime.
Here is the example of “assets/ShareSDK.xml” way:
All applications information is registered in the “assets/ShareSDK.xml” of ShareSDK Sample project.
Add the following permissions into your AndroidMenifest.xml:
You should add the intent-filter in your launchActivity if you want to use the KakaoTalk to share msg. <!-- If you share msg in KakaoTalk, your share-params of executeUrl should set the value "kakaoTalkTest://starActivity" So it do, when the user to click the share-msg, then startActivity of your app's launch-activity. When you use the lib of onekeyshare, you can use the method of setExecuteUrl("kakaoTalkTest://starActivity") to set executeUrl. --> ```
And the single Activity for GUIs of ShareSDK:
If you integrate Wechat, add this callback activity:
And if you integrate Yixin, add this callback activity:
Add the following line in the onCreate method of the entrance activity:
And add the following line int the onDestroy method of the last activity:
For more information about how to integrate ShareSDK or how use ShareSDK to get your friends list, following someone, share statuses, etc. please visit our official wiki.