Java Code Examples for cn.sharesdk.framework.Platform#ShareParams

The following examples show how to use cn.sharesdk.framework.Platform#ShareParams . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QQZoneShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPager(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(QZone.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example 2
Source File: EmailShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(Email.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 3
Source File: FacebookShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareApps(){
	Platform platform = ShareSDK.getPlatform(Facebook.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setShareType(Platform.SHARE_APPS);
	shareParams.setUrl("https://fb.me/1654865544566386");//Facebook开放平台创建后得到的短链接
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 4
Source File: YoutubeShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Youtube.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example 5
Source File: WeiboShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(SinaWeibo.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 6
Source File: TwitterShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(){
	Platform platform = ShareSDK.getPlatform(Twitter.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 7
Source File: TelegramShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(Telegram.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(LINK_TEXT);
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(LINK_URL);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 8
Source File: WechatFavoriteShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatFavorite.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
	shareParams.setShareType(Platform.SHARE_MUSIC);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example 9
Source File: FacebookShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPage(){
	Platform platform = ShareSDK.getPlatform(Facebook.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setUrl(LINK_URL);
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	shareParams.setQuote(LINK_TEXT);
	shareParams.setHashtag("测试话题分享");
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 10
Source File: InstapaperShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareTextUrl(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Instapaper.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example 11
Source File: KakaoStoryShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(KakaoStory.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(LINK_TEXT);
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setSite(ResourcesManager.getInstace(MobSDK.getContext()).getSite());
	shareParams.setUrl(LINK_URL);
	shareParams.setComment(ResourcesManager.getInstace(MobSDK.getContext()).getComment());
	shareParams.setComment(ResourcesManager.getInstace(MobSDK.getContext()).getComment());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 12
Source File: DropboxShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(){
	Platform platform = ShareSDK.getPlatform(Dropbox.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 13
Source File: FourSquareShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void addChecked() {
	Platform platform = ShareSDK.getPlatform(FourSquare.NAME);
	Platform.ShareParams shareParams = new Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setLatitude(ResourcesManager.latitude);
	shareParams.setLongitude(ResourcesManager.longitude);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 14
Source File: DialogShare.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
private Platform.ShareParams getWechatDefault(boolean pyc) {
    Platform.ShareParams sp = new Platform.ShareParams();
    sp.setTitle(title);
    sp.setText(desc);
    if (pyc) {//如果是朋友圈,则显示标题
        sp.setTitle(desc);
    }
    setImageData(sp, true);
    sp.setUrl(url);
    return sp;
}
 
Example 15
Source File: ShareCore.java    From -Android_ShareSDK_Example_Wechat with MIT License 5 votes vote down vote up
private Platform.ShareParams getShareParams(Platform plat,
		HashMap<String, Object> data) throws Throwable {
	String className = plat.getClass().getName() + "$ShareParams";
	Class<?> cls = Class.forName(className);
	if (cls == null) {
		return null;
	}

	Object sp = cls.newInstance();
	if (sp == null) {
		return null;
	}

	for (Entry<String, Object> ent : data.entrySet()) {
		Object value= ent.getValue();
		if (value == null) {
			continue;
		}

		if (value instanceof String) {
			String strValue = (String) value;
			if (TextUtils.isEmpty(strValue)) {
				continue;
			}
		}

		try {
			Field fld = cls.getField(ent.getKey());
			if (fld != null) {
				fld.setAccessible(true);
				fld.set(sp, value);
			}
		} catch(Throwable t) {}
	}

	return (Platform.ShareParams) sp;
}
 
Example 16
Source File: MeipaiShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Meipai.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageArray(ResourcesManager.getInstace(MobSDK.getContext()).randomPic());
	shareParams.setShareType(Platform.SHARE_IMAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example 17
Source File: AlipayMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPage() {
	Platform platform = ShareSDK.getPlatform(Alipay.NAME);
	Platform.ShareParams shareParams = new Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 18
Source File: WechatShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(){
	Platform platform = ShareSDK.getPlatform(Wechat.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setImageUrl("https://t3.ftcdn.net/jpg/02/01/25/00/240_F_201250053_xMFe9Hax6w01gOiinRLEPX0Wt1zGCzYz.jpg");
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 19
Source File: WechatShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareEmoji(){
	Platform platform = ShareSDK.getPlatform(Wechat.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setImageUrl("https://t3.ftcdn.net/jpg/02/01/25/00/240_F_201250053_xMFe9Hax6w01gOiinRLEPX0Wt1zGCzYz.jpg");
	shareParams.setShareType(Platform.SHARE_EMOJI);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example 20
Source File: QQShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareQQMiniProgram() {
    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    Platform.ShareParams shareParams = new Platform.ShareParams();
    shareParams.setText("QQ小程序");
    shareParams.setTitle("QQ互联");
    shareParams.setTitleUrl("http://www.qq.com/");
    shareParams.setImageUrl("http://www.3wyu.com/wp-content/uploads/6e0eaf15gy1fvr5tnm2dfj20f108gtad.jpg");
    shareParams.setShareType(Platform.QQ_MINI_PROGRAM);
    shareParams.setQQMiniProgramAppid("1108318575"); //官方的
    shareParams.setQQMiniProgramPath("page/share/index.html?share_name=QQ%E9%9F%B3%E4%B9%90&share_key=5aIqFGg&from=disk");
    shareParams.setQQMiniProgramType("");
    platform.setPlatformActionListener(platformActionListener);
    platform.share(shareParams);
}