📄 mimesend.java
字号:
/*///////////////////////////////////////////////////////////////////////////////
//MIMESMSnotifyPushRegistry文档生成日期:2005.11.3
//
//(1)概述:
//类名称:MIMESend
//类说明:
// 提供主界面
//所在子系统:MIMESMSnotifyPushRegistry
//
//系统总描述:
本工程发送一个MIME头的短信给目标手机。MIME头中指明了对方应该如何处理。
对方手机收到后,触发注册了PushRegistry的MIDlet应用,并解析短信,
按照指明的命令操作。
子系统描述:
发送一个MIME头的短信给目标手机.
//(2)历史记录:
//创建人: 郑昀(2005.11.3)
//联系我: Google Talk >> zhengyun@gmail.com
//Blogs: http://blog.csdn.net/zhengyun_ustc/以及http://www.cnblogs.com/zhengyun_ustc
//(3)版权声明:
//我这个版本的MIMESMSnotifyPushRegistry,
//j2me客户端代码仅仅允许您借鉴,但不得用于商业用途,除非得到郑昀本人的授权。本人保留所有权利。
////////////////////////////////////////////////////////////////////*/
package com.ultrapower.midlet;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import com.ultrapower.control.GUIController;
/**********************************************************
//MIMESend
//
//Class Description:
// 实际上应该算作MVC中的View部分,是MIDlet的主界面。
//Author:
// zhengyun@ultrapower 2005.11.3
//
**********************************************************/
public class MIMESend extends MIDlet {
private Display display;
private static GUIController controller;
/**
* default constructor
*/
public MIMESend() {
super();
display = Display.getDisplay(this);
}
/* (non-Javadoc)
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp()
throws MIDletStateChangeException{
controller = new GUIController(this);
try
{
controller.init();//初始化RMS,Menu,Forms
}
catch(Exception exc)
{
setCurrent(
new Alert(
"初始化错误",
"错误原因为:"
+ exc.getMessage() + "/" + exc.getClass(),
null, AlertType.ERROR));
}
}
/* (non-Javadoc)
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
this.notifyPaused();
}
/* (non-Javadoc)
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
controller = null;
}
/**********************************************************
// MIMESend::setCurrent()
//
// Description:
// 设置当前显示的界面
//
// Parameters:
// Return Values:
// Author:
// zhengyun@ultrapower 2005.11.3
//
**********************************************************/
public void setCurrent(Displayable disp){
display.setCurrent(disp);
}
public void setCurrent(Alert alert, Displayable disp){
display.setCurrent(alert, disp);
}
public Displayable getCurrent(){
return display.getCurrent();
}
/**********************************************************
// MIMESend::getCurrentDisplay()
//
// Description:
// 获取当前的Display,这样可以让其他类能够控制要显示什么
//
// Parameters:
// Return Values:
// Author:
// zhengyun@ultrapower 2005.11.3
//
**********************************************************/
public Display getCurrentDisplay(){
return display;
}
public void exit(boolean arg0){
try{
destroyApp(arg0);
notifyDestroyed();
}catch(MIDletStateChangeException e){
//
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -