pebble-watch

Always getting AppSync initial values when sending new values from iOS app

一个人想着一个人 提交于 2020-01-17 03:19:06
问题 I am creating a Pebble companion app for an iOS application. I have setup my AppSync with some initial values: Tuplet initial_values[] = { TupletCString(SYNC_KEY_LANGUAGE, language), TupletCString(SYNC_KEY_TOTAL_AMOUNT, totalAmount), TupletCString(SYNC_KEY_TODAY_AMOUNT, todayAmount), TupletCString(SYNC_KEY_TRIP_NAME, tripName) }; app_sync_init(&sync, sync_buffer, sizeof(sync_buffer), initial_values, ARRAY_LENGTH(initial_values), sync_tuple_changed_callback, sync_error_callback, NULL); The

Pebble.js WatchApp displays: “Disconnected - run the pebble phone app”

久未见 提交于 2020-01-02 09:09:10
问题 I can't find much documentation around this issue. All other running apps on my pebble have a connection to my phone, and work as expected. However, a Pebble.js application I'm currently working on simply displays Disconnected - run the pebble phone app . I have noticed that in my Developer Settings that the Connection Manager is listed as Disconnected . Is this part of the problem? I see nothing in the logs. For reference, the application is doing a simple ajax request and displaying the

Trying to mask APNG background with text

让人想犯罪 __ 提交于 2019-12-25 09:58:33
问题 I am taking Pebble example of working with APNG and trying to mask it with transparent text, so bitmap will show only thru text, but no matter what mask/composite mode I try, bitmap is shown as black-and-white (original animation is in color and shows in color if I don't draw text) Here's a sample code I use in callback SP for the layer that draws text: //creating background and text graphics_context_set_fill_color(ctx, GColorBlack); graphics_fill_rect(ctx, GRect(0, 0, 144, 168), 0,

Trying to mask APNG background with text

青春壹個敷衍的年華 提交于 2019-12-25 09:58:23
问题 I am taking Pebble example of working with APNG and trying to mask it with transparent text, so bitmap will show only thru text, but no matter what mask/composite mode I try, bitmap is shown as black-and-white (original animation is in color and shows in color if I don't draw text) Here's a sample code I use in callback SP for the layer that draws text: //creating background and text graphics_context_set_fill_color(ctx, GColorBlack); graphics_fill_rect(ctx, GRect(0, 0, 144, 168), 0,

Converting char array to string [and Pebble]

坚强是说给别人听的谎言 提交于 2019-12-25 02:29:18
问题 I have a char array which I am trying to turn into a char pointer to a string. I believe this involves getting the pointer to the first element of the char array, and adding a null character to the end of the char array. The reason for this is that I am trying to then pass it to a SimpleMenuItem for the pebble smartwatch, where .title needs to get a char* , pointing to a string. While I've been able to get the char array filled and (I think) added the null character and gotten the pointer, I

How to add an image to a window in Pebble.js?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 07:15:05
问题 The documentation on window (http://developer.getpebble.com/docs/pebblejs/#window) says that we can add an image to it: "Window: The Window by itself is the most flexible. It allows you to add different Elements (Circle, Image, Rect, Text, TimeText) and to specify a position and size for each of them. You can also animate them." An image is an element, but there is no documentation on the image constructor. What parameters does it take? Particularly, how do we specify the image src? Also,

Can I read another applications memory?

自作多情 提交于 2019-12-23 01:34:42
问题 I'd like to know wether it is possible to read some data from a foreign application in Android (like reading runtastics pulse, distance, pace e.g.) and include it into my own application? I'm not asking because I wanna do some bad stuff with it, I'd just like to know that for some interesting Pebble development tasks. 回答1: By design, you absolutely can not do this (It must violate almost all the security principles). Furthermore, even if you find a hack to do this, it will get you kicked of

Accessing firebase using cloud pebble (Pebble.js)

 ̄綄美尐妖づ 提交于 2019-12-12 06:12:51
问题 I've been trying to figure out a way to access data from firebase to display in a pebble app, using cloud pebble. I'm not quite sure how to do so as I'm relatively new to javascript and the pebble platform. 回答1: You can require remote URI's using the following syntax: require('//cdn.firebase.com/js/client/2.2.9/firebase.js'); The other (more traditional) way to work around this is to copy-paste the source code of the library you want to use at the top of your JavaScript file. Your best bet to

Coordinates of points dividing circle into n equal halves in Pebble

本小妞迷上赌 提交于 2019-12-12 03:17:29
问题 I am trying to divide the circle into n equal parts using straight lines. Idea is to get the coordinates of the end points on the circumference of the circle and then to draw the line. to find coodrinates I am using following code: static void getPoints(int x0,int y0,int r) { double angle = 0; double angleToRadian = 0; for(int i = 0 ; i < noOfDividingPoints ;i++) { angle = i * (360/noOfDividingPoints); angleToRadian = ( angle * 3.141 ) / 180; APP_LOG(APP_LOG_LEVEL_DEBUG, "LOG: Angle: %lf,

CLLocationManager startUpdatingLocation() doesn't work when called in background

旧街凉风 提交于 2019-12-11 23:57:22
问题 I have a particular use case where I want to be able to start location updates when the app is already in the background. Specifically, I want to be able to press a button on my Pebble watchapp, and that causes my companion iOS app to begin location updates. I am able to successfully start the location updates from my Pebble only if the iOS app is either in the foreground or has just entered the background within the past few seconds (like 5?). After a few seconds has passed with the app in