I'm new in android studio and just learnt basic java. I want to build an user authentication system in android studio using only file,not database but don't know how to do that. Please help me to do that.
Make your layout and all the required views. Provide validations to the required views to check if the entered values are correct or not.
For login check this linkhttps://www.tutorialspoint.com/android/android_login_screen.htm
Providing Hypothetical Design.
Login class
public class Login {
private String mUsername;
private String mPassword;
Login(String username,String password){
mUsername = username;
mPassword = password;
}
public String getmPassword() {
return mPassword;
}
public String getmUsername() {
return mUsername;
}
public void setmPassword(String mPassword) {
this.mPassword = mPassword;
}
public void setmUsername(String mUsername) {
this.mUsername = mUsername;
}
}
Create UI for username and password in xml. Create Login object.You can learn from officialhttps://www.udacity.com/course/android-basics-user-input--ud836 course
To cache in file. Use File
api and read write in file while validating login.
Note: But this is very very basic thing and this is not recommendable for authantication module as this is not secure thing.
You must use database and ContenProvider for login module.
Thanks
Happy Coding.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.