You Are Here:

Community: Developer Discussion Boards

#1 Old Post J2ME App - 2009-01-17, 11:45

Join Date: Jan 2009
Posts: 3
vrushalijadhav
Offline
Registered User
Hi,

I am developing application in J2ME to send files mobile to mobile(via BlueTooth)
What, I want to do is, to send a file(.jpg,.gif,or any type) which is stored in the resource folder of the
application, for that I have use following code to read file from res folder

inputStream=getClass.getResourceAsStream("/abc.gif");

and using OutputStream to write data,no errror in the program ,but when file write is completed it does not show any file on the device where we are writing file.

Please give any suggesion .
Reply With Quote

#2 Old Re: J2ME App - 2009-01-18, 11:39

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
If I understood correctly, you want to store data with the MIDlet. For that you need to use eiher RMS or file system. You cannot write files in the resource folders of the MIDlet. You can only read them

Hartti
Reply With Quote

#3 Old Thumbs up Re: J2ME App - 2009-01-19, 05:29

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
Quote:
Originally Posted by vrushalijadhav View Post
Hi,

I am developing application in J2ME to send files mobile to mobile(via BlueTooth)
What, I want to do is, to send a file(.jpg,.gif,or any type) which is stored in the resource folder of the
application, for that I have use following code to read file from res folder

inputStream=getClass.getResourceAsStream("/abc.gif");

and using OutputStream to write data,no errror in the program ,but when file write is completed it does not show any file on the device where we are writing file.

Please give any suggesion .
Hi,
where you want to write this file,where you are looking for the file after writing.


Thanks

R a j - The K e r n e l
Reply With Quote

#4 Old 2009-01-22, 21:59

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
vrushalijadhav, first of all which UUID do you use for creating the connection (searchServices » getConnectionURL). You should use 0x1105L (OBEX-Push, OPP) for this. OBEX-Push means you have to talk the OBEX protocol, that means you have to open a OBEX connection and then do an OBEX-Put. For more information, please have a look at the javax.obex package.

By the way if you are new to J2ME, MIDlets and Bluetooth, I recommend to start with a book or tutorials rather than code examples as you will have to debug a lot on your own. There are a lot of bugs, tweaks and lessons to be learnt. Bluetooth is complicated. I do not have a good J2ME book at hand right now, however, start with the references of this one for JSR-82 (perhaps your library has its previous edition) or read at least the PDF coming with the specification. If you like to start with tutorials, continue here…
Reply With Quote

#5 Old Re: J2ME App - 2009-02-09, 13:31

Join Date: Jan 2009
Posts: 3
vrushalijadhav
Offline
Registered User
Quote:
Originally Posted by raj_J2ME View Post
Hi,
where you want to write this file,where you are looking for the file after writing.
I have 'connection obj' which is created using bluetooth address of RemoteDevice,on that connection I am writing this file .
I am using two devices to check my output,i.e one device with abc as Friendly name and one with pqr. When I search for devices from device pqr,it is able to find abc,making connection with abc and writing data on abc,so after writing I am looking on my file on device abc.

r u got my question?

Thanx.
Reply With Quote

#6 Old Re: J2ME App - 2009-02-09, 13:45

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
So:

You have your Java application running on Device A. And Device B, with no Java application. Your application sends a file from Device A to Device B. Device B prompts the user "Device A wants to send somefile. Accept?" and the user selects "yes". File transfer appears to complete. But you cannot find the received file on Device B?

There are two possibilities:

1. Your application is not using the correct method. Check out the information that traud has suggested in his reply.

2. You are looking in the wrong place on Device B. Try sending a file using the Device A's own software (for example, selecting a photo and choosing "Send by bluetooth"). See where Device B stores that file.

Also: when you send from A to B (without using your application), check the prompts you see on Device B. If, when you use your application, you see different prompts, then you are probably using the wrong method of sending the file.

Cheers,
Graham.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we call a j2me app from Native C++ app inguvaseshu General Symbian C++ 3 2009-01-13 17:42
Changing App Mgr settings from J2ME app ddbhasin Mobile Java General 6 2007-09-21 08:18
Can we call a j2me app from Native C++ app inguvaseshu Mobile Java General 1 2006-06-16 16:59
J2ME app works fine in the emu but not on the Communicator schneidc80 Mobile Java General 7 2005-12-26 16:16
question about running j2me app on Nokia 9500 liaoyw Mobile Java General 0 2004-11-22 20:48

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia