【问题标题】:How to determine OS type on device with Tabris如何使用 Tabris 确定设备上的操作系统类型
【发布时间】:2015-02-27 23:03:24
【问题描述】:

我浏览了 Tabris 网站上的 official documentation,但还没有找到答案。那么,在 Tabris 应用程序中,如何确定其运行的当前操作系统?

具体来说,我希望能够检测 Android 或 iOS。

编辑

@Holger 发布答案后,我在他们的网站上找到了这个示例,我在这里粘贴以帮助其他人:

var page = tabris.create("Page", {
  title: "Device Info",
  topLevel: true
});

["platform", "version", "model",  "language"].forEach(function(property) {
  tabris.create("TextView", {
    layoutData: {left: 10, right: 10, top: [page.children().last(), 10]},
    text: property + ": " + device[property]
  }).appendTo(page);
});

page.open();

【问题讨论】:

标签: tabris


【解决方案1】:

有一个名为“ClientDevice”的客户端服务。你可以从它那里得到平台、操作系统版本等。见http://developer.eclipsesource.com/tabris/docs/1.4/working/client-services/client-device#the_clients_platform

【讨论】:

    猜你喜欢
    • 2011-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-11
    • 1970-01-01
    • 1970-01-01
    • 2011-04-17
    • 2014-09-17
    相关资源
    最近更新 更多