One of the major issues that gets overlooked is that of tracking a login. Does the user need to be logged in every time the app is opened, logged out every time the app is closed, or only when the user chooses to log out? This is part of the process of creating an application, and was outlined in the challenge document as Login page should only show when a user has not yet logged in.
Unfortunately, there is an error in your application that forces the user to log in every time the application is terminated and reopened. This is due in part to the user of a second preference called loginStatus, the issue here is that you already have a preference called token that signifies when a user has logged in. If a user is successfully logged in they obtain a token, and this token can not only be used to obtain the data, but also as a representation for a loginStatus. Using the token instead of a loginStatus to track a users validity is common place in development as it cuts down on duplicated code and the number of preferences or attributes.
One of the major issues that gets overlooked is that of tracking a login. Does the user need to be logged in every time the app is opened, logged out every time the app is closed, or only when the user chooses to log out? This is part of the process of creating an application, and was outlined in the challenge document as
Login page should only show when a user has not yet logged in
.Unfortunately, there is an error in your application that forces the user to log in every time the application is terminated and reopened. This is due in part to the user of a second preference called
loginStatus
, the issue here is that you already have a preference calledtoken
that signifies when a user has logged in. If a user is successfully logged in they obtain a token, and this token can not only be used to obtain the data, but also as a representation for aloginStatus
. Using thetoken
instead of aloginStatus
to track a users validity is common place in development as it cuts down on duplicated code and the number of preferences or attributes.https://github.com/heecheon92/Android-Project/blob/a05d23c117f810ca2ff297a08d27d7d918636451/FargoEventProject/app/src/main/java/activity/LoginActivity.java#L77 https://github.com/heecheon92/Android-Project/blob/a05d23c117f810ca2ff297a08d27d7d918636451/FargoEventProject/app/src/main/java/activity/MainActivity.java#L73 https://github.com/heecheon92/Android-Project/blob/a05d23c117f810ca2ff297a08d27d7d918636451/FargoEventProject/app/src/main/java/activity/MainActivity.java#L181-L197 (This method is also public because of the XML onClick attribute when it should be private)