本文整理汇总了Java中cn.bmob.v3.Bmob类的典型用法代码示例。如果您正苦于以下问题:Java Bmob类的具体用法?Java Bmob怎么用?Java Bmob使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Bmob类属于cn.bmob.v3包,在下文中一共展示了Bmob类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null){
Log.e("fragment","恢复fragment"+KEY_FRAGMENT_TAG);
restoreFragments();//恢复fragment
mFragmentCurrentTag = savedInstanceState.getString(KEY_FRAGMENT_TAG);
}
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
Bmob.initialize(getApplication(), "8641a3984f7c4a4e3d19558a69423ecf");
user = BmobUser.getCurrentUser(this, User.class);
mDrawer = (FlowingDrawer) findViewById(R.id.drawerlayout);
mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL);
mLayouts = new LinearLayout[]{
layoutHome, layoutCategorize, layoutMore
};
setupToolbar();
setupFeed();
setupMenu();
setListener();
update();
}
示例2: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// if (LeakCanary.isInAnalyzerProcess(this)) {
// // This process is dedicated to LeakCanary for heap analysis.
// // You should not init your app in this process.
// return;
// }
// LeakCanary.install(this);
setINSTANCE(this);
Bmob.initialize(this, Constant.KEY);
AppStat.i(Constant.KEY, null);
LogUtil.e("1服务器端初始化完成");
CustomInstallation.getCurrentInstallation(this).save();
LogUtil.e("设备ID在这里上传了");
BmobPush.startWork(this);
LogUtil.e("推送服务初始化完成");
initOkHttp();
initSmallVideo();
initLocationClient();
// CrashHandler.getInstance().init(this);
}
示例3: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_sign);
mUserSign = (FrameLayout) findViewById(R.id.user_sign);
mSign = View.inflate(this, R.layout.activity_sign,null);
phoneSign = View.inflate(this, R.layout.sign_by_phone,null);
emailSign = View.inflate(this, R.layout.sign_by_email,null);
BmobSMS.initialize(this,"c3afc6b5c969611f04beb79125e3ec2f");
Bmob.initialize(this, "c3afc6b5c969611f04beb79125e3ec2f");
initView();
}
示例4: onInit
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onInit() {
super.onInit();
mProgressDialog = ProgressDialog.show(this, "请稍等", "获取数据中", true);
Bmob.initialize(this, "3d9d9f910c51b02eea3d605178911aa5");
if (BmobUser.getCurrentUser(User.class) == null) {
startActivity(new Intent(MainActivity.this, LoginActivity.class));
}
tabHost = (FragmentTabHost) findViewById(R.id.tabHost);
View view = navigationView.inflateHeaderView(R.layout.header_layout);
username = (TextView) view.findViewById(R.id.usernameId);
headImage = (ImageView) view.findViewById(R.id.headId);
imgUserInfoBg = (ImageView) view.findViewById(R.id.imgBackground);
presenter.requestUserInfo();
initView();
//初始化TabHost
initTabHost();
//初始化pager
initPager();
//添加监听关联TabHost和viewPager
bindTabAndPager();
}
示例5: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
//初始化 Bugly
CrashReport.initCrashReport(getApplicationContext(), StaticClass.BUGLY_APP_ID, true);
//初始化 Bmob
Bmob.initialize(this, StaticClass.BMOB_APP_ID);
//初始化语音识别
SpeechUtility.createUtility(getApplicationContext(), SpeechConstant.APPID + "=" +
StaticClass.VOICE_KEY);
//初始化百度地图
SDKInitializer.initialize(getApplicationContext());
//初始化litepal
LitePalApplication.initialize(getApplicationContext());
}
示例6: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CrashReport.initCrashReport(getApplicationContext(), "e1a62089c6", false);
ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
.setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
.build();
Fresco.initialize(this, config);
SDKInitializer.initialize(this);
Bmob.initialize(this, "b0cb494256d9b86fc931ca930a055b75");
Logger.addLogAdapter(new AndroidLogAdapter(){
@Override
public boolean isLoggable(int priority, String tag) {
return true;// TODO: 2017/6/5
}
});
sInstance = this;
initUser();
}
示例7: testSaveAuth
import cn.bmob.v3.Bmob; //导入依赖的package包/类
public void testSaveAuth(){
Bmob.initialize(PineApplication.mContext, "56d23db34c49ab0334c427c034956b15");
UserAuth auth = new UserAuth();
auth.setIdentify_unique_id("kevin2");
auth.setIdentity_type(0);
auth.setCredential("123456");
auth.setVerified(true);
auth.save(PineApplication.mContext, new SaveListener() {
@Override
public void onSuccess() {
Log.e(TAG, "save auth onSuccess ");
}
@Override
public void onFailure(int i, String s) {
Log.e(TAG, "save auth onFailure " + s);
}
});
}
示例8: Bmobnitialize
import cn.bmob.v3.Bmob; //导入依赖的package包/类
public static void Bmobnitialize(Context context, long connectTimeout, int blockSize, long expiration, boolean configBoolean) {
//第一:默认初始化
Bmob.initialize(context, BmobConf.BMOB_APP_ID);
if (configBoolean){
//第二:自v3.4.7版本开始,设置BmobConfig,允许设置请求超时时间、文件分片上传时每片的大小、文件的过期时间(单位为秒),
BmobConfig config =new BmobConfig.Builder(context)
//设置appkey
.setApplicationId(BmobConf.BMOB_APP_ID)
//请求超时时间(单位为秒):默认15s
.setConnectTimeout(connectTimeout)
//文件分片上传时每片的大小(单位字节),默认512*1024
.setUploadBlockSize(blockSize)
//文件的过期时间(单位为秒):默认1800s
.setFileExpiration(expiration)
.build();
Bmob.initialize(config);
}
}
示例9: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_guide);
mViewPager = (ViewPager) findViewById(R.id.vp_guide);
Bmob.initialize(this, Utils.BMOB_APP_KEY);
initButton();
initImages();
initDotView();
mAccount = new AccountManager();
mAccount.setUserListener(this);
AccountManager.getCurrentUser(GuideActivity.this);
mGuideAdapter = new GuideAdapter(mImage_list);
mViewPager.setAdapter(mGuideAdapter);
mViewPager.setOnPageChangeListener(this);
}
示例10: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// 初始化BmobSDK
Bmob.initialize(getApplicationContext(), APP_ID);
initConfig(getApplicationContext());
mAppContext = getApplicationContext();
// 初始化 retrofit
RetrofitSingleton.init(getApplicationContext());
CrashHandler.init(new CrashHandler(getApplicationContext()));
/**
* 如果存在SD卡则将缓存写入SD卡,否则写入手机内存
*/
if (getApplicationContext().getExternalCacheDir() != null && ExistSDCard()) {
cacheDir = getApplicationContext().getExternalCacheDir().toString();
} else {
cacheDir = getApplicationContext().getCacheDir().toString();
}
}
示例11: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bmob.initialize(this, "2b77bf16ea2de19f99511df6e59fcad8");
setContentView(R.layout.activity_main);
initSystembar();
// listView = (ListView)findViewById(R.id.listview);
//
// listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// LiveBean liveBean = (LiveBean)listView.getItemAtPosition(position);
// if(liveBean != null)
// {
// System.out.println(liveBean.getTvUrl());
// LiveActivity.activityStart(MainActivity.this, liveBean.getTvUrl());
// }
// }
// });
//
// setadapter();
// queryData();
}
示例12: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 初始化 Bmob SDK
// 使用时请将第二个参数Application ID替换成你在Bmob服务器端创建的Application ID
Bmob.initialize(this, Constants.BmobAPPID);
requestWindowFeature(Window.FEATURE_NO_TITLE);
//获取当前屏幕宽高
DisplayMetrics metric = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metric);
mScreenWidth = metric.widthPixels;
mScreenHeight = metric.heightPixels;
// 初始化数据
mContext = this;
mBmobInstallation = BmobInstallation.getCurrentInstallation(this);
mInstallationId = BmobInstallation.getInstallationId(this);
mCurrentUser = BmobUser.getCurrentUser(this, User.class);
setContentView();
initViews();
initListeners();
initData();
}
示例13: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar bar = getActionBar();
bar.hide();
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Bmob.initialize(LoadingActivity.this, "7dba48d154a17b9b57e53c413bc889de");
SharedPreferences preferences = this.getSharedPreferences("notFirst",MODE_PRIVATE);
notFirst = preferences.getBoolean("notFirst", false);
if(notFirst){
getDataAndStartMain();
}else{
Intent intent =new Intent(LoadingActivity.this,FirstStart.class);
startActivity(intent);
System.out.println("Loading是第一次执行了");
finish();
}
}
示例14: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSettings = getSharedPreferences("prefsname", Context.MODE_PRIVATE); //模式为私有
autoLogin();//自动登录
setContentView(R.layout.activity_main);
//初始化Bmob SDK数据库服务
Bmob.initialize(getApplicationContext(), APPID);
//初始化bugly服务
CrashReport.initCrashReport(this, "900010093", false);
//初始化SMSS短信服务
SMSSDK.initSDK(this, APPKEY, APPSECRET);
//用户数据模型
initView();
}
示例15: onCreate
import cn.bmob.v3.Bmob; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bmob.initialize(this, "3a39e05d106b31b3f61a8ce842933a8a");
viewPager = (ViewPager) findViewById(R.id.detail_viewPager);
WishDetailsPagerAdapter adapter = new WishDetailsPagerAdapter(getViewList());
viewPager.setAdapter(adapter);
choosePager();
setViewPagerOnPageChangeListener(viewPager);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_my_wishes_details);
toolbar.setNavigationOnClickListener(v -> onBackPressed());
toolbar.inflateMenu(R.menu.menu_wishes_details);
toolbar.setOnMenuItemClickListener(this);
}