Android Data storage

Source: Internet
Author: User

In recent days, data has been stored locally, discussed with small partners and decided to use the currently popular Xutils data storage framework, but the main purpose of using it is because, normally I use Gson to parse JSON data, Gson is in the form of objects, Just Xutils is also stored in the form of objects using both to improve code reuse and traversal development, but be aware that your object must have an id attribute, even if it is not available.

Specific xutils how to use their own good to see the API, because they can understand better.

The Stored object
Public Linkmandata (string username, string workid) {
This.Username = Username;
This.WorkID = WorkID;
}

Public long getId () {
ReturnId
}

public void SetId (Long id) {
This.id = ID;
}

Public String GetName () {
return username;
}

Public void SetName (String username) {
This . username = Username;
}

Public String Getworkid () {
return WorkID;
}

Public void Setworkid (String workid) {
This . workid = WorkID;
}
}

Android Data storage

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.