Posting data using HTTP POST to a Servlet

by arun » Wed, 20 Jan 2010 02:06:33 GMT


Sponsored Links
 Hi,

I am trying to use the below to post my data to a servlet but seems
like not working.

 http://www.androidsnippets.org/snippets/36/ 

I am posting to a servlet in Tomcat in my local machine using host:
192.168.0.1:80

Basically I am posting the data to,

1. Save into database using servlet
2. Then I need to get that data back from DB using HTTPGET via another
Servlet.

Please help.

Thanks,
Arun



Other Threads

1. help please

Hello, I am a young student from cameroon.J like to be part of this
groupe.I am currently developing an application on android and I would
like your help because I have many problem.I want to receive the
coordinate GPS with android ( r on the emulator). First, I have not a
provide but I use the DDMS to generate coordinate.but I can not
receive GPS coordinates provided by the DDMS.This my code

package android.phonedial;

import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.location.LocationListener;
import android.location.LocationProvider;
import android.os.Bundle;
import android.widget.TextView;


public class TestProviderController extends Activity {

public  LocationManager locationManager;
public LocationListener locationlistener;
        @Override
        public void onCreate(Bundle tracabilite) {
        super.onCreate(tracabilite);
        setContentView(R.layout.main);

        String location_context = Context.LOCATION_SERVICE;
        locationManager = (LocationManager)getSystemService
(location_context);

        testProviders();

        }
        public void testProviders() {

                TextView tv = (TextView)findViewById(R.id.myTextView);
                StringBuilder sb = new StringBuilder("Enabled Providers:");
                List<String> providers = locationManager.getProviders(true);


                for (String provider : providers) {
                locationManager.requestLocationUpdates(provider, 1000, 0,
                new LocationListener() {
                public void onLocationChanged(Location location) {}
                public void onProviderDisabled(String provider){}
                public void onProviderEnabled(String provider){}
                public void onStatusChanged(String provider, int status,
                Bundle extras){}
                });

         sb.append("\n").append(provider).append(": ");

                Location location = 
locationManager.getLastKnownLocation(provider);



                        if      (location != null)
                        {
                 double lat = location.getLatitude();
                 double lng = location.getLongitude();
                sb.append(lat).append(", ").append(lng);
                } else {
                         sb.append("No Location");

                }
                }
                tv.setText(sb);
        }
}

thank for your help

--~--~---------~--~----~------------~-------~--~----~

2. We Pad

Baru aja di ANTEVE nonton berita, perusahaan asal Jerman Telefoni
meluncurkan "We Pad" sebagai persaingan Ipad.
Menggunakan OS Linux Android
Kelebihannya ada {*filter*} dan flash
Harga sedikit lebih mahal dari Ipad.

Itu sekilas info........

-- 
"Indonesian Android Community [id-android]" 

Join:  http://www.***.com/ 
Moderator: id.andr...@gmail.com
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

To unsubscribe, reply using "remove me" as the subject.

3. ListActivity and onListItemClick

4. Database insertion timings

5. How to create an asynchronous communication layer

6. Repeating AsyncTasks t

7. Merge Images with Transparency