title: JSON with android not working with android device
body: <p>I have a problem with JSON login.</p>
  
  <p>This is the PHP file:</p>
  
  <pre><code>&lt;?php 
  require "init.php";
  
  $UserName =$_POST["User_UserName"];
  $Password =md5($_POST["User_Password"]);
  
  $result = mysqli_query($con,"SELECT User_UserName FROM User WHERE User_UserName = '$UserName' and User_Password='$Password'");
  $row = mysqli_fetch_array($result);
  $data = $row[0];
  
  if($data){
  $response["success"] = 1;
           $response["message"] = "You have been sucessfully login";
   $response["UserName"] = $data;
           die(json_encode($response)); 
           }
                   else
                   { 
          $response["success"] = 0; 
           $response["message"] = "invalid username or password ";
           die(json_encode($response));
                  } 
  
           mysql_close(); 
           ?&gt;
  </code></pre>
  
  <p>Android:</p>
  
  <pre><code>RequestQueue requestQueue;
  
      String LoginURL = "..../login.php";
  requestQueue = Volley.newRequestQueue(getApplicationContext());
  
  btLogin.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
  
  
                  StringRequest request = new StringRequest(Request.Method.POST, LoginURL, new Response.Listener&lt;String&gt;() {
                      @Override
                      public void onResponse(String response) {
                          try {
                              JSONObject jsonObject = new JSONObject(response);
                              if(jsonObject.names().get(0).equals("success")) {
                                  Toast.makeText(getApplicationContext(),"Success "+jsonObject.getString("UserName"),Toast.LENGTH_SHORT).show();
                                  Intent intent= new Intent(MainActivity.this,Welcome.class);
                                  intent.putExtra("UserName",jsonObject.getString("UserName"));
                                  startActivity(intent);
                                  // startActivity(new Intent(getApplication(),Welcome.class));
                              }
                              else
                              {
                                  Toast.makeText(getApplicationContext(),"Error",Toast.LENGTH_SHORT).show();
                              }
  
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
  
                      }
                  }, new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
  
                      }
                  }){
                      @Override
                      protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                          Map&lt;String,String&gt; parameters = new HashMap&lt;String, String&gt;();
                          parameters.put("User_UserName",etEmail.getText().toString());
                          parameters.put("User_Password",etPassword.getText().toString());
  
                          return parameters;
                      }
                  };
  
                  requestQueue.add(request);
  
  
  
  
              }
          });
  </code></pre>
  
  <p>It is working with android emulator but not working with Genymotion emulator and not working with my android device.</p>
  
  <p>Any solution?</p>
  
  <p>This is the error:</p>
  
  <pre><code>dalvikvm: Late-enabling CheckJNI
  dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzi
  dalvikvm: VFY: unable to resolve virtual method 547: Landroid   content pm  PackageManager;.getPackageInstaller ()Landroid  content pm  PackageInstaller;
  dalvikvm: VFY: replacing opcode 0x6e at 0x000b
  GMPM: App measurement is starting up, version: 8487
  GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
  GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services.  Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
  GMPM: Scheduler not set. Not logging error  warn.
  dalvikvm: VFY: unable to find class referenced in signature (Landroid   view    SearchEvent;)
  dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
  dalvikvm: VFY: unable to resolve interface method 16064: Landroid   view    Window$Callback;.onSearchRequested (Landroid    view    SearchEvent;)Z
  dalvikvm: VFY: replacing opcode 0x72 at 0x0002
  dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
  dalvikvm: VFY: unable to resolve interface method 16068: Landroid   view    Window$Callback;.onWindowStartingActionMode (Landroid   view    ActionMode$Callback;I)Landroid  view    ActionMode;
  dalvikvm: VFY: replacing opcode 0x72 at 0x0002
  GMPM: Uploading is not possible. App measurement disabled
  dalvikvm: GC_FOR_ALLOC freed 317K, 11% free 3326K   3712K, paused 4ms, total 5ms
  dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
  dalvikvm: VFY: unable to resolve virtual method 626: Landroid   content res TypedArray;.getChangingConfigurations ()I
  dalvikvm: VFY: replacing opcode 0x6e at 0x0002
  dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
  dalvikvm: VFY: unable to resolve virtual method 648: Landroid   content res TypedArray;.getType (I)I
  dalvikvm: VFY: replacing opcode 0x6e at 0x0002
  dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
  dalvikvm: VFY: unable to resolve virtual method 589: Landroid   content res Resources;.getDrawable (ILandroid   content res Resources$Theme;)Landroid   graphics    drawable    Drawable;
  dalvikvm: VFY: replacing opcode 0x6e at 0x0002
  dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
  dalvikvm: VFY: unable to resolve virtual method 591: Landroid   content res Resources;.getDrawableForDensity (IILandroid    content res Resources$Theme;)Landroid   graphics    drawable    Drawable;
  dalvikvm: VFY: replacing opcode 0x6e at 0x0002
  libEGL: loaded  system  lib egl libEGL_genymotion.so
  libEGL: loaded  system  lib egl libGLESv1_CM_genymotion.so
  libEGL: loaded  system  lib egl libGLESv2_genymotion.so
  EGL_genymotion: eglSurfaceAttrib not implemented
  OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache
  OpenGLRenderer: MAX_TEXTURE_SIZE: 8192
  OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
  OpenGLRenderer: MAX_TEXTURE_SIZE: 8192
  OpenGLRenderer: Enabling debug mode 0
  GMPM: Tag Manager is not found and thus will not be used
  dalvikvm: GC_FOR_ALLOC freed 270K, 9% free 3568K    3908K, paused 18ms, total 18ms              
  </code></pre>