Blackberry version "hello world", which use a socket to send msg to a server
来源:互联网 发布:手机解锁软件大全 编辑:程序博客网 时间:2024/05/18 01:18
// HelloWorldScreen.java
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
public class HelloWorldScreen extends MainScreen {
public HelloWorldScreen() {
add(new LabelField("Hello World"));
}
}
// helloworld.java
import java.io.OutputStreamWriter;import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import net.rim.device.api.ui.UiApplication;
public class helloworld extends UiApplication {
public helloworld() {
HelloWorldScreen screen = new HelloWorldScreen();
pushScreen(screen);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
helloworld app = new helloworld();
try
{
// Socket开始
final String URL = "socket://58.250.173.37:8018;deviceside=true";
StreamConnection conn = null;
conn = (StreamConnection)Connector.open(URL);
OutputStreamWriter _out = new OutputStreamWriter(conn.openOutputStream());
String data = "loveXJR";
int length = data.length();
_out.write(data, 0, length);
_out.close();
conn.close();
// Socket结束
}
catch(Exception e)
{
}
app.enterEventDispatcher();
}
}
- Blackberry version "hello world", which use a socket to send msg to a server
- Blackberry version "hello world", which use a socket to send msg to a server
- To find a job on hello world~
- A SIMPLE WAY TO USE SELECT (socket)
- How to use World Wind to give a presentation
- use AT command to send a sms in linux system
- Send a remind to someone ;
- send files to a ftp server in PERL
- How to send a list of files over a socket in Java
- A Guide to use SSL
- Use autorelease to Send a Deferred release---使用autorelease发送一个延期释放的消息
- How to migrate a SQL Server database to a lower version
- A Client to Send SMTP Mail
- How to use netlink socket to communicate with a kernel module?*********************8
- 【1】Use Jeb API to Write Script:Hello World
- How to find which version of SQL Server is running?
- How To Create A Socket Based iPhone App and Server
- CHECKLIST TO USE BEFORE SUBMITTING A PAPER TO A JOURNAL
- Android G2手机如何使用CMWAP上网
- Android Function: public static boolean isCmwap(Context context)
- A First Look at the Android Testing Framework
- Android 文件操作 读/写
- Android取用户屏幕大小
- Blackberry version "hello world", which use a socket to send msg to a server
- Compiler CC and gcc under Unix are able to link each
- Dropbox, Amazing!
- Dream - Plan - Action
- Goal for 2010
- GPRS、WAP、WAP网关、HTTP、cmwap,、cmnet
- How to Make an Activity Fullscreen
- Huawei President Ren Zhengfei: Letter to New Employee (part 1) 任正非:致新员工书 (第1部分)
- Judge a pepole from details