| Reply | « Previous Thread | Next Thread » |
|
Dear all,
i am working on bluetooth file transfer in J2ME. but the problem which i am facing , i downloaded one code from Sun website for Image Exchange, via bluetooth,but that code is developed in NETBEANS Mobility Pack 5.0 , so i have got couple of queries regarding that. 1) i tried to compile that code in NetBeans Mobility IDE 5.0 but when compile that code i received error, org.netbeans.microedition.util.*; Does not exist. let me show a little part of that code: ___________________________________________________________ import javax.microedition.lcdui.*; import javax.bluetooth.*; import javax.obex.*; import org.netbeans.microedition.util.*; public class ImageSender extends MIDlet implements CommandListener { /** Creates a new instance of ImageSender */ public ImageSender() { } // in article talk about jsr 82 and 75 // also talk about running the system prperties to know more about // their implementation. Perhaps that needs to be a separate screen // or Midlet private Command exitCommand;//GEN-BEGIN:MVDFields private Command backCommand1; private Command okCommand1; private Image folder_closed; private Image folder_open; private org.netbeans.microedition.lcdui.TableItem tableItem1; private Image image1; private Image splashimage; private Image splash200; . . . . . private String btConnectionURL = null; // this is for debugging String info = null; //GEN-LINE:MVDMethods /** This method initializes UI of the application.//GEN-BEGIN:MVDInitBegin */ private void initialize() {//GEN-END:MVDInitBegin // Insert pre-init code here getDisplay().setCurrent(get_homeForm());//GEN-LINE:MVDInitInit // Insert post-init code here }//GEN-LINE:MVDInitEnd ___________________________________________________________ 2) if i want to run the code which we develop in Netbeans Mobility IDE 5.0, is it posible we can compile and run that code in Wireless toolkit 2.5. 3) What is the MVD file? Thanks in Advance Kami |
| atiqkamran |
| View Public Profile |
| Find all posts by atiqkamran |
|
Hi,
There is an article on the wiki which might help http://wiki.forum.nokia.com/index.ph...EX%29_protocol Good Luck Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
|
|
i am try to run FTClient, but always appears this error :
Device discovered 0016b8a3aa25 Name : Hòòd_@ Device discovered 00188d6cd79c Name : Kùm€ñg Phöñê Device discovered 8156de0631f0 Name : LANGLANG Inquiry completed ... Now searching for services ........ Service search completed ........... Opening a connection with the server .... Exception in thread "Thread-1" java.lang.NullPointerException at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:61) at javax.microedition.io.Connector.open(Connector.java:79) at phone.FTClient.serviceSearchCompleted(FTClient.java:69) at com.intel.bluetooth.BluetoothPeer$SearchServicesThread.run(BluetoothPeer.java:94) why this error??? |
|
Can you send me code or part of code so i can better tell you.
BR, kami |
| atiqkamran |
| View Public Profile |
| Find all posts by atiqkamran |
|
i just use standart FTCient :
[quote] /*original imports */ package phone; import java.io.*; import javax.microedition.io.*; import javax.bluetooth.*; import javax.bluetooth.UUID; /* add the de.aventna obex */ import de.avetana.javax.obex.ClientSession; import de.avetana.javax.obex.HeaderSet; import de.avetana.javax.obex.Operation; public class FTClient implements DiscoveryListener { LocalDevice local = null; DiscoveryAgent agent = null; int[] attrSet = null; RemoteDevice btDev = null; String serviceURL = null; ClientSession con = null; HeaderSet hdr = null; public FTClient() throws BluetoothStateException{ // initialize the stack, if needed local = LocalDevice.getLocalDevice(); agent = local.getDiscoveryAgent(); agent.startInquiry(DiscoveryAgent.GIAC, this); } public void deviceDiscovered(RemoteDevice btDevice,DeviceClass cod){ btDev = btDevice; System.out.println("Device discovered " + btDevice.getBluetoothAddress()); } public void servicesDiscovered(int transID, ServiceRecord[] servRecord){ System.out.println("Discovered a service ...."); for(int i =0; i < servRecord.length; i++){ serviceURL = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, true); System.out.println("The service URL is " + serviceURL); } } public void serviceSearchCompleted(int transID, int respCode){ System.out.println("Service search completed ........... "); System.out.println("Opening a connection with the server ...."); try{ con = (ClientSession)Connector.open(serviceURL); hdr = con.connect(hdr); System.out.println("Response code of the server after connect..." + hdr.getResponseCode()); //Sending a request to server for file Hello.txt hdr = con.createHeaderSet(); hdr.setHeader(HeaderSet.TYPE,"text/vCard"); hdr.setHeader(HeaderSet.NAME,"Hello.txt"); Operation op = con.get(hdr); //The server is now sending the file InputStream in = op.openInputStream(); // Writing the file from server to local file system. StreamConnection filestream = (StreamConnection)Connector.open("file://name=HelloFile.txt;mode=w"); OutputStream out = filestream.openOutputStream(); //read and write the data int data = in.read(); while(data != -1){ out.write((byte)data); data = in.read(); } // send the DISCONNECT Operation //con.disconnect(); // cleanup op.close(); in.close(); out.close(); } catch(IOException e){ System.out.println(e.getMessage()); } } public void inquiryCompleted(int discType){ System.out.println("Inquiry completed ... "); UUID[] uuids = new UUID[1]; uuids[0] = new UUID("1106",true); try{ if(btDev == null){ System.out.println("No device has been discovered, " + "hence not worth proceeding exiting .... "); System.exit(1); } System.out.println("Now searching for services ........ "); agent.searchServices(attrSet, uuids, btDev, this); } catch(BluetoothStateException e) {System.out.println(e.getMessage());} } public static void main(String args[]) throws IOException { FTClient client = new FTClient(); } } |
|
Quote:
[/quote] |
|
hello Frendz, can you give the Library of
org.netbeans.microedition.util when i compilling my Program that import org.netbeans.microedition.util.*; always make a error package org.netbeans.microedition.util does not exist plz email me at sherwin_corpuz01@yahoo.com.ph the Library.. thnx in Advance |
| winzter143 |
| View Public Profile |
| Find all posts by winzter143 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| help me on file transfer - pc to phone over bluetooth. | kiran10182 | Bluetooth Technology | 2 | 2009-09-05 11:07 |
| Can not send any Obex Objects to a billionton bluetooth | hoy_cpe | Symbian Networking & Messaging | 3 | 2006-08-01 08:28 |
| problems with bluetooth file transfer to 6230? - here's the solution! | spyghost | Bluetooth Technology | 1 | 2005-01-04 18:16 |
| 6230 global problems with Bluetooth | asterixmlm | General Discussion | 1 | 2004-12-10 18:12 |
| Transfering image to series 40 device problem | andk | General Symbian C++ | 3 | 2004-04-20 08:40 |