1

http://developer.getpebble.com/getting-started/watchface-tutorial/part1/在 C 中。有没有办法在 JS 中做同样的事情?

4

3 回答 3

4

Yes you can! You will just need to change the type of app in the appinfo.json:

  • In CloudPebble, just go to your project Settings and change the AppKind to "Watchface". enter image description here
  • If you are writing apps with the command line SDK you need to fork pebble.js and edit the appinfo.json file to set "watchface": true (see the app metadata doc for reference).

A few things to note:

  • Pebble.js apps actually run on the phone and remote control the Pebble. If you update the display too often (every second for example) it will cost a lot in battery life because the radio will be used a lot.
  • To update the seconds automatically, without sending radio messages every time, you can use the "TimeText" element in pebble.js.
  • Just like all watchfaces your app will not receive button events if it is configured to be a Watchface. You can still use the accelerometer and tap events though.
于 2015-02-19T18:09:50.620 回答
1

从 SDK 4 开始,您可以使用 js https://developer.pebble.com/blog/2016/08/30/announcing-pebble-sdk4/对表盘进行编程

于 2016-09-28T10:29:27.970 回答
0

您可以使用pebble js构建和连接表盘,因为 pebble 中的 pebble js 应用程序项目只是一个 pebble C 包装的应用程序

Pebble.js 构建在标准 Pebble C SDK 和 PebbleKit JS 之上。它包括一个在手表上运行的 C 应用程序,并在每次用户交互时与手机进行交互。Pebble.js 库提供对象和函数来构建 UI,然后远程控制 C 应用程序以显示它们。

注意:PebbleKit Android 和 PebbleKit iOS 不能与 PebbleKit JS 一起使用。删除 Pebble 项目中的所有 JavaScript 文件以确保与 Android 和 iOS 配套应用程序的通信。

警告:截至今天(2015 年 2 月 18 日)Pebble.js仍处于测试阶段

于 2015-02-18T20:28:08.827 回答