com.mob.MobSDK Java Examples

The following examples show how to use com.mob.MobSDK. 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: ShareTypeManager.java    From ShareSDK-for-Android with MIT License 6 votes vote down vote up
@Override
public void onError(final Platform platform, int i, Throwable throwable) {
    throwable.printStackTrace();
    final String error = throwable.toString();
    context.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            try {
                //if (platform.getName().equals("Douyin")) {
                    //Toast.makeText(MobSDK.getContext(), "Share Failure" + error, Toast.LENGTH_LONG).show();
                //} else if (contextThis != null) {
                    //dialog(contextThis, "Share Failure" + error);
                //} else {
                    Toast.makeText(MobSDK.getContext(), "Share Failure" + error, Toast.LENGTH_LONG).show();
                //}
            } catch (Throwable t) {
                Log.e("QQQ", " ShareTypeManager  onError===> " + t);
            }
        }
    });
}
 
Example #2
Source File: EnjoyshopApplication.java    From enjoyshop with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    mInstance = this;
    // 通过代码注册你的AppKey和AppSecret
    MobSDK.init(this, "201f8a7a91c30", "c63ec5c1eeac1f873ec78c1365120431");

    sContext = getApplicationContext();
    initUser();
    Utils.init(this);

    locationService = new LocationService(getApplicationContext());
    mVibrator = (Vibrator) getApplicationContext().getSystemService(Service.VIBRATOR_SERVICE);

    setDatabase();

}
 
Example #3
Source File: TestActivity.java    From BBSSDK-for-Android with Apache License 2.0 6 votes vote down vote up
@Override
	protected void onCreate(@Nullable Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MobSDK.init(this);
		setContentView(ResHelper.getLayoutRes(this, "layout_test"));
		cleverImageView = (CleverImageView) findViewById(ResHelper.getIdRes(this, "cleverImageView"));
		btnTest = (Button) findViewById(ResHelper.getIdRes(this, "btnTest"));
		btnTest.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View view) {
//                cleverImageView.setOval(false);
				cleverImageView.setBorderColor(Color.BLUE);
				cleverImageView.setBorderWidthDP(2);
				cleverImageView.setCornerRadiiDP(10, 5, 20, 30);
				cleverImageView.setImageUrl(IMAGE_URL);
			}
		});
	}
 
Example #4
Source File: PlatformAuthorizeUserInfoManager.java    From ShareSDK-for-Android with MIT License 6 votes vote down vote up
@Override
public void onError(Platform platform, int i, Throwable throwable) {
	throwable.printStackTrace();
	activity.runOnUiThread(new Runnable() {
		@Override
		public void run() {
			try {
				//dialog(activity, "Authorize Failure");
				Toast.makeText(MobSDK.getContext(), "Authorize Failure", Toast.LENGTH_LONG).show();
			} catch (Exception e){
				e.printStackTrace();
				Toast.makeText(MobSDK.getContext(), "Authorize Failure", Toast.LENGTH_LONG).show();
			}
		}
	});
}
 
Example #5
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 #6
Source File: DingdingMessageShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	shareParams.setScence(1);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #7
Source File: DingdingShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setShareType(Platform.SHARE_TEXT);
	shareParams.setScence(0);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #8
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setShareType(Platform.SHARE_TEXT);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #9
Source File: DingdingShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPage(){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(LINK_URL);
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	shareParams.setScence(0);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #10
Source File: EvernoteShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo() {
	if (DemoUtils.isValidClient("com.evernote")) {
		Platform platform = ShareSDK.getPlatform(Evernote.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 #11
Source File: DropboxShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareFile(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Dropbox.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #12
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 #13
Source File: GooglePlusShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener) {
	Platform platform = ShareSDK.getPlatform(GooglePlus.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(mListener);
	platform.share(shareParams);
}
 
Example #14
Source File: PlurkShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform("Plurk");
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #15
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 #16
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebpager(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatMoments.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.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #17
Source File: WechatFavoriteShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatFavorite.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 #18
Source File: WhatsAppShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(){
	Platform platform = ShareSDK.getPlatform(WhatsApp.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #19
Source File: QQZoneShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(){
	Platform platform = ShareSDK.getPlatform(QZone.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #20
Source File: DingdingMessageShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setShareType(Platform.SHARE_MUSIC);
	shareParams.setScence(1);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #21
Source File: WechatShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(){
	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.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl("https://t3.ftcdn.net/jpg/02/01/25/00/240_F_201250053_xMFe9Hax6w01gOiinRLEPX0Wt1zGCzYz.jpg");
	String musicUrl = "http://music.baidu.com/song/546920050?pst=sug";
	shareParams.setMusicUrl(musicUrl);
	shareParams.setUrl(musicUrl);
	shareParams.setShareType(Platform.SHARE_MUSIC);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #22
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setShareType(Platform.SHARE_TEXT);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #23
Source File: GooglePlusShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage() {
	Platform platform = ShareSDK.getPlatform(GooglePlus.NAME);
	Platform.ShareParams shareParams = new Platform.ShareParams();
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setShareType(Platform.SHARE_IMAGE);
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #24
Source File: QQShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic() {
    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    Platform.ShareParams shareParams = new Platform.ShareParams();
    shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
    shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
    shareParams.setTitleUrl(ResourcesManager.getInstace(MobSDK.getContext()).getTitleUrl());
    shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
    shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
    shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
    shareParams.setShareType(Platform.SHARE_MUSIC);
    platform.setPlatformActionListener(platformActionListener);
    platform.share(shareParams);
}
 
Example #25
Source File: UserInfoFragment.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void onError(Platform platform, int i, Throwable throwable){
	String msg = ResourcesManager.actionToString(i);
	String text = plat.getName() + " caught error at " + msg;
	try {
		dialog(getActivity(), text);
	} catch (Exception e) {
		e.printStackTrace();
		Toast.makeText(MobSDK.getContext(), text, Toast.LENGTH_SHORT).show();
	}
}
 
Example #26
Source File: DingdingMessageShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setShareType(Platform.SHARE_MUSIC);
	shareParams.setScence(1);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #27
Source File: DingdingMessageShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	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_IMAGE);
	shareParams.setScence(1);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #28
Source File: WechatShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Wechat.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	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_IMAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #29
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(){
	Platform platform = ShareSDK.getPlatform(WechatMoments.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("https://t3.ftcdn.net/jpg/02/01/25/00/240_F_201250053_xMFe9Hax6w01gOiinRLEPX0Wt1zGCzYz.jpg");
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
	shareParams.setShareType(Platform.SHARE_MUSIC);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #30
Source File: NetEaseMicroBlog.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform("NetEaseMicroBlog");
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}