Doubt / Problem With WebService on Android

0

The return in my WebService looks like this:

  

"Hello! \ n \ nI am interested in your services. My name is Administrator B. Please contact me by phone (s) (12) 3456-7891; (13) 21321 -3213. My email is adm @ adm. \ N \ n Regards, \ n \ nBirman B "

The correct one would look like this:

  

Hello! I'm interested in your job listing cvbcvbaaa. Please contact me by phone (s) (12) 3456-7891; (13) 21321-3213. My email is adm @ adm. Sincerely, Administrator B

How could I do to be correct ??

I'm getting this from the WebService

private void makeJsonObjReq(){
        showProgressDialog();
        int id = ((AppController) this.getApplication()).getID();
        JsonArrayRequest req = new JsonArrayRequest(Const.URL_JSON_ARRAY_Notificacao + "/"+id,
                new Response.Listener<JSONArray>() {
                    @Override
                    public void onResponse(JSONArray response) {
                        Log.d(TAG, response.toString());
                        hideProgressDialog();

                        int aJsonint = 0;
                        String aJsonString;

                        itens = new ArrayList<ItemListaNotificacao>();

                        // Recupera seu adapter

                        try {
                            JSONArray jsonarray = response;
                            JSONObject jsonobj;

                            for (int i=0; i<jsonarray.length(); i++){
                                jsonobj = jsonarray.getJSONObject(i);

                                JsonData = jsonobj.getString("dataNotificacao");
                                JsonAssunto = jsonobj.getString("assunto");
                                JsonVisualizado = jsonobj.getString("visualizado");
                                JsonTexto = jsonobj.getString("texto");

                                itens.add(new ItemListaNotificacao(JsonData, JsonAssunto,JsonTexto));
                                //ItemListView item[i] = new ItemListView(JsonData, JsonAssunto);
                            }
                            adapterListView = new AdapterListNotificacao(getApplicationContext(), itens);

                            //Define o Adapter
                            ListNotificacao.setAdapter(adapterListView);
                            // Habilitar novamente a notificacao
                            // Notifica o Spinner de que houve mudanca no modelo
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        VolleyLog.d(TAG, "Error: " + error.getMessage());

                        System.out.println("Deu ERROR PQP");
                        hideProgressDialog();
                        msgerro();
                        finish();
                    }
                }
        );

        // Adding request to request queue
        AppController.getInstance().addToRequestQueue(req,
                tag_json_arry);

    }
    
asked by anonymous 02.10.2014 / 15:10

1 answer

1

If you are using the EntityUtils.toString () method then you can set the encoding of the message. ex:

string data = EntityUtils.toString(<resposta do web service>,HTTP.UTF_8);

being of type HttpEntity

Anyway, it's best to put the relevant parts of the code here.

    
02.10.2014 / 15:51