Android recording software opens for the first time every day

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.