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

📄 mmsform.java

📁 A MMS sender written in Java
💻 JAVA
字号:
/***************************************************************************** Description: this if a form used to add recipients to the mms Created By: Oscar Vivall 2005-12-14 @file        MMSForm.java COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2004. The software is the copyrighted work of Sony Ericsson Mobile Communications AB. The use of the software is subject to the terms of the end-user license  agreement which accompanies or is included with the software. The software is  provided "as is" and Sony Ericsson specifically disclaim any warranty or  condition whatsoever regarding merchantability or fitness for a specific  purpose, title or non-infringement. No warranty of any kind is made in  relation to the condition, suitability, availability, accuracy, reliability,  merchantability and/or non-infringement of the software provided herein. *****************************************************************************/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import java.io.*;public class MMSForm extends Form implements CommandListener{    private Command exitCommand;    private Command sendCommand;        private TextField toNr;    private TextField toMail;        private byte []data;        /*     * Parameter InputStream is the file to be appended to the MMS.     */    public MMSForm(InputStream is){        super("MMS Recipient");                try{            data = new byte[is.available()];            is.read(data);        }catch(Exception e){            e.printStackTrace();        }        exitCommand = new Command("Exit", Command.SCREEN, 1);        sendCommand = new Command("Send MMS", Command.SCREEN, 0);        setCommandListener(this);        addCommand(sendCommand);        addCommand(exitCommand);        toNr = new TextField("Phone Number:", "", 50, TextField.PHONENUMBER);        toMail = new TextField("Mail Address:", "", 50, TextField.EMAILADDR);        append(toNr);        append(toMail);    }    public void commandAction(Command command, Displayable displayable) {        if(command==exitCommand){            MMSSender.midlet.notifyDestroyed();        }else if(command==sendCommand){            MMS mms = new MMS(data);                        String to = toNr.getString();            if(to.compareTo("") != 0)                mms.addRecipient(to);                        to = toMail.getString();            if(to.compareTo("") != 0)                mms.addRecipient(to);                        mms.send();        }    }    }

⌨️ 快捷键说明

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