AzureMobileService (community library)

Summary

Name Value
Name AzureMobileService
Version 0.0.3
Installs 445
License GPL
Author Brian Sherwin github:bsherwin; Paul DeCarlo github:toolboc; Bill Fink github:WhatsTheBigIT
URL https://github.com/dxhackers/azuremobilespark
Repository https://github.com/dxhackers/azuremobilespark.git
Download .tar.gz
All Versions 0.0.3, 0.0.2, 0.0.1

Simplify getting data to Azure Mobile Services

Example Build Testing

Device OS Version:

This table is generated from an automated build. Success only indicates that the code compiled successfully.

Library Read Me

This content is provided by the library maintainer and has not been validated or approved.

AzureMobileSpark

Library for abstracting Azure Mobile Services REST Api for the Spark.Core.

Resources

https://msdn.microsoft.com/en-us/library/azure/jj710108.aspx

Phase

V1 (Ease of Interaction with Mobile Service Operations)

  • Login
  • Mobile Service Functionality
  • User required to build JSON string
ams.insert("Table", valueString);

V2 (Data Enhancement)

  • User builds key dictionary, provide simpler posting of data
dictionary.Add("Key", "Value");
azure.insertdata("table", dictionary);

Requirements

Functionality - Create, Read, Update, Destroy handled using HttpClient

  • Create(Table, JSONData)
  • Read(Table)
  • Update(Table, ID, JSONData)
  • Destroy(Table, ID)

Other

  • Azure string builder - abstracted away to create connections to service
  • Error - receive http codes and act appropriately
  • Data - JSON payload builder

Configuration - Mobile Service Name and Mobile Service Key

Implementation

#include "HttpClient/HttpClient.h"
#include "AzureMobileService/AzureMobileServices.h"

AzureMobileServices ams;
String azureKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
String azureUrl = "MyAzureMobileServiceName";

int button = D6;

void setup() {
ams.configure(MYSERVICE, MYKEY);
pinMode(button, INPUT_PULLUP);
}

void loop() {
if (digitalRead(button) == LOW) {
sendDataToAzure("pushed a button at: " + Time.now());
}
}

void sendDataToAzure(String message) {
ams.create("TableName", "{\"text\":\"" + message +"\}");
}

Browse Library Files