我正在尝试使用 JavaME 阅读 SMS 收件箱。我尝试了 ApiBridge,重新搜索了 developer.nokia,并找到了一些示例。我尝试了示例,但我认为代码没有得到调用日志,只是循环。
感谢您的帮助。
这是我的示例代码。
APIBridge bridge = APIBridge.getInstance();
bridge.Initialize(this);
final LoggingService service = (LoggingService)bridge.createService("service.logging");
formum.append("Başlıyor\n");
Thread thread = new Thread() {
public void run() {
try {
BridgeResult res = service.GetList();
Vector returnValues = (Vector) res.getReturnValue();
String out = "Result: \n";
for (int i = 0; i < 2; i++) {
System.out.println("BridgeResult CallLog");
Hashtable item = (Hashtable) (returnValues.elementAt(i));
out += "PhoneNumber: " + item.get("PhoneNumber").toString() + "\n";
}
formum.append(out);
} catch (BridgeException ex) {
tbox.setString("Bridge error occured - unable to retrieve data. " + ex.getMessage());
} catch (Exception ex) {
tbox.setString("General error occured - unable to retrieve data. " + ex.getMessage());
}
}
};
thread.start();
示例代码在这里: http: //www.developer.nokia.com/Community/Wiki/J2ME_Api_Bridge_Interface