title: Unable to run android app from real device
body: <p>I am new to Android Development. Trying to run my first program from ADT to real device. But I am getting below error..</p>
  
  <pre><code>ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.sendsmstest/.MainActivity }  
  </code></pre>
  
  <p>In my Nexus 4 also, I am getting small popup that "Unfortunately myapp has stopped." </p>
  
  <p>Below is my AndroidMenifest.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.sendsmstest"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="19" /&gt;
  
   &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.sendsmstest.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;      
  
   &lt;/manifest&gt;
  </code></pre>
  
  <p>Below is MainActivity.java code.</p>
  
  <pre><code>package com.example.sendsmstest;
  
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.app.ActionBar;
  import android.support.v4.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.os.Build;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.net.Uri;
  import android.os.Bundle;
  import android.telephony.SmsManager;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Toast;
  
   public class MainActivity extends Activity {
  
  private EditText phoneNumber;
  private EditText smsBody;
  private Button smsManagerBtn;
  private Button smsSendToBtn;
  private Button smsViewBtn;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      phoneNumber = (EditText) findViewById(R.id.editNumber);
      smsBody = (EditText) findViewById(R.id.editSMSBody);
      smsManagerBtn = (Button) findViewById(R.id.buttonSend);
  
  
      smsManagerBtn.setOnClickListener(new OnClickListener() {
           public void onClick(View view) {
               sendSmsByManager();
           }
      });
  
      smsSendToBtn.setOnClickListener(new OnClickListener() {
           public void onClick(View view) {
               sendSmsBySIntent();
           }
      });
  
      smsViewBtn.setOnClickListener(new OnClickListener() {
           public void onClick(View view) {
               sendSmsByVIntent();
           }
      });
  
  }
  
  public void sendSmsByManager() {
      try {
          // Get the default instance of the SmsManager
          SmsManager smsManager = SmsManager.getDefault();
          smsManager.sendTextMessage(phoneNumber.getText().toString(), 
                  null,  
                  smsBody.getText().toString(), 
                  null, 
                  null);
          Toast.makeText(getApplicationContext(), "Your sms has successfully sent!",
                  Toast.LENGTH_LONG).show();
      } catch (Exception ex) {
          Toast.makeText(getApplicationContext(),"Your sms has failed...",
                  Toast.LENGTH_LONG).show();
          ex.printStackTrace();
      }
  }
  
  public void sendSmsBySIntent() {
      // add the phone number in the data
      Uri uri = Uri.parse("smsto:" + phoneNumber.getText().toString());
  
      Intent smsSIntent = new Intent(Intent.ACTION_SENDTO, uri);
      // add the message at the sms_body extra field
      smsSIntent.putExtra("sms_body", smsBody.getText().toString());
      try{
          startActivity(smsSIntent);
      } catch (Exception ex) {
          Toast.makeText(MainActivity.this, "Your sms has failed...",
                  Toast.LENGTH_LONG).show();
          ex.printStackTrace();
      }
  }
  
  public void sendSmsByVIntent() {
  
      Intent smsVIntent = new Intent(Intent.ACTION_VIEW);
      // prompts only sms-mms clients
      smsVIntent.setType("vnd.android-dir/mms-sms");
  
      // extra fields for number and message respectively
      smsVIntent.putExtra("address", phoneNumber.getText().toString());
      smsVIntent.putExtra("sms_body", smsBody.getText().toString());
      try{
          startActivity(smsVIntent);
      } catch (Exception ex) {
          Toast.makeText(MainActivity.this, "Your sms has failed...",
                  Toast.LENGTH_LONG).show();
          ex.printStackTrace();
      }
  
  }
  }
  </code></pre>
  
  <p>Also in my logcat, its showing this..</p>
  
  <pre><code>04-15 04:04:41.670: I/Process(1153): Sending signal. PID: 1153 SIG: 9
  </code></pre>