android studio中的nodejs json

时间:2018-09-05 11:20:46

标签: android json android-volley

我是android的新手。我在获取数据库表的nodejs中编写请求代码。我尝试与邮递员,这是正确的,并返回json。但在android studio中,它在android监视器中返回空。下面是我的android代码。我的问题在哪里??

 public class ActGroups extends AppCompatActivity {


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_groups);


        get_groups();
    }


    void get_groups(){


        String url=mylib.ClsVars.get_url(1);

        final StringRequest stringRequest=new StringRequest(Request.Method.POST, url,

                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                        Log.i("resp",response);
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {


                           Log.i("err",error.getMessage());
                    }
                }

        ){

            @Override
            protected Map<String,String>getParams()throws AuthFailureError {


                Map<String, String> map = new Hashtable<String, String>();
                map.put("name", Base64.encodeToString("".getBytes(), Base64.DEFAULT));
                return map;
            }

        };

        RequestQueue requestQueue = Volley.newRequestQueue(ActGroups.this);
        requestQueue.add(stringRequest);
    }


}

09-06 02:13:08.289 4414-4414 /? I / art:后启用-Xcheck:jni 09-06 02:13:08.441 4414-4414 / com.example.hosseinry.tour W /系统:ClassLoader引用的未知路径:/data/app/com.example.hosseinry.tour-2/lib/x86 09-06 02:13:08.454 4414-4414 / com.example.hosseinry.tour I / InstantRun:启动即时运行服务器:是主进程 09-06 02:13:08.520 4414-4414 / com.example.hosseinry.tour W / art:在Android 4.1之前,方法android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter ,android.content.res.ColorStateList,android.graphics.PorterDuff $ Mode)错误地覆盖了android.graphics.drawable.Drawable中的package-private方法 09-06 02:13:08.526 4414-4427 / com.example.hosseinry.tour D / libEGL:已加载/system/lib/egl/libEGL_adreno.so 09-06 02:13:08.583 4414-4427 / com.example.hosseinry.tour D / libEGL:已加载/system/lib/egl/libGLESv1_CM_adreno.so 09-06 02:13:08.595 4414-4427 / com.example.hosseinry.tour D / libEGL:已加载/system/lib/egl/libGLESv2_adreno.so 09-06 02:13:08.675 4414-4429 / com.example.hosseinry.tour I / OpenGLRenderer:初始化的EGL,版本1.4 09-06 02:13:08.675 4414-4429 / com.example.hosseinry.tour D / OpenGLRenderer:交换行为1 09-06 02:13:08.720 4414-4429 / com.example.hosseinry.tour W / EGL_emulation:eglSurfaceAttrib未实现3093 12436 09-06 02:13:08.720 4414-4429 / com.example.hosseinry.tour W / OpenGLRenderer:无法在表面0xab9ff380上设置EGL_SWAP_BEHAVIOR,错误= EGL_SUCCESS 09-06 02:13:08.728 4414-4414 / com.example.hosseinry.tour W / art:在Android 4.1之前,方法int android.support.v7.widget.DropDownListView.lookForSelectablePosition(int,boolean)会错误地覆盖android.widget.ListView中的package-private方法

enter code here

0 个答案:

没有答案