×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Lightbulb J2ME project problem - Please give some advice

    Hi, everyone

    We have been doing a j2me project, it is about creating a j2me program to upload images or other files to a PC on the internet using Vodafone GPRS. In the pc side, we also need to create a server side application to receive that files.

    We have been researching a lot on the internet and most of the j2me examples are about downloading stuff from the internet to the mobiles. Does anyone know some useful java references or information about uploading files from the mobile phone to the internet by using Vodafone GPRS?

    Thanks a lot!
    To be or Not to be, it is not just a question

  2. #2
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Unhappy Re: J2ME project problem - Please give some advice

    Sorry, am I making my question too complicated to understand?
    It is basically uploading files like images/video etc in the mobile phone (I am using Nokia6230i, Series40 mobile) to a PC on the internet via GPRS.

    Since the gateway of the local GPRS provider does not seem to support other ports other than 80, so I think I just can use Http connection.

    I have found quite a lot examples but they are all about downloading stuff from the internet to their mobile. The only example about uploading PNG image to server using Servlet is not what I want, I prefer creating a small web server application which can be easily installed in a PC.

    Thanks again!
    To be or Not to be, it is not just a question

  3. #3
    Registered User
    Join Date
    May 2005
    Posts
    76

    Re: J2ME project problem - Please give some advice

    I'm not sure I understand this well, but eg. javadoc for HttpConnection has an example of POSTing, which is what I believe you are after. And it is up to you whether you do the server-side with servlets or something else....

    Regards,
    h.

  4. #4
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: J2ME project problem - Please give some advice

    hi Schrodinger,

    http://discussion.forum.nokia.com/fo...ad.php?t=85416
    just "upload" byte stream to servlet passing also extension/file name,
    your serlvet should simply write received bytes into local file with correct extension (note that sample source files for linked book simply send bytes arrays),
    Your devices will have to support JSR-FileConnection API - otherwise end user won't be able to select anything from device. Instead of sending runtime created byte array simply open file for READ and read bytes which need to be sent to servlet,
    Also note that JSR-75 FileConnection API gives access to limited resources on device,
    all that is explained in docs relating JSR-75,
    all resources upon JSR-75 FileConnection topic on Gopal's blog entry:
    http://blogs.forum.nokia.com/view_entry.html?id=131

    hth,
    regards,
    Peter

  5. #5
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: J2ME project problem - Please give some advice

    to post file using midlet use http connection you can very easily open up a connection in read write mode open connection outputstream write all the data you want to post on output stream and then flush that stream out. this will post your data to the URL you will provide while openiing http connection

    for file connection api. even if your mobile supports file connection API you still might not access the files you want. untill u get the Midlets signed. this can only be done by the phone manufacturer as i had this problem on nokia 6680.

    hope this helps.

  6. #6
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Thumbs up Re: J2ME project problem - Please give some advice

    Thanks peterblazejewicz and nicenouman for your useful info.

    To peterblazejewicz:

    We am not going to use Servlet because it requires Tomcat on the client PC.
    Actually, we are thinking about creating server side program which can act like a http server and the user just needs to install it on his/her machine, then he/she can upload the images/video etc on the mobile phone to their PC via GPRS.

    How hard would be to create a http server to handle the uploading files?

    By the way, we are testing the program on Nokia6230i model, which supports FileConnection, GPRS etc.

    Thanks

    Schrodinger
    To be or Not to be, it is not just a question

  7. #7
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: J2ME project problem - Please give some advice

    hi,

    I guess that's not hard to write client-side application which will works as "http server" using socket libraries, etc,
    however I cannot se a reason why you wouldn't use some already "tested in real-life" solutions, it could be Tomcat or any other web server,
    Say like with flickr:
    - setup web server
    - build entry web page for destkop users
    - provide client-side mobile device application
    done,
    no additional software required - users can use alreayd available browsers if they want,
    there are increasing number of such solutions based on web 2 services and conencted devices:
    e.g.:
    http://meaning.3xi.org/

    hth,
    regards,
    peter

  8. #8
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Re: J2ME project problem - Please give some advice

    Thanks Peter.

    It is quite helpful.
    To be or Not to be, it is not just a question

  9. #9
    Registered User
    Join Date
    Jan 2009
    Posts
    5

    How to create Servlet application using Tomcat server

    i created one client server web application in which Servlet application using tomcat server and J2ME application on mobile which works very well on localhost by emulator but not working in real time.
    i think,problem must be in servlet application
    please help me to create servlet application which can be accessible from internet.

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: J2ME project problem - Please give some advice

    Hi,

    You will get better response to your question if you create a new thread, rather than tagging your question onto the end of an old issue.

    I suggest you create a new thread, and tell us a bit more about the problem. For example:

    What is not working? You get errors? What messages?

    How are you accessing your servlet? Can you access your servlet from another internet connected device, such as a MIDP emulator running on another computer on a different network?

    Cheers,
    Graham.

Similar Threads

  1. problem in a j2me program on Nokia 6630/6680
    By lappard in forum Mobile Java General
    Replies: 1
    Last Post: 2006-06-29, 01:43
  2. Obfuscator problem for J2ME polish
    By rudyanto in forum Mobile Java General
    Replies: 0
    Last Post: 2006-05-29, 14:06
  3. Creating a project with Nokia Developer's Suite for J2ME
    By gertsp in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2002-09-25, 03:08
  4. problem running j2me application on Nokia Emulator 60 series
    By chancp in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2002-07-03, 02:59
  5. problem running j2me application on Nokia Emulator 60 series
    By chancp in forum Mobile Java General
    Replies: 0
    Last Post: 2002-07-03, 02:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •