当前位置: 首页>>代码示例>>Java>>正文


Java MobSDK.init方法代码示例

本文整理汇总了Java中com.mob.MobSDK.init方法的典型用法代码示例。如果您正苦于以下问题:Java MobSDK.init方法的具体用法?Java MobSDK.init怎么用?Java MobSDK.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mob.MobSDK的用法示例。


在下文中一共展示了MobSDK.init方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.mob.MobSDK; //导入方法依赖的package包/类
@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);

    //配置数据库
    setupDatabase();

}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:19,代码来源:CNiaoApplication.java

示例2: onCreate

import com.mob.MobSDK; //导入方法依赖的package包/类
@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);
			}
		});
	}
 
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:19,代码来源:TestActivity.java

示例3: show

import com.mob.MobSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	if (!(context instanceof MobApplication)) {
		MobSDK.init(context.getApplicationContext());
	}

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:33,代码来源:OnekeyShare.java

示例4: onCreateView

import com.mob.MobSDK; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.fragment_verifyphone, container, false);
    editDisCode = view.findViewById(R.id.findpwd_discode);
    editPhone = view.findViewById(R.id.findpwd_phonenum);
    editVerCode = view.findViewById(R.id.findpwd_vercode);
    getVerCode = view.findViewById(R.id.findpwd_get_vercode);
    nextStep = view.findViewById(R.id.findpwd_next);

    getVerCode.setOnClickListener(this);
    nextStep.setOnClickListener(this);

    editDisCode.clearFocus();
    editPhone.requestFocus();

    //初始化短信SDK
    MobSDK.init(getContext(), "228198a34c17d", "73b44581dcf3914180feb22fcdf3dbb9");

    // 创建EventHandler对象
    eventHandler = new EventHandler() {
        public void afterEvent(int event, int result, Object data) {
            Message msg = new Message();
            msg.arg1 = event;
            msg.arg2 = result;
            msg.obj = data;
            mHandler.handleMessage(msg);
        }
    };

    // 注册短信监听器
    SMSSDK.registerEventHandler(eventHandler);

    fragmentResetPassword = new FragmentResetPassword();

    return view;
}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:38,代码来源:FragmentVerifyPhone.java

示例5: onCreate

import com.mob.MobSDK; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_reset_phone);

    //初始化短信SDK
    MobSDK.init(this, "228198a34c17d", "73b44581dcf3914180feb22fcdf3dbb9");

    userIntent = (UserIntent) getIntent().getSerializableExtra("user");

    initView();

    initSMSSDK();
}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:15,代码来源:ResetPhoneActivity.java

示例6: show

import com.mob.MobSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	MobSDK.init(context.getApplicationContext());
	ShareSDK.initSDK(context);

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:32,代码来源:OnekeyShare.java

示例7: initAndStartMainActivity

import com.mob.MobSDK; //导入方法依赖的package包/类
private boolean initAndStartMainActivity(String key, String secret) {
	if (StringUtils.isEmpty(key) || !key.matches(REGREX_KEY)) {
		ToastUtils.showToast(InitActivity.this, getStringByResName("bbs_init_illegalkey"));
		return false;
	}

	if (StringUtils.isEmpty(secret) || !secret.matches(REGREX_SECRET)) {
		ToastUtils.showToast(InitActivity.this, getStringByResName("bbs_init_illegalsecret"));
		return false;
	}

	MobSDK.init(InitActivity.this, key, secret);
	if (initTheme != null) {
		if (initTheme == 0) {
			BBSTheme0.init();
		} else {
			BBSTheme1.init();
		}
	}
	//init success or fail?
	finish();
	Intent intent = new Intent(InitActivity.this, MainActivity.class);
	startActivity(intent);

	//open web link page if valid
	if (!StringUtils.isEmpty(strFid) && ! StringUtils.isEmpty(strTid)) {
		final PageForumThreadDetail details = BBSViewBuilder.getInstance().buildPageForumThreadDetail();
		details.setForumThread(Long.parseLong(strFid), Long.parseLong(strTid), "");
		UIHandler.sendMessageDelayed(null, 300, new Handler.Callback() {
			@Override
			public boolean handleMessage(Message msg) {
				details.show(InitActivity.this);
				return false;
			}
		});
	}
	return true;
}
 
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:39,代码来源:InitActivity.java

示例8: show

import com.mob.MobSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") public void show(Context context) {
  HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
  shareParamsMap.putAll(params);

  MobSDK.init(context.getApplicationContext());
  ShareSDK.initSDK(context);

  // 打开分享菜单的统计
  ShareSDK.logDemoEvent(1, null);

  int iTheme = 0;
  try {
    iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
  } catch (Throwable t) {
  }
  OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
  OnekeyShareThemeImpl themeImpl = theme.getImpl();

  themeImpl.setShareParamsMap(shareParamsMap);
  themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
  themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
  themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
  themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
  themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
  themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
  if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
    themeImpl.disableSSO();
  }

  themeImpl.show(context.getApplicationContext());
}
 
开发者ID:zfdang,项目名称:zSMTH-Android,代码行数:32,代码来源:OnekeyShare.java


注:本文中的com.mob.MobSDK.init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。