Posts Tagged API

Garmin Communicator Plugin API released

Looks like Garmin is starting to release it’s APIs to the public.

This is something that a lot of the posts on the developer forum have been looking for. I have been looking at the slightly hidden Garmin Connect Webservice API’s (http://connect.garmin.com/proxy/activity-service-1.2/) lately and there are lots of great things that can been done with them. Anyone that has a Garmin Forerunner 405 watch will know how great the great the Garmin connect website is. You can analyse your run, down to the nth degree. Great for any ‘Stats heads’ out there. Using the Garmin connect API’s you can now view your Garmin connect content via a JSON rest request to their API.

More details on the Garmin Connect plugin can be found here but here is an over view of the Architecture:

The Garmin Communicator API is a JavaScript framework that hides the details of working directly with the underlying browser plugin. It consists of three tiers, each more user-friendly than the one it builds on.
The easiest to use is the DeviceDisplay which can be added to a web site with just a few lines of configuration code. The next tier down is the DeviceControl which is for JavaScript programmers who need more control over the event model. Lastly the DevicePlugin is a low-level plugin wrapper for developers who need bare-metal access.

, , , , ,

No Comments

The Android Thread Police are coming….

As part of the Gingerbread release of android, a new API, StrictMode will allow developers to set a policy on a thread.

StrictMode is most commonly used to catch accidental disk or network access on the application’s main thread, where UI operations are received and animations take place. Keeping disk and network operations off the main thread makes for much smoother, more responsive applications. By keeping your application’s main thread responsive, you also prevent ANR dialogs from being shown to users.

StrictMode will only come into play if you select it and allows you to detect the following situations:

  • detect disk writes
  • detect disk reads
  • detect network usage
  • on a violation: log
  • on a violation: crash
  • on a violation: dropbox
  • on a violation: show an annoying dialog

Enabling StrictMode

StrictMode can be enabled in your applications onCreate method

public void onCreate() {
     if (DEVELOPER_MODE) {
         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                 .detectDiskReads()
                 .detectDiskWrites()
                 .detectNetwork()
                 .penaltyLog()
                 .build());
     }
     super.onCreate();
 }

This blog post on the Android Developers blog by Brad Fitzpatrick will give you an overview of what you can expect. You can also check out the StrictMode API here for more details on what it allows.

, , , ,

No Comments