Blackberry MapView 在模拟器上工作时无法在设备上工作

发布于 2024-11-28 07:06:42 字数 729 浏览 1 评论 0原文

我正在开发一个使用 MapView 的 BlackBerry 应用程序。 目前,我只显示 MapView,仅此而已。 这是我使用的代码片段:

public class MapScreen extends MainScreen {
  private MapField map;

  public MapScreen() {
    super(MainScreen.NO_VERTICAL_SCROLL);

    map = new MapField();
    map.moveTo(new Coordinates(50.847573,4.713135, 0));
    add(map);

    //...
  }

  //...
}

我正在使用 net.rim.device.api.lbs.MapField 因为我必须与 OS 5.0 兼容

在模拟器上,一切都很好它正在工作。 但当我将其部署到设备上时,我看到一个白屏...

该设备具有互联网连接,但只能通过 Wi-Fi 连接。首先我认为这就是问题所在,但根据 “黑莓服务可以通过 Wi-Fi 连接使用”,这应该不是问题。

那么,有人知道为什么它不能在设备上运行吗?我该如何解决这个问题? 谢谢

I'm working on a BlackBerry application that uses a MapView.
At the moment, I'm only showing the MapView, nothing more.
This is a snippet from the code I use for it:

public class MapScreen extends MainScreen {
  private MapField map;

  public MapScreen() {
    super(MainScreen.NO_VERTICAL_SCROLL);

    map = new MapField();
    map.moveTo(new Coordinates(50.847573,4.713135, 0));
    add(map);

    //...
  }

  //...
}

I'm using net.rim.device.api.lbs.MapField because I have to be compatible with OS 5.0

On the simulator, everything's fine and it's working.
But the moment I deploy it on the device, I see a white screen...

The device has an internet connection, but only over Wi-Fi. First I was thinking that that was the problem, but according to "Blackberry services that are available over Wi-Fi connections", it shouldn't be a problem.

So, does anybody know why it's not working on the device, and how I can solve this?
Thanks

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

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

发布评论

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

评论(2

寻找我们的幸福 2024-12-05 07:06:42

你说“该设备有互联网连接,但只能通过 Wi-Fi 连接”,这让我相信你没有为真正的设备配置 BlackBerry 数据计划。您需要该计划才能访问任何 BlackBerry 服务,甚至通过 Wi-Fi 也是如此。

要检查是否有适当的连接,您可以使用:

if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B) {
   // Connection will support BlackBerry services
} else if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS) {
   // Connection will support BlackBerry services if BES allows the connection to BIS servers.
}

You say "the device has an internet connection, but only over Wi-Fi" which makes me beleive you don't have the real device provisioned with a BlackBerry data plan. You need that plan in order to access any BlackBerry services, even over Wi-Fi.

To check for an appropriate connection you can use:

if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B) {
   // Connection will support BlackBerry services
} else if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS) {
   // Connection will support BlackBerry services if BES allows the connection to BIS servers.
}
终止放荡 2024-12-05 07:06:42

检查此问题的更好方法是检查 LBSConfig 或其变体的 ServiceBook 条目。

这使得不再在计划中但曾经由 LBS 配置过的设备能够正常运行。

private static final boolean have_lbs() {
    ServiceBook sb = ServiceBook.getSB();
    ServiceRecord[] records = sb.getRecords();
    int count = records.length;
    for (int ii = 0; ii < count; ++ii) {
        if (records[ii].getCid().toUpperCase().startsWith("LBS"))
            return true;
    }
    return false;
}

A better way of checking for this is to check the ServiceBook entries for LBSConfig or variants thereof.

That allows devices that are no longer on a plan, but were once configured by one with LBS, to function properly.

private static final boolean have_lbs() {
    ServiceBook sb = ServiceBook.getSB();
    ServiceRecord[] records = sb.getRecords();
    int count = records.length;
    for (int ii = 0; ii < count; ++ii) {
        if (records[ii].getCid().toUpperCase().startsWith("LBS"))
            return true;
    }
    return false;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文