use of cn.nicolite.palm300heroes.model.bean.User in project Palm300Heroes by nicolite.
the class BmobModel method userLoginByUsername.
/**
*通过用户名登录
* @param username 用户名
* @param password 密码
*/
public static void userLoginByUsername(String username, String password, SaveListener<User> saveListener) {
User user = new User();
user.setUsername(username);
user.setPassword(password);
user.login(saveListener);
}
use of cn.nicolite.palm300heroes.model.bean.User in project Palm300Heroes by nicolite.
the class MApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
AppContext = getApplicationContext();
application = this;
if (!LeakCanary.isInAnalyzerProcess(this)) {
LeakCanary.install(this);
}
Bmob.initialize(this, Constants.BMOB_APPKEY);
try {
StatConfig.init(this);
User currentUser = BmobUser.getCurrentUser(User.class);
if (currentUser != null) {
StatConfig.setCustomUserId(this, currentUser.getUsername());
}
StatService.startStatService(this, Constants.MAT_APPKEY, StatConstants.VERSION);
// 开启Java Crash异常捕获
StatCrashReporter.getStatCrashReporter(this).setJavaCrashHandlerStatus(true);
// 开启Native异常捕获
// StatCrashReporter.getStatCrashReporter(getApplicationContext()).setJniNativeCrashStatus(true);
} catch (MtaSDkException e) {
e.printStackTrace();
}
// 只在MainActivity上显示升级对话框
Beta.canShowUpgradeActs.add(MainActivity.class);
// 初始化腾讯Bugly
Bugly.init(this, Constants.BUGLY_APPID, BuildConfig.LOG_DEBUG);
Bugly.setIsDevelopmentDevice(this, BuildConfig.LOG_DEBUG);
}
use of cn.nicolite.palm300heroes.model.bean.User in project Palm300Heroes by nicolite.
the class BmobModel method userRegister.
/**
* 用户注册
* @param username 用户名
* @param password 密码
* @param email 邮箱
*/
public static void userRegister(String username, String password, String email, SaveListener<User> saveListener) {
BmobUser bmobUser = new User();
if (DataUtils.compileExChar(username)) {
ToastUtils.showToastShort("不允许输入特殊字符");
return;
}
bmobUser.setUsername(username);
bmobUser.setPassword(password);
bmobUser.setEmail(email);
bmobUser.signUp(saveListener);
}
Aggregations