diff --git a/app/.gitignore b/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/app/build.gradle b/app/build.gradle
deleted file mode 100644
index 6900d5e..0000000
--- a/app/build.gradle
+++ /dev/null
@@ -1,32 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 21
- buildToolsVersion "21.1.2"
-
- defaultConfig {
- applicationId "com.orhanobut.hawksample"
- minSdkVersion 10
- targetSdkVersion 21
- versionCode 1
- versionName "1.0"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-
- lintOptions {
- abortOnError false
- }
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:21.0.3'
-
- compile project(":hawk")
- compile 'net.danlew:android.joda:2.8.1'
-}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
deleted file mode 100644
index 90281a6..0000000
--- a/app/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/oobut/dev/sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/app/src/androidTest/java/com/orhanobut/hawksample/ApplicationTest.java b/app/src/androidTest/java/com/orhanobut/hawksample/ApplicationTest.java
deleted file mode 100644
index c7a1f41..0000000
--- a/app/src/androidTest/java/com/orhanobut/hawksample/ApplicationTest.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.orhanobut.hawksample;
-
-import android.app.Application;
-import android.test.ApplicationTestCase;
-
-/**
- * Testing Fundamentals
- */
-public class ApplicationTest extends ApplicationTestCase {
- public ApplicationTest() {
- super(Application.class);
- }
-}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
deleted file mode 100644
index ffaf73c..0000000
--- a/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/java/com/orhanobut/hawksample/Foo.java b/app/src/main/java/com/orhanobut/hawksample/Foo.java
deleted file mode 100644
index 1be61f5..0000000
--- a/app/src/main/java/com/orhanobut/hawksample/Foo.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.orhanobut.hawksample;
-
-/**
- * @author Orhan Obut
- */
-public class Foo {
- int a = 1;
- int b = 3;
- String c = "asdfasdf";
-
- void test() {
-
- }
-
- @Override
- public String toString() {
- return "Foo{" +
- "a=" + a +
- ", b=" + b +
- ", c='" + c + '\'' +
- '}';
- }
-}
diff --git a/app/src/main/java/com/orhanobut/hawksample/MainActivity.java b/app/src/main/java/com/orhanobut/hawksample/MainActivity.java
deleted file mode 100644
index 065921a..0000000
--- a/app/src/main/java/com/orhanobut/hawksample/MainActivity.java
+++ /dev/null
@@ -1,516 +0,0 @@
-package com.orhanobut.hawksample;
-
-import android.app.Activity;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.util.Log;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.orhanobut.hawk.Hawk;
-import com.orhanobut.hawk.HawkBuilder;
-import com.orhanobut.hawk.LogLevel;
-
-import org.joda.time.DateTime;
-
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import rx.Subscriber;
-import rx.android.schedulers.AndroidSchedulers;
-import rx.schedulers.Schedulers;
-
-
-public class MainActivity extends Activity {
-
- private static final String TAG = MainActivity.class.getSimpleName();
-
- private SharedPreferences.Editor editor;
- private SharedPreferences prefs;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
-
- // long start = System.nanoTime();
- // Hawk.initWithoutEncryption(this, LogLevel.FULL);
- // long end = System.nanoTime();
- //
- // double resultHawk = getTime(start, end);
- // log("Hawk init with password : " + resultHawk);
- //
- // start = System.nanoTime();
- // prefs = getSharedPreferences("BENCHARMK", MODE_PRIVATE);
- // editor = prefs.edit();
- // end = System.nanoTime();
- // double resultPref = getTime(start, end);
- // log("init: Prefs: " + resultPref + " Hawk : " + resultHawk);
- //
- //
- // benchmarkPrimitivePut();
- // benchmarkStringPut();
- // benchmarkListObjectPut();
- // benchmarkListStringPut();
- // benchmarkObjectPut();
- // benchmarkMapPut();
- // benchmarkSetPut();
- //
- // benchmarkPrimitiveGet();
- // benchmarkStringGet();
- // benchmarkListObjectGet();
- // benchmarkListStringGet();
- // benchmarkObjectGet();
- // benchmarkMapGet();
- // benchmarkSetGet();
- //
- // benchmarkDelete();
-
- Hawk.init(this)
- .setEncryptionMethod(HawkBuilder.EncryptionMethod.HIGHEST)
- .setPassword("password")
- .setStorage(HawkBuilder.newSharedPrefStorage(this))
- .setLogLevel(LogLevel.FULL)
- .setCallback(new HawkBuilder.Callback() {
- @Override
- public void onSuccess() {
- testRx();
-
- Hawk.put("joda", new DateTime());
- DateTime dateTime = Hawk.get("joda");
- }
-
- @Override
- public void onFail(Exception e) {
-
- }
- })
- .build();
- }
-
- private void testRx() {
- Hawk.putObservable(KEY, new Foo())
- .observeOn(Schedulers.io())
- .subscribeOn(AndroidSchedulers.mainThread())
- .subscribe(new Subscriber() {
- @Override
- public void onCompleted() {
- }
-
- @Override
- public void onError(Throwable e) {
- }
-
- @Override
- public void onNext(Boolean s) {
- }
- });
-
- Hawk.getObservable(KEY)
- .observeOn(Schedulers.io())
- .subscribeOn(AndroidSchedulers.mainThread())
- .subscribe(new Subscriber() {
- @Override
- public void onCompleted() {
- Log.d("rxtest", "completed");
- }
-
- @Override
- public void onError(Throwable e) {
- Log.d("rxtest", "error");
- }
-
- @Override
- public void onNext(Foo s) {
- Log.d("rxtest", s.toString());
- }
- });
-
- }
-
- private void testHawkInitWithoutPassword() {
- Hawk.init(this);
- Hawk.put("test123", "test");
- Hawk.init(this);
- Hawk.get("test123");
- }
-
- private static final String KEY = "KEY";
-
- private void benchmarkPrimitivePut() {
- int value = 13423;
-
- editor.clear().commit();
- long start = System.nanoTime();
- editor.putInt(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, value);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("int put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkStringPut() {
- String value = "something";
-
- editor.clear().commit();
- long start = System.nanoTime();
- editor.putString(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, value);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("String put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkObjectPut() {
- Foo foo = new Foo();
-
- Gson gson = new Gson();
- editor.clear().commit();
- long start = System.nanoTime();
- String value = gson.toJson(foo);
- editor.putString(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, foo);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("T put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkListStringPut() {
- List list = new ArrayList<>();
- for (int i = 0; i < 100; i++) {
- list.add("asdfasdfdsf");
- }
-
- Gson gson = new Gson();
- editor.clear().commit();
- long start = System.nanoTime();
- String value = gson.toJson(list);
- editor.putString(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, list);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("List put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkMapPut() {
- Map map = new HashMap<>();
- for (int i = 0; i < 100; i++) {
- map.put("key", "value");
- }
-
- Gson gson = new Gson();
- editor.clear().commit();
- long start = System.nanoTime();
- String value = gson.toJson(map);
- editor.putString(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, map);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("Map put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkSetPut() {
- Set set = new HashSet<>();
- for (int i = 0; i < 100; i++) {
- set.add("key");
- }
-
- Gson gson = new Gson();
- editor.clear().commit();
- long start = System.nanoTime();
- String value = gson.toJson(set);
- editor.putString(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, set);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("Set put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkListObjectPut() {
- List list = new ArrayList<>();
- for (int i = 0; i < 100; i++) {
- list.add(new Foo());
- }
-
- Gson gson = new Gson();
- editor.clear().commit();
- long start = System.nanoTime();
- String value = gson.toJson(list);
- editor.putString(KEY, value).commit();
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- start = System.nanoTime();
- Hawk.put(KEY, list);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("List put : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkPrimitiveGet() {
- int value = 13423;
-
- editor.clear().commit();
- editor.putInt(KEY, value).commit();
-
- long start = System.nanoTime();
- prefs.getInt(KEY, 0);
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- Hawk.put(KEY, value);
- start = System.nanoTime();
- Hawk.get(KEY);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("int get : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkStringGet() {
- String value = "something";
-
- editor.clear().commit();
- editor.putString(KEY, value).commit();
-
- long start = System.nanoTime();
- prefs.getString(KEY, null);
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- Hawk.put(KEY, value);
- start = System.nanoTime();
- Hawk.get(KEY);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("String get : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkListStringGet() {
- List list = new ArrayList<>();
- for (int i = 0; i < 100; i++) {
- list.add("asdfasdfdsf");
- }
-
- Gson gson = new Gson();
- editor.clear().commit();
- String value = gson.toJson(list);
- editor.putString(KEY, value).commit();
- long start = System.nanoTime();
- String json = prefs.getString(KEY, null);
- Type type = new TypeToken>() {
- }.getType();
- gson.fromJson(json, type);
- long end = System.nanoTime();
- double resultPref = getTime(start, end);
-
- Hawk.clear();
- Hawk.put(KEY, list);
- start = System.nanoTime();
- Hawk.get(KEY);
- end = System.nanoTime();
- double resultHawk = getTime(start, end);
-
- log("List get : Pref : " + resultPref + " -- Hawk : " + resultHawk);
-
- }
-
- private void benchmarkMapGet() {
- Map map = new HashMap<>();
- for (int i = 0; i < 100; i++) {
- map.put("key", "value");
- }
-
- Gson gson = new Gson();
- editor.clear().commit();
- String value = gson.toJson(map);
- editor.putString(KEY, value).commit();
- long start = System.nanoTime();
- String json = prefs.getString(KEY, null);
- Type type = new TypeToken