How to send data from J2ME phone to PC ?

B

Boki

Hi All,

When my J2ME phone got data, how can I send data through internet
(GPRS?) to PC ?

or by email is ok.

Thank you very much for your help!

Best regards,
Boki.
 
S

Simon Brooke

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" ) );
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top