package victoralbertos.io.android;

import android.app.Activity;
import android.os.Bundle;
import io.reactivecache.ReactiveCache;
import io.victoralbertos.jolyglot.GsonSpeaker;
import java.util.ArrayList;
import java.util.List;
import rx.Observable;

/**
 * Created by victor on 21/01/16.
 */
public class MainActivity extends Activity {

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //Create integration test for max mg limit and clearing expired data


       final ReactiveCache rxProviders = new ReactiveCache.Builder()
                .maxMBPersistence(50)
                .using(getApplicationContext().getFilesDir(), new GsonSpeaker());

        /* for (int i = 0; i < 1000; i++) {
            String key = System.currentTimeMillis() + i + "";
            rxProviders.getMocksEphemeralPaginate(createObservableMocks(100), new DynamicKey(key))
                    .subscribe();
        }*/

    }

    private Observable<List<Mock>> createObservableMocks(int size) {
        List<Mock> mocks = new ArrayList(size);
        for (int i = 0; i < size; i++) {
            mocks.add(new Mock("Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, " +
                    "making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, " +
                    "consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes " +
                    "from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the " +
                    "theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32."));
        }
        return Observable.just(mocks);
    }
}

@@ -62,2037 +62,95 @@
 ty;%0A
-import android.os.Bundle;%0Aimport io.reactivecache.ReactiveCache;%0Aimport io.victoralbertos.jolyglot.GsonSpeaker;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport rx.Observable;%0A%0A/**%0A * Created by victor on 21/01/16.%0A */%0Apublic class MainActivity extends Activity %7B%0A%0A    @Override protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A%0A        //Create integration test for max mg limit and clearing expired data%0A%0A%0A       final ReactiveCache rxProviders = new ReactiveCache.Builder()%0A                .maxMBPersistence(50)%0A                .using(getApplicationContext().getFilesDir(), new GsonSpeaker());%0A%0A        /* for (int i = 0; i %3C 1000; i++) %7B%0A            String key = System.currentTimeMillis() + i + %22%22;%0A            rxProviders.getMocksEphemeralPaginate(createObservableMocks(100), new DynamicKey(key))%0A                    .subscribe();%0A        %7D*/%0A%0A    %7D%0A%0A    private Observable%3CList%3CMock%3E%3E createObservableMocks(int size) %7B%0A        List%3CMock%3E mocks = new ArrayList(size);%0A        for (int i = 0; i %3C size; i++) %7B%0A            mocks.add(new Mock(%22Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, %22 +%0A                    %22making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, %22 +%0A                    %22consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes %22 +%0A                    %22from sections 1.10.32 and 1.10.33 of %5C%22de Finibus Bonorum et Malorum%5C%22 (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the %22 +%0A                    %22theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, %5C%22Lorem ipsum dolor sit amet..%5C%22, comes from a line in section 1.10.32.%22));%0A        %7D%0A        return Observable.just(mocks);%0A    %7D
+%0A/**%0A * Created by victor on 21/01/16.%0A */%0Apublic class MainActivity extends Activity %7B%0A
 %0A%7D%0A

Remove reference from Android project