All Projects → xyzlf → Sharesdk

xyzlf / Sharesdk

Licence: mit
分享SDK,包括微信、朋友圈,微博,QQ,QQ空间等渠道分享。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Sharesdk

Webdrop
💻 Share your Mac's current chrome tab via airdrop
Stars: ✭ 114 (-48.42%)
Mutual labels:  share
Rxtool
Android开发人员不得不收集的工具类集合 | 支付宝支付 | 微信支付(统一下单) | 微信分享 | Zip4j压缩(支持分卷压缩与加密) | 一键集成UCrop选择圆形头像 | 一键集成二维码和条形码的扫描与生成 | 常用Dialog | WebView的封装可播放视频 | 仿斗鱼滑动验证码 | Toast封装 | 震动 | GPS | Location定位 | 图片缩放 | Exif 图片添加地理位置信息(经纬度) | 蛛网等级 | 颜色选择器 | ArcGis | VTPK | 编译运行一下说不定会找到惊喜
Stars: ✭ 11,567 (+5133.94%)
Mutual labels:  share
Rtcode
Real time code sharing web application
Stars: ✭ 170 (-23.08%)
Mutual labels:  share
Fenix
A simple and visual static web server with collaboration features.
Stars: ✭ 1,559 (+605.43%)
Mutual labels:  share
Desktop
An Open-Source file sharing software for Linux, macOS and Windows allowing you to send and receive files over available connections, and pause and resume transfer process even when an error is given
Stars: ✭ 139 (-37.1%)
Mutual labels:  share
Share Bar
A pure JS plugin to generate a share bar for social media, used by Globo.com.
Stars: ✭ 158 (-28.51%)
Mutual labels:  share
M Share
h5页面分享组件、支持分享到微信、朋友圈、新浪微博、QQ空间、QQ好友。
Stars: ✭ 111 (-49.77%)
Mutual labels:  share
Wormhole Gui
Cross-platform graphical user interface for easy encrypted sharing of files, folders, and text between devices.
Stars: ✭ 196 (-11.31%)
Mutual labels:  share
Library
ufutx share book libraries : share and manage books platform for personal and organization
Stars: ✭ 144 (-34.84%)
Mutual labels:  share
Shareable Links
A curated list of shareable social media links
Stars: ✭ 168 (-23.98%)
Mutual labels:  share
Transfer.sh
Easy and fast file sharing from the command-line.
Stars: ✭ 12,140 (+5393.21%)
Mutual labels:  share
Vue Social Share
A Vue 2.x social share component
Stars: ✭ 136 (-38.46%)
Mutual labels:  share
Resources
知名互联网企业内推资料整理 持续更新ing 。 目前已经维护五个微信群接近3000人,欢迎你的加入!
Stars: ✭ 1,910 (+764.25%)
Mutual labels:  share
Ustc Course
❤️中国科学技术大学课程资源
Stars: ✭ 11,274 (+5001.36%)
Mutual labels:  share
Datash
Send and Receive files directly from your browser with end-to-end encryption
Stars: ✭ 178 (-19.46%)
Mutual labels:  share
Zhpopupcontroller
Help you pop up custom views easily. and support pop-up animation, layout position, mask effect and gesture interaction etc.
Stars: ✭ 1,481 (+570.14%)
Mutual labels:  share
Simplesharingbuttons
Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons.
Stars: ✭ 147 (-33.48%)
Mutual labels:  share
Share Api Polyfill
A polyfill for the sharing that can be used in desktop too, so your users can shere in their twitter, facebook, messenger, linkedin, sms, e-mail, print, telegram or whatsapp.
Stars: ✭ 210 (-4.98%)
Mutual labels:  share
Sharect
🔗 A lightweight JavaScript library to let users share their text selections to social networks.
Stars: ✭ 192 (-13.12%)
Mutual labels:  share
Code2sec.com
xmind\code\articles for my personal blog 个人博客上的资源备份存储,也是个人分享的汇总
Stars: ✭ 164 (-25.79%)
Mutual labels:  share

ShareSDK

分享SDK,包括微信、朋友圈,微博,QQ,QQ空间等渠道分享。

Gradle

compile ('com.xyzlf.share:sharesdk:0.0.11') {
	exclude group: 'com.android.support', module: 'appcompat-v7'
}

效果图

使用方式

1、调用分享界面:

public void showShareDialog() {
    ShareEntity testBean = new ShareEntity("我是标题", "我是内容,描述内容。");
    testBean.setUrl("https://www.baidu.com"); //分享链接
    testBean.setImgUrl("https://www.baidu.com/img/bd_logo1.png");
    ShareUtil.showShareDialog(getActivity(), testBean, ShareConstant.REQUEST_CODE);
}

2、使用分享功能,如下实例 使用QQ分享功能:

public void startShare() {
    ShareEntity testBean = new ShareEntity("我是标题", "我是内容,描述内容。");
    testBean.setUrl("https://www.baidu.com"); //分享链接
    testBean.setImgUrl("https://www.baidu.com/img/bd_logo1.png");
    ShareUtil.startShare(getActivity(), ShareConstant.SHARE_CHANNEL_QQ, testBean, ShareConstant.REQUEST_CODE);
}

3、处理回调:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    /**
     * 分享回调处理
     */
    if (requestCode == ShareConstant.REQUEST_CODE) {
        if (data != null) {
            int channel = data.getIntExtra(ShareConstant.EXTRA_SHARE_CHANNEL, -1);
            int status = data.getIntExtra(ShareConstant.EXTRA_SHARE_STATUS, -1);
            onShareCallback(channel, status);
        }
    }
}

详细使用说明,可以参照上面的使用说明文档。

遇到的坑

分享SDK踩过的坑,请参照:http://xyzlf.github.io/2016/07/01/android-share-sdk-1.html

配合使用说明文档,在配置调用方面应该不会有啥问题了。

更新日志

0.0.11

解决bug:Only fullscreen opaque activities can request orientation

0.0.9 Bugfixed

解决qq未登录状态下,多次点击,多次弹出“分享取消”bug。

0.0.8 去除微博SDK

使用0.0.8 aar,无需配置微博的key。 解决部分机型,微博service因隐士调用崩溃的问题。

0.0.7 支持分享大图,修复分享本地图片

ShareEntity testBean = new ShareEntity("我是标题", "我是内容,描述内容。");

1、去除了testBean.setBitmap(bitmap)方法,因为ShareEntity是通过Intent传递,如果bitmap稍大,就会出现异常。

2、增加了分享大图属性 testBean.setShareBigImg(true);

实例:

 /**
 * 分享大图,大图分享支持,微信,微信朋友圈,微博,QQ,其他渠道不支持
 *
 * 分享大图注意点
 * 1、setShareBigImg为ture
 * 2、QQ分享大图,只能是本地图片
 */
public void shareBigImg() {
    ShareEntity testBean = new ShareEntity("", "");
    testBean.setShareBigImg(true);
	// testBean.setImgUrl("https://www.baidu.com/img/bd_logo1.png"); // 网络地址
    testBean.setImgUrl("/storage/sdcard0/Android/data/com.xyzlf.share/files/com.xyzlf.share_share_pic.png"); //本地地址

    /** 如果你要分享的图片是Bitmap,你可以如下使用 **/
	// Bitmap bitmap = null;
	// String filePath = ShareUtil.saveBitmapToSDCard(this, bitmap);
	// testBean.setImgUrl(filePath);

    int channel = ShareConstant.SHARE_CHANNEL_WEIXIN_FRIEND | ShareConstant.SHARE_CHANNEL_WEIXIN_CIRCLE | ShareConstant.SHARE_CHANNEL_SINA_WEIBO | ShareConstant.SHARE_CHANNEL_QQ;
    ShareUtil.showShareDialog(this, channel, testBean, ShareConstant.REQUEST_CODE);
}

0.0.6 支持本地图片分享

ShareEntity testBean = new ShareEntity("我是标题", "我是内容,描述内容。");

1、本地drawable图片,使用方式:testBean.setDrawableId(R.drawable.icon);

2、本地手机SD卡图片,使用方式:testBean.setImgUrl("/sdpath/filepath/icon.png");

3、本地代码截屏Bitmap,使用方式:testBean.setBitmap(bitmap);

同类分享库收集

1、ThirdParty login and share lib:https://github.com/tianzhijiexian/ShareLoginLib

2、社会化登录分享工具库:https://github.com/shaohui10086/ShareUtil

3、Bilibili/BiliShare:https://github.com/Bilibili/BiliShare

4、maoruibin/ChinaShare:https://github.com/maoruibin/ChinaShare

5、JeasonWong/FlipShare:https://github.com/JeasonWong/FlipShare

6、kayan1990/ShareButton:https://github.com/kayan1990/ShareButton

7、arvinljw/SocialHelper:https://github.com/arvinljw/SocialHelper

关于我

有任何使用问题,可以给我发邮件:

Author:张利峰

E-mail:[email protected]

License

Copyright(c)2016 xyzlf Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].