locked
How to upload data from a windows mobile device to a server using GPRS? RRS feed

  • Question

  • Hi All,

    I need to upload data from a pda (which is using Windows Mobile 6.1) to a application server using a GPRS connection.

    But I dont know anything about the procedure and steps involved in that.

    Please help me by giving suggestions and helpful links for this.

    This actually is for a java application.So l later need to use jni for accessing the method.

    Will that be possible?

    • Changed type Sheryl_23 Monday, September 6, 2010 6:47 AM
    • Edited by Sheryl_23 Wednesday, September 8, 2010 9:31 AM
    Monday, September 6, 2010 6:46 AM

Answers

All replies

  • Hi Sheryl,

    In this case you can use two different ways like WebService using Add Web Reference and another way is Using WebRequest and WebResponse. Here is already discussed thread for the same.

    Thread-1

     

    Hope it helps.

     


    If you find my post is helpful for you then mark as a answer.
    Monday, September 6, 2010 7:41 AM
  • Thanks for the response and links.....

    Since I actually need to use the facility from a java application,I find that it is better to use C++ than C#.

    Will you suggest any links or give me code samples in C++ that might be helpful ?

    I have seen this thread that uses the connection manager api to establish the gprs connection....

    If there are more of such links or codes ,it would be helpful.

    Let me know if there are any other method other than the connection maanager api which would be more suitable..

    If there is any application in the Windows Mobile SDK Sample kit,plz let me know about it....

    Thanks in advance

    Monday, September 6, 2010 11:28 AM
  • Since I actually need to use the facility from a java application,I find that it is better to use C++ than C#.


    If you are running Java on Windows Phone one of the problems you'll encounter is that Java isn't a Microsoft supported technology on Windows Mobile. So different Windows Mobile phones may have different levels of Java support (if at all). Using Microsoft intrinsic technologies teh connection manager is the way to establish a connection.
    Joel Ivory Johnson | http://www.j2i.net | Device Application Development MVP
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    Monday, September 6, 2010 12:28 PM
  • I tried this code in the device...But its not working,showing "Data call could not be established" message

    I tried it as such itself,eventhough its done using a Pocket PC 2003 SDK...

    What all could be the possible reasons for this failure?

    What are the different ways for testing the code in the device and emulator?

    I tested by connecting the device to PC by activesync.

    Also please tell me the significance of the code line :

    #if (WIN32_PLATFORM_PSPC>300 || WIN32_PLATFORM_WFSP )

     What are the terms WIN32_PLATFORM_PSPC and WIN32_PLATFORM_WFSP ?

    Wednesday, September 8, 2010 9:06 AM
  • Hi ,

    If you try to debug this code while connected to your device via ActiveSync, you will find that you cannot establish a connection. The Connection Manager already has an open connection (ActiveSync) and, therefore, does not allow another connection to be established.

    So I suggest you deploy the application to the device, then disconnect it from PC and run it on device without connecting to PC.

     

    If you still can't solve it, please let me know.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, September 8, 2010 9:44 AM
  • Yes,I tested it without being connected to PC,but still its not working .....
    Wednesday, September 8, 2010 9:54 AM
  • Hi sheryl_23,

    Please take a look at the thread:
    http://social.msdn.microsoft.com/forums/en-US/windowsmobiledev/thread/4be14c75-14e5-45d0-9542-bef48bd89b33/

    The sample works fine in my local.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Friday, September 10, 2010 4:48 AM
  • Hi sheryl_23,

    The sample works fine in my local. If you still can't solve it, please feel free to unmark it and let me know.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Monday, September 13, 2010 3:42 AM
  • The code works fine...but i used ConnMgrMapURL in place of ConnMgrMapConRef.

    Thanks Guang-Ming Bian for the help.

    I had given away the device to a friend,thats why it took so long to test.

    Another help I want to ask is that,since I dont have much knowledge in VC++ ,will you please

    help me in providing a code snippet for uploading data to a application server ?

    Thanks in advance.

     

    Friday, September 17, 2010 12:05 PM
  • I think Wininet functions will do the help..Isnt it?
    Thursday, September 23, 2010 6:37 AM
  • Hi,

    Yes, Wininet API can upload file to server.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Friday, September 24, 2010 10:09 AM
  • Will you please look at this thread ?

    http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesnative/thread/64662b4c-0b3a-4ada-8186-2158285a57c4

    I have given the code that I have been testing for file upload(using wininet api). I m getting response as 500. I think I m getting this INTERNAL SERVER ERROR because of something wrong I have given.

    Will you plz review the code and tell me where I m going wrong ? Have I given a wrong MIME content type in the HttpAddRequestHeaders function.My server is a JBOSS server and my need is to upload a .txt file. There is a java application in the adjacent machine whose IP I have given in the InternetConnect function and the path to the java page (that handles the upload action) in HttpOpenRequest function.  

    Monday, October 11, 2010 12:40 PM