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