Re: [J2ME] 用手機抓取GPS接收器資料

看板java作者 (肉元)時間19年前 (2006/07/13 01:59), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串6/7 (看更多)
※ 引述《PsMonkey (痞子軍團團長)》之銘言: : ==站內信件== : ※ 引述《Gsus (肉元)》之銘言: : : 好像不是耶... : : 你這個我沒看過 : 這位... 恩... 始作俑者... : 那你要不要把你的開發環境講清楚一點 : 單純 po 這篇(還轉出站外) : 實在沒意義也沒任何幫助 嗯...開發環境... J2ME對我而言頗陌生 開發環境.. 我是用wireless toolkit 對於藍芽傳輸 不太了解,我是看著書上的一些介紹+網站上的教學 應該說幾乎都是網站上的教學啦 因為國內好像還沒有J2ME的書裡面提到藍芽範例程式的 連線方式似乎是RFCOMM, 我目前只知道要跟藍芽裝置連線至少要有以下一些東西 LocalDevice, DiscoveryAgent, RemoteDevice, ServiceRecord 而其中我最需要的URL必須要先取得ServiceRecord, 接著call ServiceRecord[i].getConnectionURL(); ServiceRecord要怎麼取得...我看了教學網站的說明如下: LocalDevice localdevice = LocalDevice.getLocalDevice(); DiscoveryAgent discoveryagent = localdevice.getDiscoveryAgent(); There are multiple ways to discover remote Bluetooth devices, but I'll discuss one particular method. First,"your object must implement the DiscoveryListener interface." This interface works like any listener, so it'll notify you when an event occurs. In this case, you'll be notified when Bluetooth devices are in the area. To start the discovery process, "call the startInquiry() method on your DiscoveryAgent". This method is nonblocking, so you're free to do other things while you wait for other Bluetooth devices to be found. When a Bluetooth device is found, the JVM calls the deviceDiscovered() method of the class that implemented the DiscoveryListener interface. This method passes you a RemoteDevice object that represents the device discovered by the inquiry. 上文中""部份是我有疑問的: 1.我不懂什麼是DiscoveryListener...是我要implements然後覆蓋一些abstract method之類的嗎??如果是話,DiscoveryListener 的 abstract method內容 要寫些什麼呢?? 2.startInquiry經過查詢,我知道是DiscoveryAgent的method,但是卻回傳整數, 但上文中所說的似乎是最後要得到一個RemoteDevice的物件,這也是我的問題之一 Service discovery is just like device discovery - you use the DiscoveryAgent to do the "discovering." The searchServices() method of the DiscoveryAgent class allows you to search for services on a RemoteDevice. When services are found, the servicesDiscovered() method will be called by the JVM if your object implemented the DiscoveryListener interface. This callback method also passes in a ServiceRecord object that pertains to the service you searched for. With a ServiceRecord in hand, you can do plenty of things, but you would most likely want to connect to the RemoteDevice where this ServiceRecord originated: String connectionURL = servRecord[i].getConnectionURL(0,false); 看完這段我一有些疑惑了~"~ 因為searchServices()似乎是回傳布林值,而非ServiceRecod,另外有一點就是, 這邊似乎沒用到上一段所取得的RemoteDevice,那我得RemoteDevice將來是要拿來 怎麼用呢? 對於藍芽傳輸不是非常了解,我翻了一些原文書像是"Begining J2ME", 但是提到的不多,對於抓取URL更不用提...國內的書我還沒看到有任何講解 藍芽傳輸方面的(沒看到啦,至少我翻過王森寫的、微型爪哇人、兩三本J2ME 手機遊戲開發的書,都找不到....> <) 所以來此發問希望獲得幫忙 若有違反版規或是說明不清楚之處,煩請多多包含^^" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.106.130

07/13 10:25, , 1F
你已經觸犯版規了... [茶]
07/13 10:25, 1F
文章代碼(AID): #14jJXaMB (java)
文章代碼(AID): #14jJXaMB (java)