I appreciate them.

Thursday, 3 August 2017

Ion Library by Koush


Since I work as a Software engineer,So I think I should talk a little bit more about my job in this blog.

Previously In Android apps development I create HttpClient class,exception,Lost connection handling , create callback all by myself .

This pass few days I found one library that catches my eyes which is Ion Library.It handle everything for us.We just need to import it into our app gradle.

compile 'com.koushikdutta.ion:ion:2.+'


JsonObject json = new JsonObject();
json.addProperty(Constants.FULLNAME, fullName);
json.addProperty(Constants.EMAIL, email);
json.addProperty(Constants.FIRST_NAME, firstName);
json.addProperty(Constants.LAST_NAME, lastName);
json.addProperty(Constants.GENDER, "");
json.addProperty(Constants.DOB, "");
json.addProperty(Constants.FIREBASE_UID, firebaseId);

        .load("API url")
        .setCallback(new FutureCallback<JsonObject>() {
            @Override            public void onCompleted(Exception e, JsonObject result) {
                runOnUiThread(new Runnable() {
                    @Override                    public void run() {
                if (e != null) {
                    Toast.makeText(getBaseContext(), "Data : " + e.getStackTrace(), 
                } else {

                    Toast.makeText(getApplicationContext(), "Registered successfully", 

Easy peasy huh?

More info you can find at https://github.com/koush/ion

Anyway Thanks Koush for this wonderful library!

No comments: