诺基亚6300中出现应用程序错误 [英] Application Error Occurs in Nokia 6300

查看:96
本文介绍了诺基亚6300中出现应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码连接Servlet.尝试访问互联网时的移动应用程序.

I am using this code to connect Servlet. Mobile application when try to access internet.

以下消息出现在移动设备中.

The following message appears in mobile.

允许网络访问?是或否".如果我在诺基亚6300中为该消息单击否",则会出现应用程序错误"警告,它将自动关闭该应用程序.

"Allow network access?? yes or no ". If I click "no" for that message in Nokia 6300 "Application Error" Warning will appear and it will close the application automatically.

我尝试了其他诺基亚手机,例如N70和N72.手机将不会显示应用程序错误".

I tried other nokia mobiles like N70 and N72. Mobile will not show "Application Error".

是移动问题还是编码问题?

Is it Mobile problem or coding problem?

有什么有效的方法可以使用http连接Servlet吗?

Is there any efficient way to connect Servlet using http?

 public static InputStream getDataInputStream(String url, String request) 
 {
    HttpConnection httpConnectionObj = null;

    OutputStream dataOutputStreamObj = null;

    try {
        httpConnectionObj = (HttpConnection) Connector.open(url, Connector.READ_WRITE);

        httpConnectionObj.setRequestMethod(HttpConnection.POST);

        dataOutputStreamObj = httpConnectionObj.openOutputStream();

        dataOutputStreamObj.write(request.getBytes());

        dataOutputStreamObj.close();

        return httpConnectionObj.openInputStream();

    } catch (javax.microedition.io.ConnectionNotFoundException cnfe) {
      //Alert
    } catch (Exception ex) {
      //Alert
    } finally {
        try {
            if (httpConnectionObj != null) {
                httpConnectionObj.close();
                httpConnectionObj = null;
            }

        } catch (IOException ex) {
            ex.printStackTrace();
        }

    }
    return null;
}

推荐答案

由于Nokia 6300是Series40手机,因此没有好的方法可以提取java.lang.Throwable.printStackTrace().

There is no good way to extract java.lang.Throwable.printStackTrace() on a Nokia 6300 since it is a Series40 phone.

权限对话框的问题与您的代码无关.为了解决这个问题,您必须了解MIDP安全模型.

The issue with the permission dialog has nothing to do with your code. You have to be aware of the MIDP security model in order to fix this.

电话制造商在给定的电话的固件中编码了多个安全域.

A given phone has several security domain encoded in its firmware by the phone manufacturer.

在每个域中,可以有多个选项来限制对敏感API的访问.

In each domain, there can be several options to restrict access to a sensitive API.

安装MIDlet时,电话将根据信任您签名的证书的人来决定它属于哪个域. (可以是未签名,受信任的第三方,运营商,制造商...)

When you install a MIDlet, the phone decides which domain it belongs to based on who trusts the certificate you signed it with. (could be unsigned, trusted third party, operator, manufacturer... )

当您运行MIDlet时,每次它尝试使用受限制的API时,都会应用相应的选项. (可以始终拒绝,每次询问用户,只询问用户一次,始终允许).

When you run the MIDlet, every time it attempts to use a restricted API, the corresponding option is applied. (Could be always deny, ask the user every time, ask the user only once, always allow).

在同一域中,不同的受限API可以具有不同的选项.

Different restricted APIs can have different options in the same domain.

因此,对您的问题有几种可能的解释:

There are therefore several possible explanations to your problem:

  • 您对6300和N70的MIDlet签名不同.
  • 6300和n70上的安全域不同.
  • 6300和N70上限制HTTP连接的选项不同.
  • 移动网络运营商在6300和N70上有所不同.

这篇关于诺基亚6300中出现应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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