title: Getting Error Message in Error Logcat and app not responding
body: <p>Hi I am  new with <code>Android</code> I am just creating my first <code>Android</code> app and getting a lot of problems. </p>
  
  <p>I get some error messages in my <code>Logcat</code> and my app does not respond. Given below are my <code>Manifest</code>, <code>MainActivity</code> and <code>Logcat</code> details . </p>
  
  <p>Please help me out.</p>
  
  <p>Manifest File:</p>
  
  <p>
  </p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="18" /&gt;
  
  &lt;uses-permission  android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission  android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&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.bijaru.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;activity
          android:name="com.example.bijaru.SettingsActivity"
          android:label="@string/title_activity_settings" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.bijaru.LoggedinActivity"
          android:label="@string/title_activity_loggedin" &gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>Main Activity File:-</p>
  
  <pre><code>package com.example.bijaru;
  
  
      //importing of files
      public class MainActivity extends Activity {
  
      Button login;
      EditText username,password;
      TextView status;
      HttpPost httppost;
      StringBuffer stringbuffer;
      HttpResponse response;
      HttpClient client;
      List&lt;NameValuePair&gt; namevaluepair;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          addListenerOnButton();
      }
  
  
      private void addListenerOnButton() {
          // TODO Auto-generated method stub
  
          username=(EditText)findViewById(R.id.username);
          password=(EditText)findViewById(R.id.password);
          status=(TextView)findViewById(R.id.status);
  
  
  
          //final Context context = this;
  
          login = (Button) findViewById(R.id.login);
  
          login.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
  
                  switch (arg0.getId()){
                  case R.id.login:
                  login();
                  break;
                  }
  
                //  Intent intent = new Intent(context, LoggedinActivity.class);
                         //     startActivity(intent);   
              }
  
              private void login() {
                  // TODO Auto-generated method stub
                  try{
  
                      client = new DefaultHttpClient();
                      httppost=new HttpPost("http://127.0.0.1/bijaru/check.php");
                      namevaluepair = new ArrayList&lt;NameValuePair&gt;(1);
                      namevaluepair.add(new BasicNameValuePair("username", username.getText().toString().trim()));
                      namevaluepair.add(new BasicNameValuePair("password", password.getText().toString().trim()));
                      httppost.setEntity(new UrlEncodedFormEntity(namevaluepair));
  
                      response=client.execute(httppost);
  
                      ResponseHandler&lt;String&gt; responsehandler =new BasicResponseHandler();
                      final String response=client.execute(httppost,responsehandler);
  
                      status.setText(""+response);
  
                      if(response.equalsIgnoreCase("sucess"))
                      {
  
                          startActivity(new Intent(MainActivity.this,LoggedinActivity.class));
                      }
  
                  }
                  catch(Exception e)
                  {
                      e.printStackTrace();
  
                  }
  
              }
  
          });
  
  
      }
  
  
      @Override
        public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
       }
  
       }
  </code></pre>
  
  <p>Error Log Cat:-</p>
  
  <pre><code>    08-07 07:09:36.341: E/cutils-trace(887): Error opening trace file: No such file or directory (2)
  08-07 07:09:44.411: E/SoundPool(287): error loading /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.411: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.421: E/SoundPool(287): error loading /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.421: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.431: E/SoundPool(287): error loading /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.431: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.431: E/SoundPool(287): error loading /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.441: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.451: E/SoundPool(287): error loading /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.451: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
  08-07 07:09:44.461: W/System.err(853): android.os.NetworkOnMainThreadException
  08-07 07:09:44.471: E/SoundPool(287): error loading /system/media/audio/ui/KeypressStandard.ogg
  08-07 07:09:44.471: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
  08-07 07:09:44.471: E/SoundPool(287): error loading /system/media/audio/ui/KeypressSpacebar.ogg
  08-07 07:09:44.481: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
  08-07 07:09:44.491: E/SoundPool(287): error loading /system/media/audio/ui/KeypressDelete.ogg
  08-07 07:09:44.491: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
  08-07 07:09:44.501: W/System.err(853):  at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1133)
  08-07 07:09:44.501: W/System.err(853):  at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84)
  08-07 07:09:44.501: W/System.err(853):  at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
  08-07 07:09:44.501: W/System.err(853):  at libcore.io.IoBridge.connect(IoBridge.java:112)
  08-07 07:09:44.501: W/System.err(853):  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
  08-07 07:09:44.511: E/SoundPool(287): error loading /system/media/audio/ui/KeypressReturn.ogg
  08-07 07:09:44.511: W/AudioService(287): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
  08-07 07:09:44.521: W/AudioService(287): onLoadSoundEffects(), Error -1 while loading samples
  08-07 07:09:44.521: W/System.err(853):  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
  08-07 07:09:44.521: W/System.err(853):  at java.net.Socket.connect(Socket.java:842)
  08-07 07:09:44.521: W/System.err(853):  at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
  08-07 07:09:44.531: W/System.err(853):  at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
  08-07 07:09:44.531: W/System.err(853):  at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
  08-07 07:09:44.541: W/System.err(853):  at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
  08-07 07:09:44.541: W/System.err(853):  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
  08-07 07:09:44.541: W/System.err(853):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
  08-07 07:09:44.541: W/System.err(853):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
  08-07 07:09:44.551: W/System.err(853):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
  08-07 07:09:44.551: W/System.err(853):  at com.example.bijaru.MainActivity$1.login(MainActivity.java:87)
  08-07 07:09:44.551: W/System.err(853):  at com.example.bijaru.MainActivity$1.onClick(MainActivity.java:68)
  08-07 07:09:44.551: W/System.err(853):  at android.view.View.performClick(View.java:4240)
  08-07 07:09:44.561: W/System.err(853):  at android.view.View$PerformClick.run(View.java:17721)
  08-07 07:09:44.561: W/System.err(853):  at android.os.Handler.handleCallback(Handler.java:730)
  08-07 07:09:44.561: W/System.err(853):  at android.os.Handler.dispatchMessage(Handler.java:92)
  08-07 07:09:44.571: W/System.err(853):  at android.os.Looper.loop(Looper.java:137)
  08-07 07:09:44.571: W/System.err(853):  at android.app.ActivityThread.main(ActivityThread.java:5103)
  08-07 07:09:44.581: W/System.err(853):  at java.lang.reflect.Method.invokeNative(Native Method)
  08-07 07:09:44.581: W/System.err(853):  at java.lang.reflect.Method.invoke(Method.java:525)
  08-07 07:09:44.581: W/System.err(853):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
  08-07 07:09:44.581: W/System.err(853):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  08-07 07:09:44.581: W/System.err(853):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>PHP Code:-</p>
  
  <pre><code> &lt;?php
    define("HOST", "localhost");
     // The host you want to connect to.
       define("USER", "admin");
    // The database username.
    define("PASSWORD", "admin");
    // The database password.
    define("DATABASE", "bijaru");
    // The database name.
  
    // Create connection
     $con = mysqli_connect(HOST, USER, PASSWORD, DATABASE);
  
    // Check connection
    if (mysqli_connect_errno($con)) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
     }
  
    if (isset($_POST['login'])) {
    $username = $_POST['username'];
    $password = $_POST['password'];
  
      $str="SELECT * FROM users WHERE username='{$username}' and password='{$password}'";
    if ($result = mysqli_query($con, $str)) {
      // Return the number of rows in result set
      $rowcount = mysqli_num_rows($result);
  if($rowcount !=0)
  {
   echo "sucess";
  }
  else
  {
  echo "login failed";
  }
  }
  
  else
  {
  echo "query fail";
  }
   }
     ?&gt;
    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;form method="post"&gt;
          Name:
          &lt;input type="text" name="username"&gt;
          Password:
          &lt;input type="password" name="password"&gt;
          &lt;input type="submit" name="login"&gt;
      &lt;/form&gt;
  
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>