Will B4a support Pebble watch or Ooya?

NeoTechni

Well-Known Member
Licensed User
Longtime User
B4X:
Sub SendAlertToPebble(ThisAppsName As String, Header As String, Body As String)
   Dim I As Intent,P As Phone, JSON As String ' , JSON As JSONGenerator , M As Map , alist As List
   I.Initialize("com.getpebble.action.SEND_NOTIFICATION", "")
   'SendAlertToPebble: [{"body":"TEST","title":"LCARS"}]
   'alist.Initialize
   'M.Initialize 
   'M.put("title", Header)
   'M.put("body", Body)
   'alist.Add(M)
   'JSON.Initialize2(alist)
   JSON = "[{""body"":""" & Body & """,""title"":""" & Header & """}]"
   I.putExtra("messageType", "PEBBLE_ALERT")
   I.putExtra("sender", ThisAppsName)
   I.putExtra("notificationData", JSON )
   'Log("SendAlertToPebble: " & JSON.ToString)
   P.SendBroadcastIntent(I)
End Sub

No JSON library needed. Feel free to delete the commented-out code
 
Upvote 0
Top