title: Can't insert data in google sheets from android app (Java)
body: <p>I'm trying to insert a data on google sheet api by calling this method on my code. but it's not working, what is wrong with my code?</p>
  <pre><code>public  void   addItemToSheet() {
      
              //final ProgressDialog loading = ProgressDialog.show(this,&quot;Adding Item&quot;,&quot;Please wait&quot;);
              String code = &quot;insert test&quot;;
              StringRequest stringRequest = new StringRequest(Request.Method.POST, &quot;https://script.google.com/macros/s/AKfycbwvCuLeJpsH6iQ6UojH5tR4rLQW98JFjVa0DqOujqb1Krox_mhbdrb9DRljMMOrsoGk/exec&quot;,
                      new Response.Listener&lt;String&gt;() {
                          @Override
                          public void onResponse(String response) {
                             // loading.dismiss();
                              Toast.makeText(MainActivity.this,response,Toast.LENGTH_LONG).show();
                              Intent intent = new Intent(getApplicationContext(),MainActivity.class);
                              startActivity(intent);
                          }
                      },
                      new Response.ErrorListener() {
                          @Override
                          public void onErrorResponse(VolleyError error) {
      
                          }
                      }
              ) {
                  @Override
                  protected Map&lt;String, String&gt; getParams() {
                      Map&lt;String, String&gt; parmas = new HashMap&lt;&gt;();
                      //here we pass params
                      parmas.put(&quot;Code&quot;,code);
      
                      return parmas;
                  }
              };
      
              int socketTimeOut = 5000;// u can change this .. here it is 5 seconds
      
              RetryPolicy retryPolicy = new DefaultRetryPolicy(socketTimeOut, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
              stringRequest.setRetryPolicy(retryPolicy);
      
              RequestQueue queue = Volley.newRequestQueue(this);
      
              queue.add(stringRequest);
      
          }
  </code></pre>
  <p>I deployed the sheet using this script :</p>
  <pre><code>var ss = SpreadsheetApp.openByUrl(&quot;https://docs.google.com/spreadsheets/d/DFJEKLE3LGsvate8vgAW72eDJQ_U/edit#gid=0&quot;);
  
  var sheet = ss.getSheetByName('Items'); // My sheet is named Items
  
  function doPost(e){
  var action = e.parameter.action;
  
  if(action == 'addItem'){
    return addItem(e);
  }
  }
  
  function addItem(e){
  var code = e.parameter.Code;
  
  sheet.appendRow([code]);
     return ContentService.createTextOutput(&quot;Success&quot;).setMimeType(ContentService.MimeType.TEXT);
  }
  </code></pre>