我为 Samsung Galaxy Gear 构建了一个简单的 hello world 应用程序,并在 watch 上成功运行了它。但是当我尝试在应用程序(在 Galaxy Gear 上运行)上建立互联网连接时,会抛出连接错误异常。我知道 Galaxy Gear 没有直接的互联网连接。 (它是 Galaxy Note 3 的从属设备)。
如何通过 Samsung Galaxy Gear 建立互联网连接?这方面的最佳做法是什么?在 Galaxy Note 3 上运行服务并从 Gear 监听/触发它?
编辑:我获得了更多关于齿轮开发的信息。
There are three application types for Gear:
Stand-alone
,Linked (Master-Slave)
, andIntegrated
.
Standalone:
Watch app does not need a base phone app (i.e. Clock application), and it can operate independently.
Linkage (Master-Slave):
Watch app needs to communicate with a base phone app and they do not want to change the base phone app. If a user already installed a base phone app (i.e., Music Player): Once the user downloads the Linked Watch app (i.e., Music Controller), a provider which includes Watch App will be downloaded to the phone and the provider will send Watch app to the Watch. In this case, provider will act as a communicator between the phone and Watch.If a user has not installed a base phone app: Linkage app can be installed in the same manner as described above. But when a first-time user opens your app, developers MUST show a pop-up to the user suggesting that he/she install the base phone app and providing a link to download.
Integral:
Watch app needs to communicate with a base phone app and they want a user to install a new base phone app when the user downloads the Watch app.Below permissions must be included to the manifest for not to be rejected from the app certification.
1) Standalone: <uses-permission android:name="com.samsung.WATCH_APP_TYPE.Standalone"/> 2) Linked: <uses-permission android:name="com.samsung.WATCH_APP_TYPE.Linkage_Slave"/> 3) Integrated: <uses-permission android:name="com.samsung.WATCH_APP_TYPE.Integral"/>
但我仍然没有 Gear 的 SDK/API,它应该包括 com.samsung.*
类。
最佳答案
三星 watch 通过蓝牙与手机通信。 当时只能建立一个这样的 radio 链接,并且在三星产品的情况下,该连接由连接到手机端对等三星“Gear Manager”应用程序的现有固件使用。目前,该解决方案独占了已建立的蓝牙 session 的使用,并实现和控制链接上可能发生的事情。 Gear Manager 充当服务器,响应并提供它在 watch 端支持的一组应用程序。 Gear Manager 检查它运行的手机型号,在撰写本文时将只允许在选定的三星手机型号上运行。 watch 上的多个应用程序可以通过 watch 固件中的仲裁机制注册以共享链接(API 未公开),但允许发生的流量类型由固件与手机端 Gear Manager 应用程序合作控制。通常,开发人员可能会想出“我希望 watch 上我自己的应用程序能够与我自己开发的手机应用程序进行通信”的想法。目前只能等待三星发布什么样的Gear SDK供公众使用。它可能是限制性的(我的假设),或者实际上提供蓝牙 session 的一般共享,以允许将相机、麦克风、音频、显示器、互联网的奇妙组合可能性释放到第三方的想象中。 future 会告诉我们。目前,三星运行一个仅限邀请的计划,其中选定的 ISV 开发应用程序,并且这些是唯一有权扩展现有应用程序集和生产三星批准进入其应用程序商店的新 Gear 应用程序的人。
关于android - 通过 Samsung Galaxy Gear 进行互联网连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19448452/