×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    22

    Sending files from a phone to a computer

    Hello everyone,

    I'm doing an application that saves data in a file (the file is created on the phone at the start of the application)
    How can I send that file to a computer ? I was thinking of using OBEX, but I can't find suitable help online.

    Also thinking of sending the file via an usb link (when the phone is linked obviously). How can I detect, from a phone, when it is linked to a computer and choose the folder where the file will be saved.

    Any suggestion and help please ?
    Thank you for your help !

    David

  2. #2
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Thumbs up Re: Sending files from a phone to a computer

    Hi,

    I didn't understood your actual requirement. But may be these might help you....

    1) For sending the file from mobile to Computer via Bluetooth, either:
    a) Just push the file from device via Bluetooth programmatically. But in this case, the computer has to listen for that. It is possible only by a user action in computer at every time.
    b) Push the file from device via Bluetooth programmatically & also do a system level program for listening the data.

    2) For sending the file from mobile to Computer via USB, you've to create a mobile application for pushing the file to the USB & for receiving the file a system application has to listen for that.

    Which language are you expecting to do?

    What i explained above are just basics. Specify the language, then i'll help based on that....

    Regards
    Vineeth K

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    22

    Re: Sending files from a phone to a computer

    Thanks for the response vinuk4u

    I've done my application using j2me, so i'm programming in java (if that's what you are asking)

    by curiosity, the folder where i save the file matters or not ? in my program, i've set the destination folder as : "file:///root1/data.txt" of course, it is easy to create such file and folder on my computer. But what about on a phone ? Will the folder be created automatically ?
    I really don't know how this work when switching to a mobile phone.
    Thank you for your help !

    David

  4. #4
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Thumbs up Re: Sending files from a phone to a computer

    Ok. well done in J2ME. It would be very easy.

    using file:///root/file.txt will work only in emulator.

    For a device, it has to be either:
    1) file:///C:/file.txt --> Phone memory
    or
    2) file:///E:/file.txt --> Memory card

    if you want to save a photo/video/music file or those which are supported by the gallery, it's best to write to the gallery.

    Vineeth K.

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    22

    Re: Sending files from a phone to a computer

    Ok ! Thanks for the precision. But how can I find these files when saved on the phone memory. I am going to go with the simpler way : USB
    Where can these files be found on the phone afterwards ?

    And also, how can i get the root authorization to write these files on the phone memory ? I assume that he will be asking for them to authorize the application to write, read and create files on the C:/ directory
    Last edited by dave33; 2010-06-04 at 12:23. Reason: Another answer
    Thank you for your help !

    David

  6. #6
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Thumbs up Re: Sending files from a phone to a computer

    It's better to use file:///C:/DATA/file.txt It will be actual phone memory.

    Did i cleared your doubt?

    Any more help? Feel free to post....

    Regards
    Vineeth K.

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    22

    Re: Sending files from a phone to a computer

    Yes, most of them.

    I did tried what you advice me to do. I guess that using file:///c:/data/data.txt only works on a device and not with the emulator.

    I'm going to try and implement it on a phone. Do you know how things are suppose to be done when putting a MIDlet on phone ? Do i need to install it or those it works like j2se ? By going through the forum, I understand that I have to sign it, but I don't want to use those websites that where you have to pay. This is only an academic application for my undergraduate course so...

    And how can I avoid the security message check on a phone ? When I started using FileConnection, the app was always asking for authorization to write in a local file every time. How do you disable this message (or, at least, make it show up only once) It was pretty easy doing so with Netbeans, but what about the jar file ? And do I have to cange something in the manifest or jad file too ??
    Thank you for your help !

    David

  8. #8
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Thumbs up Re: Sending files from a phone to a computer

    For storing, i'll prefer that:

    try{
    //do for writing in file:///C:/DATA/file.txt
    }catch(Exception e){
    try{
    //do for writing in file:///E:/file.txt
    }catch(Exception e){
    try{
    //do for writing in file:///root/file.txt
    }catch(Exception e){
    System.out.println(e);
    }
    }
    }
    This will help you for device(in phone memory/memory card) as well for emulator.
    ie, it'll try for phone memory first, if failed, then it'll try for memory card. If it too fails, it'll try for root (in emulator). If all fails, error will caught on the console. Ok. There's no C: or E: drive in emulator, only root drive is present.

    For putting the MIDlet for this application, just put it into the device memory.
    Which device are you using? If S40 devices are used, then you just needed to copy the application on memory. If S60 devices are used, you have first put the file in memory and then install it, or just send to device via bluetooth and install it, or just push install to the device via USB using PC suite or OVI suite.

    What all classes or APIs are you using? For using FileConnection in device, you don't need to sign for testing. But the application will ask for "Read user data" & "Write user data" before writing to memory or reading from memory. It can be solved by signing, which is payable.

    I think you don't have to sign this, since it's an academic project.

    For any specific guidance, send me a private message!!!!

    Regards
    Vineeth K.

Similar Threads

  1. OMA DRM media transfer using PC to Phone using USB
    By venky123 in forum Digital Rights Management & Content Downloading
    Replies: 1
    Last Post: 2008-08-13, 03:02
  2. Sending ringtone from computer to phone
    By Supps in forum Smart Messaging
    Replies: 2
    Last Post: 2004-04-26, 09:42
  3. sending data from computer to midlet
    By Strunker in forum Mobile Java General
    Replies: 4
    Last Post: 2003-08-26, 00:27
  4. Sending Ringtones to a 3320 phone trough the IrDA Port
    By djromero in forum General Messaging
    Replies: 1
    Last Post: 2002-11-21, 09:32

Posting Permissions

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