Sending files from my PC (using the OS's bluetooth send app.) to my phone's J2ME app.
I have created an application that can send and receive files via OBEX. I have sent files to other mobile phones. And in the emulator, I have demonstrated my application's ability to receive files from a copy of the application which sends a file. I can also send files from my phone to my PC without problems.
However, even though I can receive files from another copy of my application in the emulator, when I try to send a file from my PC, using the standard bluetooth send utilities, to my application the application does not register the connection. My phone displays its standard receive file dialogue, completely missing out my application.
I cannot decide if it's a problem with my phone - I doubt it - or my server side code not registering itself properly, and hence why the phone deals with the incoming connection and not my application.
My server side code looks like this:
All I can think is that the UUID, which is set to OBEX, (see here: http://ants.dif.um.es/~felixgm/docen...ooth/UUID.html) is wrong somehow, or that I need some more UUIDs so the application picks up all incoming connections, but I know very little about this subject and my research has come to somewhat of a dead end.
this.localDevice = LocalDevice.getLocalDevice();
SessionNotifier sc =
(SessionNotifier) Connector.open("btgoep://localhost:" +
new UUID(0x1105).toString() + //i've tried 1106 here as well
ServiceRecord sr = localDevice.getRecord(sc);
Connection c = sc.acceptAndOpen(new Handler(this.callback));
Last edited by yesyes; 01-29-2009 at 12:56 AM.
From what I've read the client needs to know the server's UUID to connection.
However, when my computer sends files to my mobile phone normally - when i'm not using my application - I do not have to specify any UUIDs for my computer to connect to my mobile.
So there must be a way around this.
Okay, I've tried bpspp:// instead of btgoep:// as the server url and I still encounter the same problem.
I can only conclude that either I need to change the UUID in my application to an appropriate UUID so it picks up the connection from my computer, instead of my phone's operating system picking it up first;
Or there's no way to make my application pick up standard OBEX file transfers without my mobile phone's operating system picking them up first.
In the latter case I'll have to create my own client bluetooth application on my PC which connects to specially created UUIDs on my mobile phone i.e. i can't use the standard UUIDs for OBEX transfer.
Again, If anyone's got any ideas to help me use my PC's standard bluetooth sending mechanism to send files to my application, I'd more than welcome them.
please help me yesyes
Originally Posted by yesyes
your problem the same idea of my final project
please help me if you can and there no time
If you use the standard OBEX UUIDs to connect to your phone your phone's operating system will override the connection, leaving your J2ME application in the cold.
Originally Posted by hiba_asf
To get around this, the application on your PC and application on the phone must use a unique UUID, i.e. UUIDs that are not in the link I posted in the initial post.
I have found no way to over-ride a phone's internal applications, and what connections they can exclusively deal with. I hear Google's g1 phone allows you to over-ride its internal applications, but I have no experience there.
Last edited by yesyes; 04-18-2009 at 08:42 PM.
Hello, can you please contact me, i need your help on that aspect, because i am doing a similar porject. Cumps.
Edit by admin: no contact info permitted on the forum, thank you
please please help me!!!
hi dear,I want to send files from my phone to my PC with obex,so i have search so much for its code, but i could'nt find.please send me this code.
thanks a lot.
Forgive me if I am missing the point. Is there some reason to connect your phone through Bluetooth instead of just hardwiring it with a USB cable? Or could you just use a file sharing service to upload and download the files? I'm not sure what the Bluetooth connection is going to gain you.
By dogman in forum Mobile
Last Post: 08-31-2011, 08:21 AM
By anaisafranco in forum Mobile
Last Post: 01-22-2008, 02:10 PM
By forumname in forum Mobile
Last Post: 10-18-2007, 02:50 PM
By Rimvis in forum Enterprise
Last Post: 08-30-2002, 04:43 AM
By Rajesh in forum Mobile
Last Post: 11-18-2001, 04:40 AM
Tags for this Thread
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL