Latest SharedPreferences Android Studio Tutorial – Remember Me Login, PHP, MySQL, MD5 – 2016




Latest SharedPreferences Android Studio tutorial: I will teach you how to do remember me login in Android using MySQL PHP. Source Code at https://goo.gl/EwOmqZ Android gives the abilities…

Original source


28 responses to “Latest SharedPreferences Android Studio Tutorial – Remember Me Login, PHP, MySQL, MD5 – 2016”

  1. Hi. I am having an issue connecting to database in android emulator. The localhost works fine when I give username and password on page localhost/customer/index.php it returns "success" but in emulator for the same username(mike123) and password (123) it returns "D/com.kosalgeek.android.loginsharedpreferences.MainActivity: Wrong username & password" any advise?

    Thanks in advance.

  2. Hi sir i really love your tutorial . i need some help .I want to login for multiple user such as normal user or admin
    (php code)
    if($result->num_rows > 0){ //has record. correct username and password
    $info=mysqli_fetch_array($result);
    if($info['user']==1){
    $response["success"]=1;
    }
    echo json_encode($response);
    else if($info['user']==0){
    $response["success"]=0;
    }
    echo json_encode($response);
    }

    else{
    echo "Wrong username and password";
    exit;
    }

    public void processFinish(String s) {
    Log.d(TAG, s);

    if(s.contains("0")){

    if(checkFlag) {
    editor.putString("username", etEmail.getText().toString());
    editor.putString("password", MD5.encrypt(etPassword.getText().toString()));
    editor.apply();

    Log.d(TAG, pref.getString("password", ""));
    }

    Intent in = new Intent(login.this, MainActivity.class);
    startActivity(in);
    }
    if(s.contain("1")){
    Intent in = new Intent(login.this, AdminActivity.class);
    startActivity(in);
    }

    i have query name user ! admin as 1 , normal user as 0.

    how can i verify the user type. please help me

Leave a Reply