如何配置您的黑莓应用程序正常工作(在模拟器上工作,但在智能手机上不起作用)?

发布于 2024-11-10 02:41:58 字数 1607 浏览 3 评论 0原文

我写了一个有两个屏幕的应用程序。第一个屏幕由主类触发。单击第一个屏幕中的按钮即可打开第二个屏幕。

public class MyApp extends UiApplication{
    public static void main(String[] args){
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }

    public MyApp(){        
        // Push a screen onto the UI stack for rendering.
        pushScreen(new MyScreen());
    }
} 

public class MyScreen extends MainScreen implements FieldChangeListener
{
    BasicEditField mEdit = null; 
    ButtonField mButton = null;

    public MyScreen() 
    {
        super();                
        mEdit = new BasicEditField("input: ", "some text");
        add(mEdit);
        mButton = new ButtonField("Go second screen");
        mButton.setChangeListener(this);
        add(mButton);
    }
    public void fieldChanged(Field field, int context) 
    {
        if(mButton == field)
        {
            MyScreen2 scr = new MyScreen2();
            scr.setTextValue(mEdit.getText());
            UiApplication.getUiApplication().pushScreen(scr);
            UiApplication.getUiApplication().popScreen(this);
        }
    }
}

public final class MyScreen2 extends MainScreen 
{
    String mTextValue = null;
    LabelField mLabel = null;

    public void setTextValue(String textValue) 
    {
        mTextValue = textValue;
        mLabel.setText(mTextValue);
    }

    public MyScreen2() 
    {
        super();        
        mLabel = new LabelField();
        add(mLabel);
    }
}

它可以在 9700 模拟器上运行,但不能在智能手机上运行。我想知道怎么了?我想知道智能手机是否会阻止从我的计算机加载应用程序?

我尝试签署 .cod 但没有任何变化。

有什么想法吗?

I wrote an app which has 2 screens. The first screen is triggered by the main class. The second screen is opened by clicking a button in the first screen.

public class MyApp extends UiApplication{
    public static void main(String[] args){
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }

    public MyApp(){        
        // Push a screen onto the UI stack for rendering.
        pushScreen(new MyScreen());
    }
} 

public class MyScreen extends MainScreen implements FieldChangeListener
{
    BasicEditField mEdit = null; 
    ButtonField mButton = null;

    public MyScreen() 
    {
        super();                
        mEdit = new BasicEditField("input: ", "some text");
        add(mEdit);
        mButton = new ButtonField("Go second screen");
        mButton.setChangeListener(this);
        add(mButton);
    }
    public void fieldChanged(Field field, int context) 
    {
        if(mButton == field)
        {
            MyScreen2 scr = new MyScreen2();
            scr.setTextValue(mEdit.getText());
            UiApplication.getUiApplication().pushScreen(scr);
            UiApplication.getUiApplication().popScreen(this);
        }
    }
}

public final class MyScreen2 extends MainScreen 
{
    String mTextValue = null;
    LabelField mLabel = null;

    public void setTextValue(String textValue) 
    {
        mTextValue = textValue;
        mLabel.setText(mTextValue);
    }

    public MyScreen2() 
    {
        super();        
        mLabel = new LabelField();
        add(mLabel);
    }
}

It works on the 9700 simulator, but doesn't work on the smartphone. I wonder what is wrong? I wonder if the smartphone blocks loading app from my computer?

I tried signing .cod but nothing changes.

Any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹雨成花 2024-11-17 02:41:59

您需要签名密钥才能在真实设备上运行您的应用程序...花费近 20 美元

转到此处
您可以从这里找到所有详细信息,

我认为这可能对您有帮助
干杯

you need signing key to run your application on real device ... It cost near about 20 dollars

go here
you can find all the details from here

I think it might help you
cheers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文