I am a php developer.

Now I learning android.

I want to connect php and android.

I tried many sample codes from internet.

All getting same problem.

"Unfortunately MainActivity has stoped" This is the problem.

Just example: When I submitting login form coming the error message.

All is well, but not connecting to php.

I am going to MAD!

Any extra settings needed in WAMP server?

If you have time, please teach me step by step coding of android in eclipse.
 (Just like file->new->android application project........)That level of teaching.

please teach me a simple login page in android php mysql.

One sample code added below, please tell me problem:

```
 package com.example.listactivity;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ListActivity;
import android.net.ParseException;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class MainActivity extends ListActivity {
private List nameValuePairs;
private JSONArray jArray;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    String result = null;
    InputStream is = null;
    StringBuilder sb=null;

    //http post
    try{
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("http://localhost/food/food.php");
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        HttpResponse response = httpclient.execute(httppost);
        HttpEntity entity = response.getEntity();
        is = entity.getContent();
    }catch(Exception e){
        Log.e("log_tag", "Error in http connection"+e.toString());
    }

    //convert response to string
    try{
        BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
        sb = new StringBuilder();
        sb.append(reader.readLine() + "\n");
        String line="0";

        while ((line = reader.readLine()) != null) {
            sb.append(line + "\n");
        }

        is.close();
        result=sb.toString();

    }catch(Exception e){
        Log.e("log_tag", "Error converting result "+e.toString());
    }

    //paring data
    int fd_id;
    String fd_name;
    try{
    jArray = new JSONArray(result);
    JSONObject json_data=null;

    for(int i=0;i<jArray.length();i++){
            json_data = jArray.getJSONObject(i);
            fd_id=json_data.getInt("FOOD_ID");
            fd_name=json_data.getString("FOOD_NAME");
    }

    }catch(JSONException e1){
        Toast.makeText(getBaseContext(), "No Food Found", Toast.LENGTH_LONG).show();
    }catch (ParseException e1){
        e1.printStackTrace();
    }
}
}

```

Php code:

```
<?php
  mysql_connect("localhost","root","");
  mysql_select_db("FOOD");
  $sql=mysql_query("select * from FOOD");
  while($row=mysql_fetch_assoc($sql)) $output[]=$row;
  print(json_encode($output));
  mysql_close();
?>

```

Looking your help.