Boki said:
Hi All,
When my J2ME phone got data, how can I send data through internet
(GPRS?) to PC ?
Easiest way is in the URL of an http request - like this (I'm logging
fisheries catch data back to the server):
protected boolean sendQueueable( Queueable q )
throws IOException
{
boolean result = false;
if ( q != null )
{
HttpConnection hc = null;
InputStream in = null;
StringBuffer url = q.getURL( new StringBuffer( ) );
hc = (HttpConnection) Connector.open( url.toString( ) );
in = hc.openInputStream( );
int response = hc.getResponseCode( );
switch ( response )
{
case HttpConnection.HTTP_OK:
showMessage( MESSAGETYPECONFIRM, q.parseResult( in ) );
result = true;
break;
case HttpConnection.HTTP_UNAUTHORIZED:
showMessage( AbstractFieldKit.MESSAGETYPEERROR,
getConfig( "FieldKitMidlet-MessageBadAuth" ) );