本文整理匯總了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);
}