title: create the Drupal node from android
body: <p>Here I am working android application that convert the <code>drupal site</code> to android <code>native application.</code>Here I faces the issue when create the <code>drupal node</code> from the android. In short I have no idea about that.But I tried below, Please let me know where I am wrong, and there is any another solution for that.</p>
  
  <p>Druring this time I have also face one another issue.Into my postIdea class there are two another <code>AsyncTask</code>(category and Founder) that load the data from the json and add to the spinner before the press the submit button. Its working perfect. But when press the submit button also call the previous(category &amp; founder) AsyncTask.I am not calling again category &amp; founder method after press the submit button.</p>
  
  <p>drupal accept format for the node in my case :</p>
  
  <pre><code>{
   "type":"idea",
   "title":"idea one",
   "field_story_idea":[
   {
  "value":"test"          // test is title value
  }
  ],
  "field_founder_profile_refrence":[
   {
     "nid":"111"             // 111 is founder value
   }
  ],
  "field_idea_budget":[
  {
   "value":"2"             // 2 is budget value
   }
   ],
  "field_idea_details":[
  {
   "value":"AAAAAAAA"     //  AAAAAAAA is idea details value
  }
  ],
  "taxonomy":{
    "6":{
  "tid":"6"         // 6 is the category value
   }
  }
  }
  </code></pre>
  
  <p>Here I got the all value and also convert to the <code>JSON format</code>(as per display above).when I pass the perticular data to the server it gives me the status code 200 but also give the error like : </p>
  
  <pre><code>    Response from post  idea =&gt; &lt;br /&gt;&lt;b&gt;Fatal error&lt;/b&gt;:  Cannot unset string offsets in &lt;b&gt;/var/aegir/hostmaster-HEAD/profiles/default/modules/cck/includes/content.node_form.inc&lt;/b&gt; on line &lt;b&gt;60&lt;/b&gt;&lt;br /&gt;
  </code></pre>
  
  <p>and when I Combine all the data into one jsonobject and pass to the server then it gives me the error 401 status code,also give the error like:</p>
  
  <pre><code> Invalid use of SingleClientConnManager: connection still allocated.
   W/SingleClientConnManager( 1212): Make sure to release the connection before allocating another one.
  </code></pre>
  
  <p>post_idea.class</p>
  
  <pre><code>public class Post_Idea extends AsyncTask&lt;Void, Void, Void&gt; {
  
      String strResponse1;
      @Override
      protected void onPreExecute() {
          // TODO Auto-generated method stub
          super.onPreExecute();
  
          pgb.setVisibility(View.VISIBLE);
      }
  
      @Override
      public Void doInBackground(Void... params) {
          // TODO Auto-generated method stub
          String url = "URL HERE...";
  
          //String strResponse;
          try {
  
              strResponse1 = util.makeWebForPostIdea(url,title,spinnercategoryIndexId, spinnerFounderIndexId,
                      story_bhnd_idea,idea_dtls, spinnerBudgetId);
  
              System.out.println("=========&gt; Response from post  idea =&gt; "
                      + strResponse1);
  
          } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          // TODO Auto-generated method stub
          super.onPostExecute(result);
          pgb.setVisibility(View.GONE);
  
      }
  }
  </code></pre>
  
  <p>Util.class</p>
  
  <pre><code>  public static String makeWebForPostIdea(String url, String title,int spinnercategoryIndexId, int spinnerFounderIndexId, String story_bhnd_idea, String idea_dtls,int spinnerBudgetId) throws JSONException
     {
  
           HttpPost post = new HttpPost(url);
  
               List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
  
  
              // For the Founder and all other fields covert the json to the stringer
  
              JSONStringer jsonstringerFounder = new JSONStringer().array().object().key("nid").value(""+spinnerFounderIndexId).endObject().endArray();
              JSONStringer jsonstringerstoryBhndIdea = new JSONStringer().array().object().key("value").value(""+story_bhnd_idea).endObject().endArray();
              JSONStringer jsonstringerIdeaDetails = new JSONStringer().array().object().key("value").value(""+idea_dtls).endObject().endArray();
              JSONStringer jsonstringerBudjet = new JSONStringer().array().object().key("value").value(""+spinnerBudgetId).endObject().endArray();
                  JSONStringer jsonstringercategory1 = new JSONStringer().object().key(""+spinnercategoryIndexId).object().key("tid").value(""+spinnercategoryIndexId).endObject().endObject();
  
  
              JSONStringer combineallnode123 = new JSONStringer().object().key("type").value("idea").key("title").value(title).key("field_story_idea").
                      value(jsonstringerstoryBhndIdea).key("field_founder_profile_refrence").value(jsonstringerFounder).
                      key("field_idea_budget").value(jsonstringerBudjet).key("field_idea_details").
                      value(jsonstringerIdeaDetails).key("taxonomy").value(jsonstringercategory1).endObject();
  
             params.add(new BasicNameValuePair("cheerfoolz",combineallnode123.toString()));
            /* params.add(new BasicNameValuePair("type","idea"));
               params.add(new BasicNameValuePair("title",title));
               params.add(new BasicNameValuePair("field_story_idea", jsonstringerstoryBhndIdea.toString()));
               params.add(new BasicNameValuePair("field_founder_profile_refrence",jsonstringerFounder.toString()));
               params.add(new BasicNameValuePair("field_idea_budget", jsonstringerBudjet.toString()));
               params.add(new BasicNameValuePair("field_idea_details",jsonstringerIdeaDetails.toString()));
               params.add(new BasicNameValuePair("taxonomy",jsonstringercategory1.toString())); 
              */             
  
          UrlEncodedFormEntity formEntity = null;
              try {
                              formEntity = new UrlEncodedFormEntity(params);
              } catch (UnsupportedEncodingException e1) {
                      // TODO Auto-generated catch block
                      e1.printStackTrace();
              }
  
           post.setEntity(formEntity);
  
              try {
  
                      HttpResponse response = client.execute(post);
  
                      int statusCode = response.getStatusLine().getStatusCode();
                      System.out.println("=========&gt; statusCode from the postidea util.java=====&gt; "+statusCode);        
                      if (statusCode == HttpStatus.SC_OK)
                      {
                              HttpEntity entity = response.getEntity();
                              //String html = EntityUtils.toString(entity);
                              InputStream is = entity.getContent();
  
                              return iStream_to_String(is);
                      }
                      else
                      {
                              return "Hello This is status ==&gt; :"+String.valueOf(statusCode);
                      }
              } catch (UnsupportedEncodingException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
              } catch (ClientProtocolException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
              } catch (IOException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
              }
  
  
              }
  
              return null;
  
      }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here when I passed <code>perticular</code> value to the server then give me <code>status code 200</code> but there is no entry of the node at the <code>drupal site</code>.</p>