java在移动设备_本文我们首先介绍在移动设备上进行java开发的基本原理.doc

本文我们首先介绍在移动设备上进行java开发的基本原理.doc

9ecbecc28b95ac6b195354d5e454fe80.gif

还剩

16页未读,

继续阅读

下载文档到电脑,马上远离加班熬夜!

亲,很抱歉,此页已超出免费预览范围啦!

如果喜欢就下载吧,价低环保!

内容要点:

{ }// ignore showInfo("客户端输入:" + inputString + ",已成功响应!");} /*** 输出响应* @param outputData* @param conn */ private void sendOutputData (String outputData, StreamConnection conn) { try{ DataOutputStream }}/** * 从 StreamConnection 读取输入* @param conn * @return*/private String readInputString (StreamConnection conn) { String inputString = null;try {DataInputStream dis = conn.openDataInputStream();inputStprocessorThread = new Thread(this);processorThread.start();}public void run() { while (!isClosed){synchronized (this){ if (queue.size() == 0){ try { //阻塞,直到有新客户连接 wait();}catch (InterruptedException eisClosed = false; this.setString(null);new Thread(this).start();}public void cancelService(){ isClosed = true;showInfo("服务终止"); this.removeCommand(com_cancel); this.addCommand(com_pub);} /* * (non-Javif (!localDevice.setDiscoverable (DiscoveryAgent.GIAC)) {showInfo("无法设置设备发现模式 "); return;}// prepare a URL to create a notifier StringBuffer url = new StringBuffer("btspp://");// indicate this is a seimport javax.microedition.io.Connector;import javax.microedition.io.StreamConnection; import javax.microedition.io. StreamConnectionNotifier;import javax.microedition.lcdui.Command;import javax.microesynchronized (this) {notify(); } } /*** 回调方法*/public void servicesDiscovered (int transID, ServiceRecord[] servRecord){ for (int i = 0; i < servRecord.length; i++){ records.addElement(servRecord[i]); } catch (BluetoothStateException e) {continue; } }try { //阻塞,由 serviceSearchCompleted()回调方法在所有设备都搜索完的情况下唤醒 wait();}catch (InterruptedException e1) {e1.printStackTrace();}showInfo("服务搜索完毕, 共找到 "+record

发表评论

暂无评论,赶快抢占沙发吧。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值