Will B4a support Pebble watch or Ooya?

Gary Miyakawa

Active Member
Licensed User
Longtime User
I'm interested in the answer on this ? I did a search on Pebble and did not find reference to any other posting.

Do we know if B4A will be able to build apps for Pebble?

Thanks,

Gary M
 
Upvote 0

wheretheidivides

Active Member
Licensed User
Longtime User
The communication with the watch is done with intents: Pebble Android SDK — Google I/O Developer Preview

I haven't tried it however you do not need any library to build an application that sends such intents or listens to intents.

So I guess you're going to tell me I should read up on intents as I have no idea what they are. The current program I am working on is for casino dealers. they are not allowed to take out phones, but can have watches. So I think it'd be cool to send info over to the watch.
 
Last edited:
Upvote 0

wheretheidivides

Active Member
Licensed User
Longtime User
no, but I have one on order. they are shipping feb-april time. abit expensive at $150, but still if the aps are needed, then people will use.
 
Upvote 0

wheretheidivides

Active Member
Licensed User
Longtime User
You should read about intents and intent filters. It shouldn't be complicated to communicate with this watch.

Once you have access to this watch I can further help you.

You the man. I have learned a ton about B4A in the last 2 months, that I don't consider myself a beginner anymore. More like a average user now.
 
Upvote 0

seskindell

Active Member
Licensed User
Longtime User
You should read about intents and intent filters. It shouldn't be complicated to communicate with this watch.

Once you have access to this watch I can further help you.

Hi Erel,

I have the watch and I can not get it to work with intents. I have used intents before with other watches and they work alright.

This is the code I execute (does absolutely nothing):

i.Initialize("com.getpebble.action.SEND_NOTIFICATION","")
i.PutExtra("title",filep )
i.PutExtra("body",filep)
i.PutExtra("messageType","PEBBLE_ALERT" )
i.PutExtra("sender","espcards")
i.PutExtra("notificationData",filep)
p.SendBroadcastIntent(i)

Please help. Thank you,
Steve
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
The code you posted has a space in the word notification. Is this correct?

Regards
Mark
 
Upvote 0

seskindell

Active Member
Licensed User
Longtime User
I know about the space .. this web site puts a space automatically .... I tried to edit it but there is still a space in the post (But not in the source code).
 
Upvote 0

seskindell

Active Member
Licensed User
Longtime User
From what I have determined from a search on the internet PEBBLE_ALERT is the string "PEBBLE_ALERT"

- Steve
 
Upvote 0

seskindell

Active Member
Licensed User
Longtime User
Can somebody help me with converting the jason string to basic4android:

public void sendAlertToPebble()
{

final Intent i = new Intent("com.getpebble.action.SEND_NOTIFICATION");

final Map<String, Object> data = new HashMap<String, Object>();
data.put("title", getAlertTitle());
data.put("body", getAlertBody());
final JSONObject jsonData = new JSONObject(data);
final String notificationData = new JSONArray().put(jsonData).toString();

i.putExtra("messageType", PEBBLE_ALERT);
i.putExtra("sender", "MyAndroidApp");
i.putExtra("notificationData", notificationData);
sendBroadcast(i);
}

Thank you for any help.

- Steve
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
As the Java packages the JSON object as a JSON array you need to do this to get the equivalent JSON string.

B4X:
Dim json As JSONGenerator
Dim data As Map
Dim alist As List
data.Initialize
alist.Initialize
data.Put("title", "MyTitle" )
data.Put("body", "whatever")
alist.Add(data)
json.Initialize2(alist)
s = json.ToString
 
Upvote 0
Top