Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

How to send data from J2ME phone to PC ?

Thread view: 
Boki - 25 Nov 2006 15:20 GMT
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.
Simon Brooke - 25 Nov 2006 18:20 GMT
> 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" ) );

Signature

simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

   ;; Semper in faecibus sumus, sole profundum variat.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.