android连接到wamp服务器

时间:2017-08-01 18:55:03

标签: php android

喜爱 我试图从我的Android模拟器连接到localhost WAMP Apache服务器。但是连接被拒绝了。所有细节如下。请帮帮我。

package com.example.omen.test;
public class MainActivity extends AppCompatActivity
     {
String json_string;
         final  String TAG= "ali";
         RequestQueue rq ;
 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content_main);
    String url="https://10.0.2.2/oncfapp/oncf1.php";
   //String url="https://google.com";
 StringRequest stringRequest= new StringRequest(url, new Response.Listener<String>() {
 @Override
        public void onResponse(String response) {
Log.d(TAG, response);
        }
 }, new Response.ErrorListener() {
        @Override
 public void onErrorResponse(VolleyError error) {
            Toast.makeText(getApplicationContext(),"erreur",Toast.LENGTH_LONG).show();
      }
    });
    MySingleton.getInstance(this).addToRequestQueue(stringRequest);
}

这就是显示器中显示的内容:

08-01 18:20:59.915 2882-2882/? I/zygote: Not late-enabling -Xcheck:jni (already on)
08-01 18:20:59.990 2882-2882/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
08-01 18:21:00.558 2882-2933/com.example.omen.test W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-01 18:21:00.661 2882-2933/com.example.omen.test W/android.hardware.graphics.mapper@2.0::Mapper: getService: found null hwbinder interface

但是当我设置像google这样的其他地址时,请提供帮助

0 个答案:

没有答案