diff --git a/.idea/markdown-exported-files.xml b/.idea/markdown-exported-files.xml
new file mode 100644
index 0000000..5d1f129
--- /dev/null
+++ b/.idea/markdown-exported-files.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index cbd46bd..3827dc0 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -27,7 +27,11 @@
-
+<<<<<<< HEAD
+
+=======
+
+>>>>>>> d1327f10938106fc8c356505d4ae81c30a76cc71
diff --git a/app/src/main/java/androidsdk/devless/io/devlesssdkofficial/MainActivity.java b/app/src/main/java/androidsdk/devless/io/devlesssdkofficial/MainActivity.java
index 33cc811..df8d8e6 100644
--- a/app/src/main/java/androidsdk/devless/io/devlesssdkofficial/MainActivity.java
+++ b/app/src/main/java/androidsdk/devless/io/devlesssdkofficial/MainActivity.java
@@ -6,6 +6,20 @@
import android.os.Bundle;
import android.util.Log;
+import java.util.HashMap;
+import java.util.Map;
+
+import androidsdk.devless.io.devless.interfaces.DeleteResponse;
+import androidsdk.devless.io.devless.interfaces.EditDataResponse;
+import androidsdk.devless.io.devless.interfaces.GetDataResponse;
+import androidsdk.devless.io.devless.interfaces.LoginResponse;
+import androidsdk.devless.io.devless.interfaces.PostDataResponse;
+import androidsdk.devless.io.devless.interfaces.SearchResponse;
+import androidsdk.devless.io.devless.interfaces.SignUpResponse;
+import androidsdk.devless.io.devless.main.Devless;
+import androidsdk.devless.io.devless.messages.ErrorMessage;
+import androidsdk.devless.io.devless.messages.Payload;
+import androidsdk.devless.io.devless.messages.ResponsePayload;
public class MainActivity extends AppCompatActivity {
@@ -17,6 +31,192 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+ //Create a shared preference like this
+ SharedPreferences sp = getSharedPreferences(getPackageName(), Context.MODE_PRIVATE);
+
+ //Now go ahead and set devless up
+ String appUrl = "http://buildgallery.herokuapp.com"; // remember no slash after the com just the absolute URL
+ String devlessToken = "41b1f8b6dd4823f63f8eeed626bfafa8"; //this is my token
+
+ //This is how to create a devless instance
+ //Devless devless = new Devless(this, appUrl, devlessToken);
+
+ /*
+ setUpDevlessUserToken Right under the instance and pass in the
+ name of your shared preference variable. Im my case I called my shared preference *sp*
+ */
+ //devless.addUserToken(sp);
+
+ //Log.e("token", devless.getDevlessUserToken());
+
+
+ //Log.e("==repo==", devless.getDevlessUserToken());
+
+
+ // Sign Up
+ /*
+ devless.signUpWithEmailAndPassword("email1@email.com", "password", sp, new SignUpResponse() {
+ @Override
+ public void onSignUpSuccess(Payload payload) {
+ Log.e("==Success==", payload.toString());
+ }
+
+ @Override
+ public void onSignUpFailed(ErrorMessage errorMessage) {
+ Log.e("==Failure==", errorMessage.toString());
+ }
+ });
+ */
+
+
+
+
+// devless.loginWithEmailAndPassword("email1@email.com", "password", sp, new LoginResponse() {
+// @Override
+// public void onLogInSuccess(ResponsePayload response) {
+// Log.e("==Passed==", response.toString());
+// }
+//
+// @Override
+// public void onLogInFailed(ErrorMessage errorMessage) {
+// Log.e("==Failure==", errorMessage.toString());
+// }
+// });
+
+
+//
+// devless.getData("gitmo", "test_table", new GetDataResponse() {
+// @Override
+// public void onSuccess(ResponsePayload response) {
+// Log.e("Success", response.toString());
+// }
+//
+// @Override
+// public void onFailed(ErrorMessage errorMessage) {
+// Log.e("Failure", errorMessage.toString());
+// }
+//
+// @Override
+// public void userNotAuthenticated(ErrorMessage message) {
+// Log.e("UserNotAuth", message.toString());
+// }
+//
+// @Override
+// public void fullRequestResponse(ResponsePayload response) {
+// Log.e("Full", response.toString());
+// }
+// });
+
+
+
+
+
+
+
+ //Post Data
+// Map data = new HashMap();
+// data.put("name", "koobi");
+//
+// devless.postData("plans", "test_table", data, new PostDataResponse() {
+// @Override
+// public void onSuccess(ResponsePayload response) {
+// Log.e("success", response.toString());
+// }
+//
+// @Override
+// public void onFailed(ErrorMessage errorMessage) {
+// Log.e("Failed", errorMessage.toString());
+// }
+//
+// @Override
+// public void userNotAuthenticated(ErrorMessage message) {
+// Log.e("UnAuth", message.toString());
+// }
+//
+// @Override
+// public void fullPostDataResponse(ResponsePayload response) {
+// Log.e("FullPostdata", response.toString());
+// }
+// });
+
+
+ /* get data
+ devless.getData("plans", "test_table", new GetDataResponse() {
+ @Override
+ public void onSuccess(ResponsePayload response) {
+ Log.e("success", response.toString());
+ }
+
+ @Override
+ public void onFailed(ErrorMessage errorMessage) {
+ Log.e("Failed", errorMessage.toString());
+ }
+
+ @Override
+ public void userNotAuthenticated(ErrorMessage message) {
+ Log.e("UnAuth", message.toString());
+ }
+
+ @Override
+ public void fullRequestResponse(ResponsePayload response) {
+ Log.e("FullPostData", response.toString());
+ }
+ });
+ */
+
+
+ /*
+ Map change = new HashMap<>();
+ change.put("name", "kulee");
+
+ devless.edit("plans", "test_table", change, "1", new EditDataResponse() {
+ @Override
+ public void onSuccess(ResponsePayload response) {
+ Log.e("success", response.toString());
+ }
+
+ @Override
+ public void onFailed(ErrorMessage errorMessage) {
+ Log.e("Failed", errorMessage.toString());
+ }
+
+ @Override
+ public void userNotAuthenticated(ErrorMessage message) {
+ Log.e("UnAuth", message.toString());
+ }
+
+ @Override
+ public void fullEditDataResponse(ResponsePayload response) {
+ Log.e("FullPostData", response.toString());
+ }
+ });
+ */
+
+ /* Delete Message
+ devless.delete("plans", "test_table", "1", new DeleteResponse() {
+ @Override
+ public void onSuccess(ResponsePayload response) {
+ Log.e("success", response.toString());
+ }
+
+ @Override
+ public void onFailed(ErrorMessage errorMessage) {
+ Log.e("Failed", errorMessage.toString());
+ }
+
+ @Override
+ public void userNotAuthenticated(ErrorMessage message) {
+ Log.e("UnAuth", message.toString());
+ }
+
+ @Override
+ public void fullDeleteResponse(ResponsePayload response) {
+ Log.e("FullPostData", response.toString());
+ }
+ });
+ */
+
+
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/DeleteResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/DeleteResponse.java
index e85c832..7aa5ce4 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/DeleteResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/DeleteResponse.java
@@ -12,5 +12,6 @@ public interface DeleteResponse {
void onSuccess(ResponsePayload response);
void onFailed(ErrorMessage errorMessage);
void userNotAuthenticated(ErrorMessage message);
+ void fullDeleteResponse (ResponsePayload response);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/EditDataResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/EditDataResponse.java
index f0e08dd..279dc6b 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/EditDataResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/EditDataResponse.java
@@ -12,4 +12,5 @@ public interface EditDataResponse {
void onSuccess(ResponsePayload response);
void onFailed(ErrorMessage errorMessage);
void userNotAuthenticated(ErrorMessage message);
+ void fullEditDataResponse(ResponsePayload response);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/GetDataResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/GetDataResponse.java
index 044e820..6f6af97 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/GetDataResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/GetDataResponse.java
@@ -11,4 +11,5 @@ public interface GetDataResponse {
void onSuccess(ResponsePayload response);
void onFailed(ErrorMessage errorMessage);
void userNotAuthenticated(ErrorMessage message);
+ void fullRequestResponse (ResponsePayload response);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LoginResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LoginResponse.java
index e73f41b..3a3cbb0 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LoginResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LoginResponse.java
@@ -10,4 +10,5 @@
public interface LoginResponse {
void onLogInSuccess(ResponsePayload response);
void onLogInFailed(ErrorMessage errorMessage);
+
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LogoutResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LogoutResponse.java
index ad8c13e..21637cc 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LogoutResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/LogoutResponse.java
@@ -8,4 +8,5 @@
public interface LogoutResponse {
void onLogOutSuccess(ResponsePayload response);
+ void fullLogoutResponse(ResponsePayload response);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/PostDataResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/PostDataResponse.java
index e4ac641..3296844 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/PostDataResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/PostDataResponse.java
@@ -11,4 +11,5 @@ public interface PostDataResponse {
void onSuccess(ResponsePayload response);
void onFailed(ErrorMessage errorMessage);
void userNotAuthenticated(ErrorMessage message);
+ void fullPostDataResponse(ResponsePayload response);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/RequestResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/RequestResponse.java
index 051ec52..3242c55 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/RequestResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/RequestResponse.java
@@ -10,4 +10,5 @@
public interface RequestResponse {
void onSuccess(ResponsePayload response);
void userNotAuthenticated(ErrorMessage message);
+// void fullRequestResponse(ResponsePayload response);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SearchResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SearchResponse.java
index 445e93d..e41c40f 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SearchResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SearchResponse.java
@@ -10,4 +10,5 @@
public interface SearchResponse {
void onSuccess(ResponsePayload response);
void userNotAuthenticated(ErrorMessage errorMessage);
+ void fullSearchResponse(ResponsePayload responsePayload);
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SignUpResponse.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SignUpResponse.java
index 726d9fc..8badc5c 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SignUpResponse.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/interfaces/SignUpResponse.java
@@ -2,6 +2,7 @@
import androidsdk.devless.io.devless.messages.ErrorMessage;
import androidsdk.devless.io.devless.messages.Payload;
+import androidsdk.devless.io.devless.messages.ResponsePayload;
/**
* Created by pianoafrik on 6/8/17.
@@ -10,4 +11,5 @@
public interface SignUpResponse {
void onSignUpSuccess(Payload payload);
void onSignUpFailed(ErrorMessage errorMessage);
+
}
diff --git a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/main/Devless.java b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/main/Devless.java
index 4b4d474..df11bcc 100644
--- a/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/main/Devless.java
+++ b/dv-android-sdk-1.0/src/main/java/androidsdk/devless/io/devless/main/Devless.java
@@ -6,6 +6,8 @@
import android.text.TextUtils;
import android.util.Log;
+import com.google.gson.Gson;
+
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
@@ -46,6 +48,7 @@ public class Devless extends AppCompatActivity implements Serializable{
Context mContext;
private String rootUrl, token, devlessUserToken="", where = "", orderBy="id", empty;
private int size = -1 ;
+ private static String TAG="Devless";
public Devless(Context mContext, String rootUrl, String token) {
@@ -93,11 +96,67 @@ public void onFailure(Call call, Throwable t) {
});
}
+ public void postMassData(String serviceName, String tableName, ArrayList