NicholasKhongg
NicholasKhongg

Reputation: 25

Android and windows application communication

In short, for example, I am trying to light up a LED connected to my RaspberryPi2 running on Win10IOT after I press a button on my Android application.

What are some ways I can achieve this?

What I have thought of is to have a column in my azure database, when the value is 1, the LED will light up, 0 the LED will not light up. But, how can I make my RP2 application know when the value of the column changes from 0 to 1 to light up the LED?

Upvotes: 0

Views: 424

Answers (1)

Steven Hook
Steven Hook

Reputation: 902

There are really an infinite number of ways you can have these two devices talk to each other. Since you mentioned Azure, a very common scenario in Azure is to use an Azure Service Bus Queue. Your Android application (or any application) would send a message to the queue. Then your Raspberry Pi 2 (or any device) would read from that queue and process the message. In your case, that's just to turn on or off the LED. It's a pretty simple process from a code perspective. I have an example of some similar communication where I invoked changes to my keyboard lighting from a Slack chat message.

You can read the walkthrough of how to do that at http://hookscode.com/slack-to-azure-to-my-keyboard/ you probably only care about the Azure Service Bus Queue section and below.

You can also just take a look at the code https://github.com/swhook52/chroma-commands

Or you can research more about Azure Service Bus Queues at https://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-queues/

Upvotes: 1

Related Questions