java 板


LINE

※ 引述《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
1F:推 PsMonkey:你已经触犯版规了... [茶] 07/13 10:25







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Soft_Job站内搜寻

TOP