eventloguploadui.java
来自「一个基于PlaceLab的室内和室外的智能导航系统」· Java 代码 · 共 49 行
JAVA
49 行
package org.placelab.midp;import java.io.DataInputStream;import java.io.DataOutputStream;import javax.microedition.lcdui.Display;import javax.microedition.rms.RecordEnumeration;import org.placelab.midp.server.BluetoothService;public class EventLogUploadUI extends BluetoothClient { public EventLogUploadUI(Display display, UIComponent from) { super(display, from); } public String getName() { return "Event Log Uploader"; } public byte getServiceType() { return BluetoothService.ACTIVITY_UPLOAD_SERVICE; } public void handleConnection(DataInputStream in, DataOutputStream out) { setStatus("Connected to Event Log Downloader."); try { RecordEnumeration en = EventLogger.getRecords(null, null, false); updateStatus("Uploading " + en.numRecords() + " records...");// out.writeUTF(UberStore.getUserName());// out.writeUTF(UberStore.getUserNumber()); out.writeInt(en.numRecords()); while (en.hasNextElement()) { out.writeUTF(new String(en.nextRecord())); } out.flush(); out.close(); // updateStatus("Deleting records...");// deleteAll(); } catch (Exception e) { updateStatus("Error: " + e); } updateStatus("Finished Uploading."); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?