⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readsms.txt.bak

📁 记录缓存记录缓存记录缓存记录缓存记录缓存记录缓存
💻 BAK
字号:
import java.io.*;

import javax.microedition.io.*;

import javax.wireless.messaging.*;

MessageConnection conn = null;

String url = "sms://:5678"; // no phone number!

try {

conn = (MessageConnection) Connector.open( url );

while( true ){
JAVA手机网[www.cnjm.net]
Message msg = conn.receive(); // blocks

if( msg instanceof BinaryMessage ){

JAVA手机网[www.cnjm.net]byte[] data =

((BinaryMessage) msg).getPayloadData();

// do something here

} else {

String text =

((TextMessage) msg).getPayloadText();

// do something here

}}

}

catch( Exception e ){

// handle it

}

finally {if( conn != null ){

try { conn.close(); } catch( Exception e ){}

}

JAVA手机网[www.cnjm.net]}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -