Search in sources :

Example 6 with User

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);
}
Also used : User(cn.nicolite.palm300heroes.model.bean.User) BmobUser(cn.bmob.v3.BmobUser)

Example 7 with User

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);
}
Also used : User(cn.nicolite.palm300heroes.model.bean.User) BmobUser(cn.bmob.v3.BmobUser) MtaSDkException(com.tencent.stat.MtaSDkException)

Example 8 with User

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);
}
Also used : User(cn.nicolite.palm300heroes.model.bean.User) BmobUser(cn.bmob.v3.BmobUser) BmobUser(cn.bmob.v3.BmobUser)

Aggregations

BmobUser (cn.bmob.v3.BmobUser)8 User (cn.nicolite.palm300heroes.model.bean.User)8 Intent (android.content.Intent)2 Bundle (android.os.Bundle)1 Nullable (android.support.annotation.Nullable)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 OnClick (butterknife.OnClick)1 BmobException (cn.bmob.v3.exception.BmobException)1 MtaSDkException (com.tencent.stat.MtaSDkException)1