There is a need for users to open the software for the first time every day, refresh the login authentication information, request client user credentials to the server
To determine the lightweight storage sharepreferences that users use for the first time they open the app
Software initial installation to determine whether there is storage authentication information
First of all, open the software's start interface to detect whether the user is logged in, that is, sharepreferences inside the presence of authentication information, and is not empty
Do not empty description user login, storage under every time the software open the system time 2016-03-18 22-09-09
The first time this morning to open the software 2016-03-19 08-09-09 Only the date of month and year, the remaining 24-hour system can be no matter, that is today's first time to open the software, to refresh the authentication information
Of course there is a situation at this time the user is not networked or server exception, refresh authentication information failed, the system time will not be stored, denying this is the first time today open.
Terrible is still a demand, for each need authentication information token request, will go to visit sharepreferences Read token, so the teacher told me directly to token written static variables, need to call directly inside the request, But note that every time the software is opened to read the configuration file set this static token