3. What is WebAPI?
ASP.NET Web API is a framework that makes it easy to
build HTTP services that reach a broad range of clients,
including browsers and mobile devices.
ASP.NET Web API is an ideal platform for building RESTful
applications on the .NET Framework.
REST – REpresentational State Transfer – HTTP GET, POST,
PUT, DELETE
4. WebAPI – IDE and Hosting
Visual Studio 2013-2015
Community Edition (Free)
Professional Edition (Paid)
Visual Studio Code
Mac, Linux, and Windows
Hosting
Any host that supports ASP.NET 4.5.x
Windows Azure is easy to set up
5. Creating a WebAPI Project
Standard Web Project
Add WebAPI
Add MVC if you wish to build a web
front-end to your API
8. Development Environment – Pebble not required
Pebble C SDK
Apple OSX – Xcode or other IDE
Linux – editor/IDE of choice
No Windows Support
Cryptic compiler error/warning
messages
Standalone Emulator
Allows you to link outside libraries
App configuration in .json file
CloudPebble
(http://cloudpebble.net)
Online IDE
Chrome browser on any platform
C, Pebble.js languages
Good, easy to understand compiler
errors/warnings
Browser-based emulator
No outside libraries supported
Easy app configuration
9. Language Support
JavaScript (Pebble.js)
Runs on phone
Requires active Bluetooth connection to Pebble App on phone
Supports:
WebSockets
XMLHttpRequest
Geolocation
LocalStorage
C
Runs on watch
Does not require connection to phone unless JavaScript is also used
14. JavaScript integration with C
Phone functionality (GPS, Internet, Weather, etc.) requires JavaScript
Must pass values between C code and JavaScript code using a dictionary
Steps to pass data:
Setup callbacks in C code
app_message_open() – C code that starts the process of requesting a message
Pebble.sendAppMessage() – Pebble.js code that actually sends the message
Uses a JavaScript object representing a simple dictionary containing the values you
wish to send
inbox_received_callback() – C code that processes call as a dictionary of
Tuples containing the data that was passed in
15. How do I make money with Pebble?
Pebble apps are all free on the
Pebble app store
Companion apps on Google Play or
Apple app store
16. Links
CloudPebble – http://www.cloudpebble.net
Discogs REST API – http://www.discogs.com/developers/
Settings Page Gist - https://gist.github.com/cerkit/c5e42de6016067d1d585
Getting started with WebAPI - http://goo.gl/FGk6gW
My personal blog – http://cerkit.com
@cerkit on Twitter