Developing for the AGENT smartwatch: Part 1

This entry is part 1 of 3 in the series Developing for the AGENT smartwatch
Tweet about this on TwitterShare on FacebookShare on RedditShare on Google+Email this to someonePin on Pinterest

 

Welcome to the first part of my series on developing apps and watchfaces for the AGENT smartwatch! Each part will cover a specific function, and will be relatively short. The target group is both people who have not coded before, and people that have coded, but not for the AGENT.

image

We will be coding in C#. Unfortunately, I cannot cover the whole language – so if you have never coded before, head on over to C# Fundamentals: Development for Absolute Beginners and watch the awesome series of C# videos.

What is the AGENT, and why should I care?

The AGENT is a smartwatch being developed by a company called SecretLabs. Before making the AGENT, SecretLabs developed the Netduino, which is an electronics development board running the .NET Micro Framework that allows even novice developers to get into the world of electronics. I have a bunch of tutorials on developing stuff for the Netduino.

a53b45f08030da177e0d342a1cc16718_large

So what is a smartwatch? Well, it is like a traditional watch, but has “smart” in the name. Basically, it is a watch that can do a whole bunch of cool stuff. Check out this AGENT video for brief overview of the features:

They raised money for it on Kickstarter, and the first watches should be shipped in December 2013.

The easiest way to think of the AGENT is to picture a tiny Netduino on your wrist, with a screen and Bluetooth module attached. Developers (YOU!) can code apps and watchfaces for it using C#, and the .NET Micro Framework.

Stuff you need

Before hacking away at a keyboard, you need to install the following three [free] things in order (yes, you need to be running Windows):
1) Visual Studio Express 2012 (or Visual Studio 2012)
2) .NET Micro Framework SDK v4.3
3) AGENT SDK v0.1.1 (June 2013, Preview Release)

Introduction to the interface

With those installed, go ahead and restart your PC, then open up Visual Studio Express 2012. If you have a full version of Visual Studio 2012 then you can use that. I am using the full version, so my screenshots might look slightly different to Express.

  • Visual Studio will look like this when first launched:
    image
    Except your will be lighter. If you want to make yours dark (causes less eye-strain) click Tools –> Options, and change the drop down box to Dark.
    image
  • To create a new project, click File –> New Project.
    A dialog box will come up listing the various project templates. On the left side, find Micro Framework. With Micro Framework selected, there will be two templates in the middle that we are interested in. AGENT Watch Application is used when creating an app for the watch, and AGENT Watch Face is used when creating a long-running watchface.
    image
    For now, select the Application template. At the bottom of the window you can change the Location to the folder where you want to store your projects, and change the Name to anything (don’t change Solution Name). Click OK.
  • On the right side of the screen we now have the Solution Explorer, which shows all the projects in your Solution, and all the files in each Project.
    image
    Double-click on Program.cs to open it.
  • By default there is a bunch of code here which will draw Hello World to the screen and then go to sleep (i.e. do nothing).
    image
    To begin with, most of your code will go in Program.cs
  • To test out applications without having an actual watch (because they are still being manufactured), SecretLabs has developed an emulator which will give you a pretty good idea of how your app runs, and allows you to interact with it via the watch buttons and Bluetooth. To launch your app in the emulator, simply press the Start button at the top of Visual Studio.
    image
  • The emulator will pop up and start loading up everything it needs. After a few seconds, your app will show up on the screen.
    image
  • To close it you can either press the red cross at the top right, or press the Stop button within Visual Studio (the red button).
    image

That’s it

Now that we’ve gone into the absolute basics we can do some actual code in part 2.

Series NavigationDeveloping for the AGENT smartwatch: Part 2 >>
Tweet about this on TwitterShare on FacebookShare on RedditShare on Google+Email this to someonePin on Pinterest
  • Kram

    hello im following your instructions and when I press start, the emulator dose not pop up….only a error at the bottom

    • RogueCode

      What is the error?

      • Kram

        Idk how do I find out….it just says error at the bottom