title: How can i convert json string to java object in android?
body: <p>I am trying to convert the response from server which is a JSON string,I want to convert that JSONstring to java object.I am trying Gson.Please someone explain and tell me the steps how to do it using Gson.</p>
  
  <pre><code>  @Override
          public void onClick(View v) {
              if (v == mLoginButton) {
                  LoginUser();
  
              }
              if (v==mSignUpBtn){
                  Intent intent=new Intent(LoginActivity.this,RegistrationActivity.class);
                  startActivity(intent);
              }
          }
  
          private void LoginUser() {
              // final String username = editTextUsername.getText().toString().trim();
              final String password = editTextPassword.getText().toString().trim();
              final String email = editTextEmail.getText().toString().trim();
  
  
  
              StringRequest postStringRequest = new StringRequest(Request.Method.POST,LOGIN_API,
                      new Response.Listener&lt;String&gt;() {
                          @Override
                          public void onResponse(String response) {
                              Toast.makeText(LoginActivity.this, response, Toast.LENGTH_LONG).show();
                              Log.d(TAG,"Reponse Check :"+response);
                             // Gson gson = new Gson();
                             // String jsonInString = "{}";
                              //LoginActivity staff = gson.fromJson(jsonInString, LoginActivity.class);
                              //Log.d(TAG,"Reponse Check staff :"+staff);
  
                          }
                      },
                      new Response.ErrorListener() {
                          @Override
                          public void onErrorResponse(VolleyError error) {
                              Toast.makeText(LoginActivity.this, error.toString(), Toast.LENGTH_LONG).show();
                              Log.e(TAG,"Error Response Check :"+error);
                          }
                      }) {
  
                  @Override
                  protected Map&lt;String, String&gt; getParams() {
                      Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
  
                      Log.d(TAG,"For email :"+email);
                      Log.d(TAG,"For password :"+password);
                      //try {
                          Log.d(TAG,"My Credentials email URL Encoder: "+( mEncryption.AESEncode(email)));
                          Log.d(TAG,"My Credentials email URL DECODED: "+( mEncryption.AESDecode(mEncryption.AESEncode(email))));
  
                          params.put("data[User][email]",(mEncryption.AESEncode(email)));
  
                          Log.d(TAG,"My Credentials pass URL Encoder: "+( mEncryption.AESEncode(password)));
                          paa
                  }
  </code></pre>
  
  <p>logcat</p>
  
  <pre><code>03-16 16:36:08.346 2618-3428/com.example.user.myapplication D/Null: For email :abc@gmail.com
  03-16 16:36:08.346 2618-3428/com.example.user.myapplication D/Null: For password :12345678
  03-16 16:36:08.354 2618-3428/com.example.user.myapplication D/Null: My Credentials email URL Encoder: RyUMRBg7UyeIlFBBtNemZFuG46PJtAIdiZWXnlJ4zNI=
  03-16 16:36:08.358 2618-3428/com.example.user.myapplication D/Null: My Credentials email URL DECODED: abc@gmail.com
  03-16 16:36:08.360 2618-3428/com.example.user.myapplication D/Null: My Credentials pass URL Encoder: pfrt1fKLkoZhAT6hoMJFiA==
  03-16 16:36:08.361 2618-3428/com.example.user.myapplication D/Null: Params :{data[User][password]=pfrt1fKLkoZhAT6hoMJFiA==
                                                                      , data[User][email]=RyUMRBg7UyeIlFBBtNemZFuG46PJtAIdiZWXnlJ4zNI=
                                                                      }
  03-16 16:36:08.505 2618-2618/com.example.user.myapplication D/Null: Reponse Check :{"code":200,"user":{"User":{"id":"ui1bJkK19jxbaquTboA2oQ==","email":"RyUMRBg7UyeIlFBBtNemZFuG46PJtAIdiZWXnlJ4zNI=","status":"1","verified":"1","created":"2016-03-07 11:41:59","modified":"2016-04-07 15:43:43","token":"6b987332b77d7c69d76bf7be80a85177fb7fa08d"},"Profile":{"id":"1","first_name":"abc","last_name":"fgh","bio":"sfafaf","address":"82, Debinibash Road\r\nDum Dum, P.O. - Motijheel","phone":"+913325505055","profile_pic":"\/img\/356a192b7913b04c54574d18c28d46e6395428ab\/license.jpg","user_id":"1","Contributor":{"id":"31","profile_id":"1","status":"1","vs_cdn_id":"261961777","secret_token":"s-7Va5z","uploaded_on":null,"statement":"AOK KJDHKJDH bkgkg kkhkjh kjhkj kjh kjhkjh","time":"7 hours per month","created":"2016-05-02 18:40:11","modified":"2016-05-02 18:41:29"},"Moderator":[]},"redirect":"\/"}}
  </code></pre>