title: How can I send and retrieve data with parse.com
body: <p>I wrote that code to send data to parse.com then to receive it also but I can't even send it till now, why ?!! I don't know the main reason, I put the internet and network permission in AndroidManifest.xml the parse class in application also in AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.mkadaimtwo"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="21" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  &lt;application
      android:name="com.example.mkadaimtwo.ParseCode"
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>and also put the parse class in application also in AndroidManifest.xml and that two codes of class and main Activity </p>
  
  <p>ParseCode class Activity :</p>
  
  <pre><code>package com.example.mkadaimtwo;
  
  import com.parse.Parse;
  
  import android.app.Application;
  
  public class ParseCode extends Application {
  public void onCreate() {
        Parse.initialize(this, "GIuhlGILKRd8itvCF79femTyReHM6XjVkrfLKm3X",   "Fjg4tBrMgl0mY47K4kCL7hVmXhu8FmkE2on9PlXK");
      }
    }
  </code></pre>
  
  <p>the MainActivity Code :</p>
  
  <pre><code>package com.example.mkadaimtwo;
  
     import android.app.AlertDialog;
     import android.app.ProgressDialog;
     import android.net.ParseException;
     import android.os.Bundle;
     import android.support.v7.app.ActionBarActivity;
     import android.view.View;
      import android.widget.EditText;
  
     import com.parse.GetCallback;
     import com.parse.ParseObject;
     import com.parse.ParseQuery;
  
     public class MainActivity extends ActionBarActivity {
  
  EditText etCompanyName,etAddress,etNumberOfEmployees,etContactNumber;
  ProgressDialog pd,pd2;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      etCompanyName = (EditText) findViewById(R.id.etCompanyName);
      etAddress = (EditText) findViewById(R.id.etAddress);
      etNumberOfEmployees = (EditText) findViewById(R.id.etNumberOfEmployees);
      etContactNumber = (EditText) findViewById(R.id.etContactNumber);
  
      pd = new ProgressDialog(this);
      pd.setTitle("wait");
      pd.setMessage("by7aml elmafrod");
      pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      pd.setCancelable(true);
  
  
      pd2 = new ProgressDialog(this);
      pd2.setTitle("wait");
      pd2.setMessage("by7aml elmafrod");
      pd2.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      pd2.setCancelable(true);
  
      //here we will Load the old company data from Parse.com
  
      ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("TestBosyApp");
      query.getInBackground("ijy1qi78g8", new GetCallback&lt;ParseObject&gt;() {
          public void done(ParseObject testBosyApp, ParseException e) {
              if (e == null) {
  
                  String companyName = testBosyApp.getString("company_name");
                  String address = testBosyApp.getString("address");
                  String numberOfEmployees = testBosyApp.getString("number_of_employees");
                  String contactNumber = testBosyApp.getString("contact_number");
  
                  etCompanyName.setText(companyName);
                  etAddress.setText(address);
                  etNumberOfEmployees.setText(numberOfEmployees);
                  etContactNumber.setText(contactNumber);
  
                  pd.dismiss();
  
  
              } else {
                  AlertDialog.Builder mDialoge = new AlertDialog.Builder(MainActivity.this); 
                  mDialoge.setTitle("Erorr");
                  mDialoge.setMessage("Check el net plz :)");
                  mDialoge.setPositiveButton("ok", null);
                  mDialoge.show();
              }
          }
  
          @Override
          public void done(ParseObject arg0, com.parse.ParseException arg1) {
              // TODO Auto-generated method stub
  
          }
  
      });
  
  }
  
    public void update (View V){
      pd2.show();
      //update data in Parse
  
      ParseQuery&lt;ParseObject&gt; myQuery = ParseQuery.getQuery("TestBosyApp");
  
      // Retrieve the object by id
      myQuery.getInBackground("U6Gwn2tiD8", new GetCallback&lt;ParseObject&gt;() {
          public void done(ParseObject testBosyApp, ParseException e) {
              if (e == null) {
                  //Initials our variables
                  String companyName = etCompanyName.getText().toString().trim();
                  String address = etAddress.getText().toString().trim();
                  String numberOfEmployees = etNumberOfEmployees.getText().toString().trim();
                  String contactNumber = etContactNumber.getText().toString().trim();
  
                  //update it with new data
  
                  testBosyApp.put("company_name", companyName);
                  testBosyApp.put("address", address);
                  testBosyApp.put("number_of_employees", numberOfEmployees);
                  testBosyApp.put("contact_number", contactNumber);
                  testBosyApp.saveInBackground();
  
                  pd2.dismiss();
  
                  AlertDialog.Builder mDialoge = new AlertDialog.Builder(MainActivity.this); 
                  mDialoge.setTitle("2shta");
                  mDialoge.setMessage("Keda eldata ra7t t2riban");
                  mDialoge.setPositiveButton("cool", null);
                  mDialoge.show();
              }else{
                  pd2.dismiss();
                  AlertDialog.Builder mDialoge = new   AlertDialog.Builder(MainActivity.this); 
                  mDialoge.setTitle("Erorr");
                  mDialoge.setMessage("Check el net plz :)");
                  mDialoge.setPositiveButton("ok", null);
                  mDialoge.show();
              }
          }
  
          @Override
          public void done(ParseObject arg0, com.parse.ParseException arg1) {
              // TODO Auto-generated method stub
  
              }
      });
  
  }
  
   }
  </code></pre>
  
  <p>so what's the problem, progress-bar is loading without end and if I give progress-bar cancellation feature then put data in fields there's nothing happen .
  plus if anyone have tutorials for use android with parse.com please provide me with it. </p>