mardi 5 janvier 2016

Android to CodeIgniter can't receive chunk data

Currently Using: Android: Api Level 19 CodeIgniter EasyPHP

My Problem:

 I have a JSON data , What i want to do is GZIP it then send it to my web api by chunking the data. My web api does well when i just sent JSON data as i send GZIP then chunk it i can't even receive the data from my web api.

 What is the core development of the project is that in mobile it gathers information , i think it is quite big because it actually measures up to 10 mb as i send this to my server which is not good for the user side now i want it the JSON data to be GZIP then i want the sending of these data to be chunked so that it would feel a lot faster as before. 

Android Code:

    private void addTaskInThreadPool(final ClassEntry entry) {

    try {


        List<NameValuePair> pairs = new ArrayList<NameValuePair>();

        String s = "{\"entry\":" + gson.toJson(entry) + "}";

        pairs.add(new BasicNameValuePair("token", user.token));
        pairs.add(new BasicNameValuePair("data", s));


        threadPool.addTask(new ClientPostRequest.Builder(ClassSend.this,
                GeneralResponse.class,
                Utils.getbaseUrl(ClassSend.this) + "survey/submit_entry/",
                pairs) {

            @Override
            public Object doInBackground(Object result) {

                return result;                              

            }

            @Override
            public void onPostExecute(Object result) {


            }

        }.showProgressBar(false).showToast(true).build());

    } catch(ClassCastException e) {
        Log.e("threadBackGround ClassCast", "Error: " + e);
    }
}       

Can somebody help me i need this for my project and research. I need your suggestions , critics , i would highly appreciate this to upgrade my programming skills i'm still a newbie for this one i need my fellow SO mates to help me with my problem.




Aucun commentaire:

Enregistrer un commentaire