// Path: sample-android/src/main/java/com/example/sample_android/state/TodoItem.java
// @AutoValue
// public abstract class TodoItem {
//     
//     public static TodoItem create(int id, String text, boolean done) {
//         return new AutoValue_TodoItem(id, text, done);
//     }
//     
//     public abstract int id();
// 
//     public abstract String text();
//    
//     public abstract boolean done();
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import com.example.sample_android.state.TodoItem;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
package com.example.sample_android;




public class Datastore {

    // poor-man's persistence
    private SharedPreferences prefs;

    public Datastore(Context context) {
        prefs = context.getSharedPreferences("datastore", Context.MODE_PRIVATE);
    }

    public void store(List<TodoItem> items) {
        StringBuilder data = new StringBuilder();
        for (Iterator<TodoItem> iterator = items.iterator(); iterator.hasNext(); ) {
// Path: sample-android/src/main/java/com/example/sample_android/state/TodoItem.java
// @AutoValue
// public abstract class TodoItem {
//     
//     public static TodoItem create(int id, String text, boolean done) {
//         return new AutoValue_TodoItem(id, text, done);
//     }
//     
//     public abstract int id();
// 
//     public abstract String text();
//    
//     public abstract boolean done();
// }


// Path: sample-android/src/main/java/com/example/sample_android/Datastore.java
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import com.example.sample_android.state.TodoItem;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

package com.example.sample_android;




public class Datastore {

    // poor-man's persistence
    private SharedPreferences prefs;

    public Datastore(Context context) {
        prefs = context.getSharedPreferences("datastore", Context.MODE_PRIVATE);
    }

    public void store(List<TodoItem> items) {
        StringBuilder data = new StringBuilder();
        for (Iterator<TodoItem> iterator = items.iterator(); iterator.hasNext(); ) {
            TodoItem item = iterator.next();