黑莓报警Integeration [英] BlackBerry Alarm Integeration

查看:116
本文介绍了黑莓报警Integeration的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的应用程序code。我想报警,这apllication是否正在运行与否对我的黑莓手机响本月每6。请指导我在细节我是一个初学者。

 导入net.rim.device.api.ui。*;
导入net.rim.device.api.ui.component。*;
导入net.rim.device.api.ui.container *。
net.rim.device.api.system数据导入*。
导入net.rim.device.api.util *。进口的java.util。*;进口java.lang.String中*。
公共类ListChk扩展的UIApplication
{
    字符串的getFirstName;
    串getLastName;
    串getEmail;
    串getGender;
    的getStatus串;
    串getCompany;    / *声明文本字段用户输入* /
    私人AutoTextEditField的firstName;    私人AutoTextEditField lastName的;
    私人AutoTextEditField公司;    私人EmailAddressEditField电子邮件;    / *声明选择字段用户输入* /    私人ObjectChoiceField性别;    / *声明复选框栏供用户输入* /
    私人CheckBoxField字段的状态;    //声明按钮领域
    私人ButtonField字段保存;
    关闭私人ButtonField字段;
    私人ButtonField字段列表;
    私人ButtonField字段搜索;    / *声明向量* /
    私有静态矢量_data;    / *声明持久化对象* /
    私有静态持久性对象存储;    / *创建一个切入点* /
    公共静态无效的主要(字串[] args)    {
        ListChk objListChk =新ListChk();
        objListChk.enterEventDispatcher();    主要ListChk的} //结束    公共ListChk()
    {        / *创建主屏幕类​​的一个目的是利用其功能* /
        MainScreen mainScreen =新MainScreen();        //主屏设置标题
        mainScreen.setTitle(新的LabelField(请输入您的数据));        //创建用户输入文本字段
        的firstName =新AutoTextEditField(名:,);
        lastName的=新AutoTextEditField(姓,);
        电子邮件=新EmailAddressEditField(电子邮件::,);
        公司=新AutoTextEditField(简称本公司,);        //创建用户输入的选择领域
        的String []项目= {男,女};
        性别=新ObjectChoiceField(性别,项目);        //创建复选框栏
        状态=新CheckBoxField字段(激活,真正的);        //创建按钮字段,添加使用监听功能        //一个按钮被点击时,它的持久保存用户数据
        保存=新ButtonField字段(保存,ButtonField.CONSUME_CLICK);
        save.setChangeListener(新FieldChangeListener()
        {
            公共无效fieldChanged(场场,诠释上下文)
            {
                保存();            }
        });        //一个按钮,点击它时关闭整个应用程序
        关闭=新ButtonField字段(关闭,ButtonField.CONSUME_CLICK);
        close.setChangeListener(新FieldChangeListener()
        {
            公共无效fieldChanged(场场,诠释上下文)
            {
                的OnClose();
            }
        });        //显示所有数据列表中选择一个按钮被永久保存
        名单=新ButtonField字段(列表,ButtonField.CONSUME_CLICK);
        List.setChangeListener(新FieldChangeListener()
        {
            公共无效fieldChanged(场场,诠释上下文){
                //推下一个画面                pushScreen(新ListScreen());            }
        });        搜索=新ButtonField字段(搜索,ButtonField.CONSUME_CLICK);
        sea​​rch.setChangeListener(新FieldChangeListener()
        {
            公共无效fieldChanged(场场,诠释上下文)
            {
                pushScreen(新SearchScreen());
            }
        });
        //添加输入字段到主屏幕
        mainScreen.add(名字);
        mainScreen.add(lastName的);
        mainScreen.add(电子邮件);
        mainScreen.add(公司);
        mainScreen.add(性别);
        mainScreen.add(状态);        // Addning水平场经理
        Horizo​​ntalFieldManager水平=新Horizo​​ntalFieldManager(Horizo​​ntalFieldManager.FIELD_HCENTER);        //添加按钮在水平场管理器中的主屏幕        horizo​​ntal.add(接近);
        horizo​​ntal.add(保存);
        horizo​​ntal.add(列表);
        horizo​​ntal.add(搜索);        //添加水平场食槽到屏幕
        mainScreen.add(水平);        //添加菜单项        mainScreen.addMenuItem(saveItem);
        mainScreen.addMenuItem(的getItem);
        mainScreen.addMenuItem(Deleteall);        //主推屏
        pushScreen(mainScreen);
    }
    私人菜单项Deleteall =新菜单项(全部删除,110,10)
    {
        公共无效的run()
        {
            INT响应= Dialog.ask(Dialog.D_YES_NO,有U确保ü要删除整个数据库);
            如果(Dialog.YES ==响应){
            PersistentStore.destroyPersistentObject(0xdec6a67096f833cL);
            Dialog.alert(关闭应用程序);
            的OnClose();
            }
            其他
                Dialog.inform(感谢上帝);
        }
    };
//添加功能的菜单项saveItem
私人菜单项saveItem =新菜单项(保存,110,10)
{        公共无效的run()
        {
            //调用保存方法
            保存();
        }
};
//添加功能的菜单项saveItem
私人菜单项的getItem =新菜单项(GET,110,11)
{
    //正在运行的线程此菜单项
    公共无效的run()
    {
            //线程同步
            同步(存储)
            {
                //获取持久化对象的内容                _data =(向量)store.getContents();
                尝试{                    对于(INT I = _data.size() - 1;我-1个;我 - )
                    {                        StoreInfo信息=(StoreInfo)_data.elementAt(I)
                        //空对象检查
                        如果(!_data.isEmpty())
                        {
                        //如果不为空
                        //创建存储信息类的新对象
                        在字符串中检索//存储信息
                        的getFirstName =(info.getElement(StoreInfo.NAME));
                        getLastName =(info.getElement(StoreInfo.LastNAME));
                        getEmail =(info.getElement(StoreInfo.EMail));
                        getGender =(info.getElement(StoreInfo.GenDer));
                        的getStatus =(info.getElement(StoreInfo.setStatus));
                        getCompany =(info.getElement(StoreInfo.setCompany));
                            //调用show方法
                        显示();
                        }                    }
                }
                赶上(例外五){}
            }
        }
};
公共无效保存()
{    //创建内部类StoreInfo的对象
    StoreInfo信息=新StoreInfo();
    //获取在输入字段中输入的测试
    info.setElement(StoreInfo.NAME,firstName.getText());
    info.setElement(StoreInfo.LastNAME,lastName.getText());
    info.setElement(StoreInfo.EMail,email.getText());
    info.setElement(StoreInfo.setCompany,company.getText());
    info.setElement(StoreInfo.GenDer,gender.toString());
    如果(status.getChecked())
        info.setElement(StoreInfo.setStatus,活动);
    其他
        info.setElement(StoreInfo.setStatus,在活动);
    //添加对象向量的端
    _data.addElement(信息);
    //同步线程
    同步(存储)
    {        store.setContents(_data);
        store.commit();    }
    //复位输入字段    Dialog.inform(成功!);
    firstName.setText(NULL);
    lastName.setText(NULL);
    email.setText();
    company.setText(NULL);
    gender.setSelectedIndex(男);
    status.setChecked(真);
}
//编码持久化存储
静态的 {店内=
PersistentStore.getPersistentObject(0xdec6a67096f833cL);
同步(存储){
如果(store.getContents()== NULL){
store.setContents(新向量());
store.commit();
}
}
_data =新的向量();
_data =(向量)store.getContents();}
//类新的存储信息实现持久化
私有静态final类StoreInfo实现持久化
{
    //声明变量
    私人矢量_elements;
    公共静态最终诠释NAME = 0;
    公共静态最终诠释姓氏= 1;
    公共静态最终诠释的EMail = 2;
    公共静态最终诠释性别= 3;
    公共静态最终诠释setStatus = 4;
    公共静态最终诠释setCompany = 5;
    公共StoreInfo()
    {
        _elements =新的向量(6);
        的for(int i = 0; I< _elements.capacity(); ++ I)
        {
            _elements.addElement(新的String());
        }
    }    公共字符串getElement(INT ID)
    {
        返回(字符串)_elements.elementAt(ID);
    }
    公共无效setElement(INT ID,字符串值)
    {
        _elements.setElementAt(值,ID);
    }
}
//为展示方法的详细信息
公共无效显示()
{
    Dialog.alert(名称为+的getFirstName ++ getLastName +\\ nGender是+ getGender +\\ NE-邮件:+ getEmail +\\ n状态是的g​​etStatus +);
}
公共无效列表()
{    Dialog.alert(哈哈);
}//创建保存方法//重写的OnClose方法公共布尔的OnClose()
{
    System.exit(0);
    返回true;
} 类ListScreen扩展MainScreen
{
     串getUserFirstName;
     串getUserLastName;
     串getUserEmail;
     串getUserGender;
     串getUserStatus;
     串getUserCompany;
     的String []使用setData;
     字符串的getData =新的String();
     串collectData =;
     ObjectListField fldList;
     INT计数器= 0;    私人ButtonField字段btnBack;    公共ListScreen()
    {        的setTitle(新的LabelField(显示数据,LabelField.NON_FOCUSABLE));
        // =的getData myList中();
        //Dialog.alert(getData);    //使用setData =拆分(的getData,$);
    //的for(int i = 0; I< setData.length;我++)
    // {
    //添加(新RichTextField(使用setData [I] +@@@@@));
    //}
        showList();
        btnBack =新ButtonField字段(返回,ButtonField.CONSUME_CLICK | ButtonField.FIELD_HCENTER);
        btnBack.setChangeListener(新FieldChangeListener()
        {
            公共无效fieldChanged(场场,诠释上下文)
            {
                。UiApplication.getUiApplication()popScreen(getScreen());
            }
        });        加(btnBack);    }
    公共无效showList()
    {
        Horizo​​ntalFieldManager hfManager =新HorizontalFieldManager(HorizontalFieldManager.HORIZONTAL_SCROLLBAR|HorizontalFieldManager.HORIZONTAL_SCROLL);
        // SeparatorField spManager =新SeparatorField();
        lblcheck的LabelField =新的LabelField(检查,LabelField.NON_FOCUSABLE);
        的getData = myList中();
        使用setData =拆分(的getData,$);
        fldList =新ObjectListField(ObjectListField.MULTI_SELECT);
        fldList.set(使用setData);
        //fldList.setEmptyString(\"heloo,12);
        //hfManager.add(lblcheck);        hfManager.add(fldList);
        //hfManager.add(spManager);
        加(hfManager);
        addMenuItem(新菜单项(选择,100,1){
            公共无效的run(){
                INT的selectedIndex = fldList.getSelectedIndex();
                字符串项=(字符串)fldList.get(fldList,的selectedIndex);
               pushScreen(新ShowDataScreen(项目));
            }
            });    }    公众的String []分裂(字符串inString,字符串分隔符){
        的String [] retAr;
        尝试{
            向量VEC =新的向量();
            INT索引A = 0;
            INT indexB = inString.indexOf(分隔符);            而(indexB!= -1){
                vec.addElement(新的String(inString.substring(索引A,indexB)));
                索引A = indexB + delimeter.length();
                indexB = inString.indexOf(分隔符,索引A);
            }
            vec.addElement(新的String(inString.substring(索引A,inString
                    。长度())));
            retAr =新的String [vec.size()];
            的for(int i = 0; I< vec.size();我++){
                retAr [I] = vec.elementAt(ⅰ)的ToString();
            }
        }赶上(例外五){
            的String [] = AR {e.toString()};
            返回AR;
        }
        返回retAr;
    } //分割法结束    公共字符串myList中()
    {
        _data =(向量)store.getContents();
        尝试
        {
            对于(INT I = _data.size() - 1;我-1个;我 - ,反++)
                {                    StoreInfo信息=(StoreInfo)_data.elementAt(I)
                    //空对象检查
                    如果(!_data.isEmpty())
                        {
                            //如果不为空
                            //创建存储信息类的新对象
                            在字符串中检索//存储信息
                            // StoreInfo信息=(StoreInfo)_data.lastElement();
                            getUserFirstName =(info.getElement(StoreInfo.NAME));
                            getUserLastName =(info.getElement(StoreInfo.LastNAME));
                            // getUserEmail =(info.getElement(StoreInfo.EMail));
                            // getUserGender =(info.getElement(StoreInfo.GenDer));
                            // getUserStatus =(info.getElement(StoreInfo.setStatus));
                            getUserCompany =(info.getElement(StoreInfo.setCompany));
        collectData = collectData + getUserFirstName ++ getUserLastName ++ getUserCompany +$;
                    }
                }
        }
            赶上(例外五){}
    返回collectData;    } // myList中的方法结束    公共布尔的OnClose()
    {
        System.exit(0);
        返回true;
    }} //类ListScreen结束 类ShowDataScreen扩展MainScreen
 {
     字符串的getFirstName;
     串getLastName;
     串getCompany;
     串getEmail;
     串getGender;
     的getStatus串;
     的String []的getData;
     公共ShowDataScreen(字符串数据)
     {
        的getData =拆分(数据,);
        的getFirstName =的getData [0];
        getLastName =的getData [1];
        getCompany =的getData [2];
        _data =(向量)store.getContents();
        尝试
        {
            对于(INT I = _data.size() - 1;我-1个;我 - )
            {
                StoreInfo信息=(StoreInfo)_data.elementAt(I)
                如果(!_data.isEmpty())
                {
                    如果((getFirstName.equalsIgnoreCase(info.getElement(StoreInfo.NAME)))及及(getLastName.equalsIgnoreCase(info.getElement(StoreInfo.LastNAME)))及及(getCompany.equalsIgnoreCase(info.getElement(StoreInfo .setCompany))))
                    {
                        getEmail = info.getElement(StoreInfo.EMail);
                        getGender = info.getElement(StoreInfo.GenDer);
                        =的getStatus info.getElement(StoreInfo.setStatus);                        Horizo​​ntalFieldManager hfManager =新Horizo​​ntalFieldManager(Horizo​​ntalFieldManager.NON_FOCUSABLE);                        AutoTextEditField名=新AutoTextEditField(姓名:,的getFirstName ++ getLastName);
                        AutoTextEditField电子邮件=新AutoTextEditField(电子邮件:getEmail);
                        AutoTextEditField公司=新AutoTextEditField(简称本公司,getCompany);
                        AutoTextEditField性别=新AutoTextEditField(性别,getGender);
                        AutoTextEditField状态=新AutoTextEditField(状态:,的getStatus);
                        加(名);
                        加(电子邮件);
                        加(公司);
                        添加(性别);
                        添加(状态);                    }
                }            } // for循环结束
        } //尝试结束
        赶上(例外五){}        //Dialog.alert(\"fname是+的getFirstName +\\ nlastname =+ getLastName +公司+ getCompany);
     }
     公众的String []分裂(字符串inString,字符串分隔符){
            的String [] retAr;
            尝试{
                向量VEC =新的向量();
                INT索引A = 0;
                INT indexB = inString.indexOf(分隔符);                而(indexB!= -1){
                    vec.addElement(新的String(inString.substring(索引A,indexB)));
                    索引A = indexB + delimeter.length();
                    indexB = inString.indexOf(分隔符,索引A);
                }
                vec.addElement(新的String(inString.substring(索引A,inString
                        。长度())));
                retAr =新的String [vec.size()];
                的for(int i = 0; I< vec.size();我++){
                    retAr [I] = vec.elementAt(ⅰ)的ToString();
                }
            }赶上(例外五){
                的String [] = AR {e.toString()};
                返回AR;
            }
            返回retAr;
        } //分割法结束
 }
 类SearchScreen扩展MainScreen
 {
     私人ButtonField字段btnFirstName;
     私人ButtonField字段btnLastName;
     私人ButtonField字段btnSearch;
     私人ButtonField字段btnEmail;
     私人SeparatorField SP;
     用户名字符串;
     Horizo​​ntalFieldManager HR =新Horizo​​ntalFieldManager();    公共AutoTextEditField searchField;     公共SearchScreen()
     {
         SP =新SeparatorField();
         的setTitle(新的LabelField(搜索选项));
         添加(新RichTextField(通过搜索:));         btnFirstName =新ButtonField字段(名,ButtonField.CONSUME_CLICK);
         hr.add(btnFirstName);         btnFirstName.setChangeListener(新FieldChangeListener()
                 {
                    公共无效fieldChanged(场场,诠释上下文)
                    {
                        // Horizo​​ntalFieldManager小时=新Horizo​​ntalFieldManager();
                        sea​​rchField =新AutoTextEditField(名,阿里);
                        加(searchField);
                        btnSearch =新ButtonField字段(搜索,ButtonField.CONSUME_CLICK);
                        btnSearch.setChangeListener(新FieldChangeListener()
                        {
                            公共无效fieldChanged(场场,诠释上下文)
                            {
                                //Dialog.alert(searchField.getText());
                                pushScreen(新FirstnameScreen(searchField.getText()));
                                // FirstnameScreen的obj =新FirstnameScreen();
                                //obj.name= searchField.getText();                            }
                        });
                        加(btnSearch);
                        //hrs.add(sp);
                    }
                 });
         btnLastName =新ButtonField字段(姓,ButtonField.CONSUME_CLICK);
         hr.add(btnLastName);
         btnLastName.setChangeListener(新FieldChangeListener()
         {
             公共无效fieldChanged(场场,诠释语境)
             {
                 sea​​rchField =新AutoTextEditField(姓,);
                    加(searchField);
                    btnSearch =新ButtonField字段(搜索,ButtonField.CONSUME_CLICK);
                    btnSearch.setChangeListener(新FieldChangeListener()
                    {
                        公共无效fieldChanged(场场,诠释上下文)
                        {
                            //Dialog.alert(searchField.getText());
                            pushScreen(新LastnameScreen(searchField.getText()));
                            // FirstnameScreen的obj =新FirstnameScreen();
                            //obj.name= searchField.getText();                        }
                    });
                    加(btnSearch);             }
         });
         btnEmail =新ButtonField字段(电子邮件,ButtonField.CONSUME_CLICK);
         hr.add(btnEmail);
         btnEmail.setChangeListener(新FieldChangeListener()
         {
             公共无效fieldChanged(场场,诠释语境)
             {
                 sea​​rchField =新AutoTextEditField(电子邮件,);
                    加(searchField);
                    btnSearch =新ButtonField字段(搜索,ButtonField.CONSUME_CLICK);
                    btnSearch.setChangeListener(新FieldChangeListener()
                    {
                        公共无效fieldChanged(场场,诠释上下文)
                        {
                            //Dialog.alert(searchField.getText());
                            pushScreen(新EmailScreen(searchField.getText()));
                            // FirstnameScreen的obj =新FirstnameScreen();
                            //obj.name= searchField.getText();                        }
                    });
                    加(btnSearch);
             }
         });
         加(小时);     }
     无效myShow()
     {
         Dialog.alert(searchField.getText());
     }
 } 类FirstnameScreen扩展MainScreen
 {
     用户名字符串;
     私人经理MGRID;
     串firstUserName;
     串lastUserName;
     串USEREMAIL;
     串userGender;
     串userStatus;
     ButtonField字段btnBack;
     字体字库;
     公共FirstnameScreen(字符串名称)
     {
         的setTitle(新的LabelField(搜索结果));
         加(+名新RichTextField(搜索结果));
         的userName =名称;
         sea​​rchFirstName();
         btnBack =新ButtonField字段(返回,ButtonField.CONSUME_CLICK);
         btnBack.setChangeListener(新FieldChangeListener()
         {
             公共无效fieldChanged(场场,诠释上下文)
             {
                 。UiApplication.getUiApplication()popScreen(getScreen());
             }
         });
         加(btnBack);
     }
     公共无效searchFirstName()
     {         ButtonField字段btnDelete;
            如果(空= MGRID和放大器;!&安培;!NULL = mGrid.getManager())
                。mGrid.getManager()删除(MGRID);
        INT列表ColWidth = net.rim.device.api.system.Display.getWidth()/ 4;
        MGRID =新GridFieldManager(新INT [] {0,列表ColWidth,列表ColWidth,
                        列表ColWidth,列表ColWidth},VERTICAL_SCROLL | VERTICAL_SCROLLBAR);
        mGrid.add(新NullField(可调焦));
        mGrid.add(新的LabelField(姓名));
        mGrid.add(新的LabelField(电子邮件));
        mGrid.add(新的LabelField(性别));
        mGrid.add(新的LabelField(激活));
        //mGrid.add(new ButtonField字段(删除));        // SeparatorField SPS =新SeparatorField();
        //mGrid.add(sps);
        加(MGRID);
        _data =(向量)store.getContents();
        尝试{                对(INT I = _data.size() - 1;我-1个;我 - ){                        StoreInfo信息=(StoreInfo)_data.elementAt(I)
                        //空对象检查
                        如果(!_data.isEmpty()){                            firstUserName =(info.getElement(StoreInfo.NAME));
                            如果(firstUserName.equalsIgnoreCase(用户名))
                            {
                                //如果不为空
                                //创建存储信息类的新对象                                在字符串中检索//存储的信息                                lastUserName =(info.getElement(StoreInfo.LastNAME));
                                USEREMAIL =(info.getElement(StoreInfo.EMail));
                                userGender =(info.getElement(StoreInfo.GenDer));
                                userStatus =(info.getElement(StoreInfo.setStatus));
                                最终诠释SN = I;                                //调用listAll方法
                                mGrid.add(新NullField(可调焦));
                                mGrid.add(新的LabelField(firstUserName +
                                                + lastUserName));
                                mGrid.add(新的LabelField(USEREMAIL));
                                mGrid.add(新的LabelField(userGender));
                                mGrid.add(新的LabelField(userStatus));
                                btnDelete =新ButtonField字段(删除,ButtonField.CONSUME_CLICK);
                                btnDelete.setChangeListener(新FieldChangeListener()
                                {
                                    公共无效fieldChanged(场场,诠释上下文)
                                    {
                                        _data.removeElementAt(SN);
                                    }
                                });
                                加(btnDelete);                               // SeparatorField SPS1 =新SeparatorField();
                                //mGrid.add(sps1);
                            }
                        }                }
        }赶上(例外五){
        }
     }
 }
 类LastnameScreen扩展MainScreen
 {     用户名字符串;
     私人经理MGRID;
     串firstUserName;
     串lastUserName;
     串USEREMAIL;
     串userGender;
     串userStatus;
     ButtonField字段btnBack;
     字体字库;
     公共LastnameScreen(字符串名称)
     {
         的setTitle(新的LabelField(搜索结果));         加(+名新RichTextField(搜索结果));
         的userName =名称;
         sea​​rchLastName();
         btnBack =新ButtonField字段(返回,ButtonField.CONSUME_CLICK);
         btnBack.setChangeListener(新FieldChangeListener()
         {
             公共无效fieldChanged(场场,诠释上下文)
             {
                 。UiApplication.getUiApplication()popScreen(getScreen());
             }
         });
         加(btnBack);
     }     公共无效searchLastName()
     {         ButtonField字段btnDelete;
            如果(空= MGRID和放大器;!&安培;!NULL = mGrid.getManager())
                。mGrid.getManager()删除(MGRID);
        INT列表ColWidth = net.rim.device.api.system.Display.getWidth()/ 4;
        MGRID =新GridFieldManager(新INT [] {0,列表ColWidth,列表ColWidth,
                        列表ColWidth,列表ColWidth},VERTICAL_SCROLL | VERTICAL_SCROLLBAR);
        mGrid.add(新NullField(可调焦));
        mGrid.add(新的LabelField(姓名));
        mGrid.add(新的LabelField(电子邮件));
        mGrid.add(新的LabelField(性别));
        mGrid.add(新的LabelField(激活));
        //mGrid.add(new ButtonField字段(删除));        // SeparatorField SPS =新SeparatorField();
        //mGrid.add(sps);
        加(MGRID);
        _data =(向量)store.getContents();
        尝试{                对(INT I = _data.size() - 1;我-1个;我 - ){                        StoreInfo信息=(StoreInfo)_data.elementAt(I)
                        //空对象检查
                        如果(!_data.isEmpty()){                               lastUserName =(info.getElement(StoreInfo.LastNAME));
                            如果(lastUserName.equalsIgnoreCase(用户名))
                            {
                                //如果不为空
                                //创建存储信息类的新对象                                在字符串中检索//存储的信息
                                firstUserName =(info.getElement(StoreInfo.NAME));                                USEREMAIL =(info.getElement(StoreInfo.EMail));
                                userGender =(info.getElement(StoreInfo.GenDer));
                                userStatus =(info.getElement(StoreInfo.setStatus));
                                最终诠释SN = I;                                //调用listAll方法
                                mGrid.add(新NullField(可调焦));
                                mGrid.add(新的LabelField(firstUserName +
                                                + lastUserName));
                                mGrid.add(新的LabelField(USEREMAIL));
                                mGrid.add(新的LabelField(userGender));
                                mGrid.add(新的LabelField(userStatus));
                                btnDelete =新ButtonField字段(删除,ButtonField.CONSUME_CLICK);
                                btnDelete.setChangeListener(新FieldChangeListener()
                                {
                                    公共无效fieldChanged(场场,诠释上下文)
                                    {
                                        _data.removeElementAt(SN);
                                    }
                                });
                                加(btnDelete);                               // SeparatorField SPS1 =新SeparatorField();
                                //mGrid.add(sps1);
                            }
                        }                }
        }赶上(例外五){
        }
     }
 }
 类EmailScreen扩展MainScreen
 {
     用户名字符串;
     私人经理MGRID;
     串firstUserName;
     串lastUserName;
     串USEREMAIL;
     串userGender;
     串userStatus;
     ButtonField字段btnBack;
     字体字库;
     公共EmailScreen(字符串的邮件)
     {
         的setTitle(新的LabelField(搜索结果));
         加(+邮件新RichTextField(搜索结果));
         USERNAME =邮件;
         sea​​rchEmail();
         btnBack =新ButtonField字段(返回,ButtonField.CONSUME_CLICK);
         btnBa


解决方案

什么是与内置的报警应用程序进行集成的好处?难道是更好地为您的应用程序放置在设备上的日历事件,使事件显示提醒?

如果你必须有更加突出的报警,为什么不自己做呢?报警是行动电话支持(无论是发出声音和/或振动),显示在屏幕上,为什么它正在采取的行动,当有人回复它的操作停止。

您可以只是使在后台启动,检查一天,发出声音/振动在这一天的应用程序?

我的手机上的默认报警应用程序只支持一个时间环。如果我把它叫我起床上午4时,但您的应用程序重新安排我的手机上了警钟上午8时,您会立即失去一个客户(我醒来4小时为时已晚后)。

Below is my application code. i want alarm to ring on my blackberry on every 6 of this month whether this apllication is running or not. please guide me in details i am a beginner.

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.util.*;

import java.util.*;

import java.lang.String.*;




public class ListChk extends UiApplication 
{
    String getFirstName;
    String getLastName;
    String getEmail;
    String getGender;
    String getStatus;
    String getCompany;

    /*declaring text fields for user input*/
    private AutoTextEditField firstName;

    private AutoTextEditField lastName;
    private AutoTextEditField company;

    private EmailAddressEditField email;

    /*declaring choice field for user input*/

    private ObjectChoiceField gender;

    /*declaring check box field for user input*/
    private CheckboxField status;

    //Declaring button fields
    private ButtonField save;
    private ButtonField close;
    private ButtonField List;
    private ButtonField search;

    /*declaring vector*/
    private static Vector _data;

    /*declaring persistent object*/
    private static PersistentObject store;

    /*creating an entry point*/
    public static void main(String[] args) 

    {
        ListChk objListChk = new ListChk();
        objListChk.enterEventDispatcher();

    }//end of main of ListChk

    public ListChk()
    {

        /*Creating an object of the main screen class to use its functionalities*/
        MainScreen mainScreen = new MainScreen();

        //setting title of the main screen
        mainScreen.setTitle(new LabelField("Enter Your Data"));

        //creating text fields for user input
        firstName = new AutoTextEditField("First Name: ", "");
        lastName= new AutoTextEditField("Last Name: ", "");
        email= new EmailAddressEditField("Email:: ", "");
        company = new AutoTextEditField("Company: ", "");

        //creating choice field for user input
        String [] items = {"Male","Female"};
        gender= new ObjectChoiceField("Gender",items);

        //creating Check box field
        status = new CheckboxField("Active",true);

        //creating Button fields and adding functionality using listeners

        // A button that saves the the user data persistently when it is clicked
        save = new ButtonField("Save",ButtonField.CONSUME_CLICK);
        save.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context)
            {
                save();

            }
        });

        // a button which closes the entire application when clicked
        close = new ButtonField("Close",ButtonField.CONSUME_CLICK);
        close.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context)
            {
                onClose();
            }
        });

        // A button that shows the List of all Data being stored persistently
        List = new ButtonField("List",ButtonField.CONSUME_CLICK);
        List.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context){
                // pushing the next screen

                pushScreen(new ListScreen());



            }
        });

        search = new ButtonField("Search",ButtonField.CONSUME_CLICK);
        search.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context)
            {
                pushScreen(new SearchScreen());
            }
        });
        //adding the input fields to the main screen
        mainScreen.add(firstName);
        mainScreen.add(lastName);
        mainScreen.add(email);
        mainScreen.add(company);
        mainScreen.add(gender);
        mainScreen.add(status);

        // Addning horizontal field manager
        HorizontalFieldManager horizontal = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);

        //adding buttons to the main screen in Horizontal field manager

        horizontal.add(close);
        horizontal.add(save);
        horizontal.add(List);
        horizontal.add(search);

        //Adding the horizontal field manger to the screen
        mainScreen.add(horizontal);

        //adding menu items

        mainScreen.addMenuItem(saveItem);
        mainScreen.addMenuItem(getItem);
        mainScreen.addMenuItem(Deleteall);

        //pushing the main screen
        pushScreen(mainScreen);
    }
    private MenuItem Deleteall = new MenuItem("Delete all",110,10)
    {
        public void run()
        {
            int response = Dialog.ask(Dialog.D_YES_NO,"Are u sure u want to delete entire Database");
            if(Dialog.YES == response){
            PersistentStore.destroyPersistentObject(0xdec6a67096f833cL);
            Dialog.alert("Closing Application");
            onClose();
            }
            else
                Dialog.inform("Thank God");
        }
    };
//adding functionality to menu item "saveItem"  
private MenuItem saveItem = new MenuItem("Save", 110, 10) 
{

        public void run() 
        {
            //Calling save method
            save();
        }
};
//adding functionality to menu item "saveItem"  
private MenuItem getItem = new MenuItem("Get", 110, 11) 
{
    //running thread for this menu item
    public void run() 
    {


            //synchronizing thread
            synchronized (store) 
            {
                //getting contents of the persistent object

                _data = (Vector) store.getContents();
                try{

                    for (int i = _data.size()-1; i >-1; i--) 
                    {

                        StoreInfo info = (StoreInfo)_data.elementAt(i);
                        //checking for empty object
                        if (!_data.isEmpty()) 
                        {
                        //if not empty
                        //create a new object of Store Info class






                        //storing information retrieved in strings
                        getFirstName    =	(info.getElement(StoreInfo.NAME));
                        getLastName     =	(info.getElement(StoreInfo.LastNAME));
                        getEmail        =	(info.getElement(StoreInfo.EMail));
                        getGender       = 	(info.getElement(StoreInfo.GenDer));
                        getStatus       =	(info.getElement(StoreInfo.setStatus));
                        getCompany      =	(info.getElement(StoreInfo.setCompany));
                            //calling the show method
                        show();
                        }

                    }
                }
                catch(Exception e){}
            }   
        }


};
public void save()
{



    //creating an object of inner class StoreInfo
    StoreInfo info = new StoreInfo();
    //getting the test entered in the input fields
    info.setElement(StoreInfo.NAME, firstName.getText());
    info.setElement(StoreInfo.LastNAME,lastName.getText());
    info.setElement(StoreInfo.EMail, email.getText());
    info.setElement(StoreInfo.setCompany, company.getText());
    info.setElement(StoreInfo.GenDer,gender.toString());
    if(status.getChecked())
        info.setElement(StoreInfo.setStatus, "Active");
    else
        info.setElement(StoreInfo.setStatus, "In Active");
    //adding the object to the end of the vector
    _data.addElement(info);
    //synchronizing the thread
    synchronized (store) 
    {

        store.setContents(_data);
        store.commit();



    }
    //resetting the input fields

    Dialog.inform("Success!");
    firstName.setText(null);
    lastName.setText(null);
    email.setText("");
    company.setText(null);
    gender.setSelectedIndex("Male");
    status.setChecked(true);


}
//coding for persistent store
static {

store =
PersistentStore.getPersistentObject(0xdec6a67096f833cL);
synchronized (store) {
if (store.getContents() == null) {
store.setContents(new Vector());
store.commit();
}
}
_data = new Vector();
_data = (Vector) store.getContents();

}
//new class store info implementing persistable
private static final class StoreInfo implements Persistable 
{
    //declaring variables
    private Vector _elements;
    public static final int NAME = 0;
    public static final int LastNAME = 1;
    public static final int EMail= 2;
    public static final int GenDer = 3;
    public static final int setStatus = 4;
    public static final int setCompany = 5;
    public StoreInfo() 
    {
        _elements = new Vector(6);
        for (int i = 0; i < _elements.capacity(); ++i) 
        {
            _elements.addElement(new String(""));
        }
    }

    public String getElement(int id) 
    {
        return (String) _elements.elementAt(id);
    }
    public void setElement(int id, String value) 
    {
        _elements.setElementAt(value, id);
    }
}
//details for show method
public void show()
{
    Dialog.alert("Name is "+getFirstName+" "+getLastName+"\nGender is "+getGender+"\nE-mail: "+getEmail+"\nStatus is "+getStatus);
}
public void list()
{

    Dialog.alert("haha");


}

//creating save method

//overriding onClose method

public boolean onClose()
{


    System.exit(0);
    return true;
}

 class ListScreen extends MainScreen 
{
     String getUserFirstName;
     String getUserLastName;
     String getUserEmail;
     String getUserGender;
     String getUserStatus;
     String getUserCompany;
     String[] setData ;
     String getData = new String();
     String collectData = "";
     ObjectListField fldList;
     int counter = 0;

    private ButtonField btnBack;



    public ListScreen()
    {

        setTitle(new LabelField("Showing Data",LabelField.NON_FOCUSABLE));
        //getData = myList();
        //Dialog.alert(getData);

    //  setData = split(getData,"$");
    //  for(int i = 0;i<setData.length;i++)
    //  {
    //      add(new RichTextField(setData[i]+"@@@@@"));
    //  }
        showList();
        btnBack = new ButtonField("Back",ButtonField.CONSUME_CLICK|ButtonField.FIELD_HCENTER);
        btnBack.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field,int context)
            {
                UiApplication.getUiApplication().popScreen(getScreen());
            }
        });

        add(btnBack);



    }


    public void showList()
    {
        HorizontalFieldManager hfManager = new HorizontalFieldManager(HorizontalFieldManager.HORIZONTAL_SCROLLBAR|HorizontalFieldManager.HORIZONTAL_SCROLL);
        //SeparatorField spManager = new SeparatorField();
        LabelField lblcheck = new LabelField("check",LabelField.NON_FOCUSABLE);
        getData = myList();
        setData = split(getData,"$");
        fldList = new ObjectListField(ObjectListField.MULTI_SELECT);
        fldList.set(setData);
        //fldList.setEmptyString("heloo", 12);
        //hfManager.add(lblcheck);

        hfManager.add(fldList);
        //hfManager.add(spManager);
        add(hfManager);
        addMenuItem(new MenuItem("Select", 100, 1) {
            public void run() {
                int selectedIndex = fldList.getSelectedIndex();
                String item = (String)fldList.get(fldList, selectedIndex);
               pushScreen(new ShowDataScreen(item));
            }
            });

    }

    public String[] split(String inString, String delimeter) {
        String[] retAr;
        try {
            Vector vec = new Vector();
            int indexA = 0;
            int indexB = inString.indexOf(delimeter);

            while (indexB != -1) {
                vec.addElement(new String(inString.substring(indexA, indexB)));
                indexA = indexB + delimeter.length();
                indexB = inString.indexOf(delimeter, indexA);
            }
            vec.addElement(new String(inString.substring(indexA, inString
                    .length())));
            retAr = new String[vec.size()];
            for (int i = 0; i < vec.size(); i++) {
                retAr[i] = vec.elementAt(i).toString();
            }
        } catch (Exception e) {
            String[] ar = { e.toString() };
            return ar;
        }
        return retAr;
    }//end of Split Method



    public String myList()
    {


        _data = (Vector) store.getContents();
        try
        {
            for (int i = _data.size()-1; i >-1; i--,counter++) 
                {

                    StoreInfo info = (StoreInfo)_data.elementAt(i);
                    //checking for empty object
                    if (!_data.isEmpty()) 
                        {
                            //if not empty
                            //create a new object of Store Info class






                            //storing information retrieved in strings
                            //StoreInfo info = (StoreInfo)_data.lastElement();
                            getUserFirstName    =	(info.getElement(StoreInfo.NAME));
                            getUserLastName     =	(info.getElement(StoreInfo.LastNAME));
                            //getUserEmail      =	(info.getElement(StoreInfo.EMail));
                            //getUserGender         = 	(info.getElement(StoreInfo.GenDer));
                            //getUserStatus     =	(info.getElement(StoreInfo.setStatus));
                            getUserCompany      =	(info.getElement(StoreInfo.setCompany));


        collectData = collectData + getUserFirstName+" "+getUserLastName+" "+getUserCompany+ "$";


                    }
                }


        }
            catch(Exception e){}


    return collectData;     

    }//end of myList method





    public boolean onClose()
    {
        System.exit(0);
        return true;
    }

}//end of class ListScreen

 class ShowDataScreen extends MainScreen
 {
     String getFirstName;
     String getLastName;
     String getCompany;
     String getEmail;
     String getGender;
     String getStatus;
     String[] getData;
     public ShowDataScreen(String data)
     {
        getData = split(data," ");
        getFirstName = getData[0];
        getLastName = getData[1];
        getCompany = getData[2];
        _data = (Vector) store.getContents();
        try
        {
            for (int i = _data.size()-1; i >-1; i--)
            {
                StoreInfo info = (StoreInfo)_data.elementAt(i);
                if (!_data.isEmpty()) 
                {
                    if((getFirstName.equalsIgnoreCase(info.getElement(StoreInfo.NAME))) && (getLastName.equalsIgnoreCase(info.getElement(StoreInfo.LastNAME))) && (getCompany.equalsIgnoreCase(info.getElement(StoreInfo.setCompany))))
                    {
                        getEmail = info.getElement(StoreInfo.EMail);
                        getGender = info.getElement(StoreInfo.GenDer);
                        getStatus = info.getElement(StoreInfo.setStatus);

                        HorizontalFieldManager hfManager = new HorizontalFieldManager(HorizontalFieldManager.NON_FOCUSABLE);

                        AutoTextEditField name = new AutoTextEditField("Name: ",getFirstName+" "+getLastName);
                        AutoTextEditField email = new AutoTextEditField("Email: ",getEmail);
                        AutoTextEditField company = new AutoTextEditField("Company: ",getCompany);
                        AutoTextEditField Gender = new AutoTextEditField("Gender: ",getGender);
                        AutoTextEditField status = new AutoTextEditField("Status: ",getStatus);
                        add(name);
                        add(email);
                        add(company);
                        add(Gender);
                        add(status);

                    }
                }

            }//end of for loop
        }//end of try
        catch(Exception e){}

        //Dialog.alert("fname is "+getFirstName+"\nlastname = "+getLastName+" company is "+getCompany);
     }




     public String[] split(String inString, String delimeter) {
            String[] retAr;
            try {
                Vector vec = new Vector();
                int indexA = 0;
                int indexB = inString.indexOf(delimeter);

                while (indexB != -1) {
                    vec.addElement(new String(inString.substring(indexA, indexB)));
                    indexA = indexB + delimeter.length();
                    indexB = inString.indexOf(delimeter, indexA);
                }
                vec.addElement(new String(inString.substring(indexA, inString
                        .length())));
                retAr = new String[vec.size()];
                for (int i = 0; i < vec.size(); i++) {
                    retAr[i] = vec.elementAt(i).toString();
                }
            } catch (Exception e) {
                String[] ar = { e.toString() };
                return ar;
            }
            return retAr;
        }//end of Split Method
 }






 class SearchScreen extends MainScreen
 {
     private ButtonField btnFirstName;
     private ButtonField btnLastName;
     private ButtonField btnSearch;
     private ButtonField btnEmail;
     private SeparatorField sp;
     String userName;
     HorizontalFieldManager hr = new HorizontalFieldManager();

    public AutoTextEditField searchField;

     public SearchScreen()
     {


         sp = new SeparatorField();
         setTitle(new LabelField("your Search Options"));
         add(new RichTextField("Search by : "));

         btnFirstName = new ButtonField("First Name",ButtonField.CONSUME_CLICK);
         hr.add(btnFirstName);

         btnFirstName.setChangeListener(new FieldChangeListener()
                 {
                    public void fieldChanged(Field field, int context) 
                    {
                        //HorizontalFieldManager hrs = new HorizontalFieldManager();
                        searchField = new AutoTextEditField("First Name: ","ali");
                        add(searchField);
                        btnSearch = new ButtonField("Search",ButtonField.CONSUME_CLICK);
                        btnSearch.setChangeListener(new FieldChangeListener()
                        {
                            public void fieldChanged(Field field, int context)
                            {
                                //Dialog.alert(searchField.getText());
                                pushScreen(new FirstnameScreen(searchField.getText()));
                                //FirstnameScreen obj = new FirstnameScreen();
                                //obj.name= searchField.getText();

                            }
                        });
                        add(btnSearch);
                        //hrs.add(sp);
                    }
                 });


         btnLastName = new ButtonField("Last Name",ButtonField.CONSUME_CLICK);
         hr.add(btnLastName);
         btnLastName.setChangeListener(new FieldChangeListener()
         {
             public void fieldChanged(Field field, int Context)
             {
                 searchField = new AutoTextEditField("Last Name: ","");
                    add(searchField);
                    btnSearch = new ButtonField("Search",ButtonField.CONSUME_CLICK);
                    btnSearch.setChangeListener(new FieldChangeListener()
                    {
                        public void fieldChanged(Field field, int context)
                        {
                            //Dialog.alert(searchField.getText());
                            pushScreen(new LastnameScreen(searchField.getText()));
                            //FirstnameScreen obj = new FirstnameScreen();
                            //obj.name= searchField.getText();

                        }
                    });
                    add(btnSearch);

             }
         });
         btnEmail = new ButtonField("Email",ButtonField.CONSUME_CLICK);
         hr.add(btnEmail);
         btnEmail.setChangeListener(new FieldChangeListener()
         {
             public void fieldChanged(Field field, int Context)
             {
                 searchField = new AutoTextEditField("Email: ","");
                    add(searchField);
                    btnSearch = new ButtonField("Search",ButtonField.CONSUME_CLICK);
                    btnSearch.setChangeListener(new FieldChangeListener()
                    {
                        public void fieldChanged(Field field, int context)
                        {
                            //Dialog.alert(searchField.getText());
                            pushScreen(new EmailScreen(searchField.getText()));
                            //FirstnameScreen obj = new FirstnameScreen();
                            //obj.name= searchField.getText();

                        }
                    });
                    add(btnSearch);
             }
         });   
         add(hr);

     }
     void myShow()
     {
         Dialog.alert(searchField.getText());
     }
 }



 class FirstnameScreen extends MainScreen
 {
     String userName;
     private Manager mGrid;
     String firstUserName;
     String lastUserName;
     String userEmail;
     String userGender;
     String userStatus;
     ButtonField btnBack;
     Font font; 


     public FirstnameScreen(String name)
     {
         setTitle(new LabelField("your Search Results"));
         add(new RichTextField("Search results for"+name));
         userName = name; 
         searchFirstName();
         btnBack = new ButtonField("Back",ButtonField.CONSUME_CLICK);
         btnBack.setChangeListener(new FieldChangeListener()
         {
             public void fieldChanged(Field field, int context)
             {
                 UiApplication.getUiApplication().popScreen(getScreen());
             }
         });
         add(btnBack);


     }


     public void searchFirstName()
     {

         ButtonField btnDelete;
            if (null != mGrid && null != mGrid.getManager())
                mGrid.getManager().delete(mGrid);
        int colWidth = net.rim.device.api.system.Display.getWidth() / 4; 
        mGrid = new GridFieldManager(new int[] { 0, colWidth, colWidth,
                        colWidth, colWidth }, VERTICAL_SCROLL | VERTICAL_SCROLLBAR);
        mGrid.add(new NullField(FOCUSABLE));
        mGrid.add(new LabelField("Name"));
        mGrid.add(new LabelField("E-Mail"));
        mGrid.add(new LabelField("Gender"));
        mGrid.add(new LabelField("Active"));
        //mGrid.add(new ButtonField("Delete"));

        //SeparatorField sps = new SeparatorField();
        //mGrid.add(sps);
        add(mGrid);
        _data = (Vector) store.getContents();
        try {

                for (int i = _data.size() - 1; i > -1; i--) {

                        StoreInfo info = (StoreInfo) _data.elementAt(i);
                        // checking for empty object
                        if (!_data.isEmpty()) {

                            firstUserName = (info.getElement(StoreInfo.NAME));
                            if(firstUserName.equalsIgnoreCase(userName))
                            {
                                // if not empty
                                // create a new object of Store Info class

                                // stored information retrieved in strings

                                lastUserName = (info.getElement(StoreInfo.LastNAME));
                                userEmail = (info.getElement(StoreInfo.EMail));
                                userGender = (info.getElement(StoreInfo.GenDer));
                                userStatus = (info.getElement(StoreInfo.setStatus));
                                final int sn = i;

                                // calling the listAll method
                                mGrid.add(new NullField(FOCUSABLE));
                                mGrid.add(new LabelField(firstUserName + " "
                                                + lastUserName));
                                mGrid.add(new LabelField(userEmail));
                                mGrid.add(new LabelField(userGender));
                                mGrid.add(new LabelField(userStatus));
                                btnDelete = new ButtonField("Delete",ButtonField.CONSUME_CLICK);
                                btnDelete.setChangeListener(new FieldChangeListener()
                                {
                                    public void fieldChanged(Field field, int context)
                                    {
                                        _data.removeElementAt(sn);
                                    }
                                });
                                add(btnDelete);

                               // SeparatorField sps1 = new SeparatorField();
                                //mGrid.add(sps1);




                            }


                        }

                }
        } catch (Exception e) {
        }


     }
 }




 class LastnameScreen extends MainScreen
 {

     String userName;
     private Manager mGrid;
     String firstUserName;
     String lastUserName;
     String userEmail;
     String userGender;
     String userStatus;
     ButtonField btnBack;
     Font font; 


     public LastnameScreen(String name)
     {
         setTitle(new LabelField("your Search Results"));

         add(new RichTextField("Search results for"+name));
         userName = name; 
         searchLastName();
         btnBack = new ButtonField("Back",ButtonField.CONSUME_CLICK);
         btnBack.setChangeListener(new FieldChangeListener()
         {
             public void fieldChanged(Field field, int context)
             {
                 UiApplication.getUiApplication().popScreen(getScreen());
             }
         });
         add(btnBack);
     }

     public void searchLastName()
     {

         ButtonField btnDelete;
            if (null != mGrid && null != mGrid.getManager())
                mGrid.getManager().delete(mGrid);
        int colWidth = net.rim.device.api.system.Display.getWidth() / 4; 
        mGrid = new GridFieldManager(new int[] { 0, colWidth, colWidth,
                        colWidth, colWidth }, VERTICAL_SCROLL | VERTICAL_SCROLLBAR);
        mGrid.add(new NullField(FOCUSABLE));
        mGrid.add(new LabelField("Name"));
        mGrid.add(new LabelField("E-Mail"));
        mGrid.add(new LabelField("Gender"));
        mGrid.add(new LabelField("Active"));
        //mGrid.add(new ButtonField("Delete"));

        //SeparatorField sps = new SeparatorField();
        //mGrid.add(sps);
        add(mGrid);
        _data = (Vector) store.getContents();
        try {

                for (int i = _data.size() - 1; i > -1; i--) {

                        StoreInfo info = (StoreInfo) _data.elementAt(i);
                        // checking for empty object
                        if (!_data.isEmpty()) {

                               lastUserName = (info.getElement(StoreInfo.LastNAME));
                            if(lastUserName.equalsIgnoreCase(userName))
                            {
                                // if not empty
                                // create a new object of Store Info class

                                // stored information retrieved in strings
                                firstUserName = (info.getElement(StoreInfo.NAME));

                                userEmail = (info.getElement(StoreInfo.EMail));
                                userGender = (info.getElement(StoreInfo.GenDer));
                                userStatus = (info.getElement(StoreInfo.setStatus));
                                final int sn = i;

                                // calling the listAll method
                                mGrid.add(new NullField(FOCUSABLE));
                                mGrid.add(new LabelField(firstUserName + " "
                                                + lastUserName));
                                mGrid.add(new LabelField(userEmail));
                                mGrid.add(new LabelField(userGender));
                                mGrid.add(new LabelField(userStatus));
                                btnDelete = new ButtonField("Delete",ButtonField.CONSUME_CLICK);
                                btnDelete.setChangeListener(new FieldChangeListener()
                                {
                                    public void fieldChanged(Field field, int context)
                                    {
                                        _data.removeElementAt(sn);
                                    }
                                });
                                add(btnDelete);

                               // SeparatorField sps1 = new SeparatorField();
                                //mGrid.add(sps1);




                            }


                        }

                }
        } catch (Exception e) {
        }


     }
 }
 class EmailScreen extends MainScreen
 {
     String userName;
     private Manager mGrid;
     String firstUserName;
     String lastUserName;
     String userEmail;
     String userGender;
     String userStatus;
     ButtonField btnBack;
     Font font; 


     public EmailScreen(String mail)
     {
         setTitle(new LabelField("your Search Results"));
         add(new RichTextField("Search results for"+mail));
         userName = mail; 
         searchEmail();
         btnBack = new ButtonField("Back",ButtonField.CONSUME_CLICK);
         btnBa

解决方案

What are the benefits of integrating with the built-in alarm application? Would it be better for your application to place an event in the device's calendar and make the event show a reminder?

If you have to have a more prominent alarm, why not do it yourself? An alarm is an action the phone does (either make a sound and/or vibrate) that shows on the screen why it is taking that action and the action stops when someone responds to it.

Can you just make an app that starts in the background, checks the day, and makes a sound/vibrates on that day?

The default Alarm app on my phone only supports one time to ring. If I set it to wake me up at 4 a.m., but your app reschedules the alarm on my phone for 8 a.m., you would instantly lose a customer (after I wake up 4 hours too late).

这篇关于黑莓报警Integeration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆