OUYA Version Checker Library

0 Comments

One thing the OUYA SDK is missing is an easy way to check and notify your users when there is a new version of your application on the OUYA Discover store, but that is an issue no more. I put together an OUYA version checker library which developers can use to do just this and all it takes is three “I”s; include, initialize and indicate. This library uses the OUYA web API and the applications built-in version number to calculate if an update is available, the only catch is the version numbers have to match the #.#.# format, though you can use up to 5 sub version numbers (# to #.#.#.#.#).

Basic Usage

Include the libraryJava

import in.progressivethink.ouya.ouyaversionchecker.*;

Initialize

OUYAVersionChecker.init(getApplicationContext());
OUYAVersionChecker.check();

Indicate

while(OUYAVersionChecker.isUpdateAvailable() == OUYAVersionChecker.UpdateStatus.UNKNOWN){
    // sleep your thread for a second and wait for a reply
}

// Now we have a reply do something with it
if (OUYAVersionChecker.isUpdateAvailable() == OUYAVersionChecker.UpdateStatus.TRUE){
    // An update is available do something snazzy
}

That is all the code you need to facilitate update messages on your application everytime you publish a new version of your application on the OUYA Store.

Extra Functionality

Enable/Disable Debug MessagesJava

// To enable the output of debug messages
OUYAVersionChecker.enableDebuging();

// To disable the output of debug messages
OUYAVersionChecker.disableDebuging();

Updating Outside of the OUYA Store

// Do this before you call OUYAVersionChecker.check()
OUYAVersionChecker.setUpdateSource("http://your.server.here/version.txt",OUYAVersionChecker.UpdateSource.STRING);

// The contents of version.txt should be ONLY a version number on a single line (Ex. 1.5.4)

Download ouya-version-checker.jar

- By: Posted on:

Comments

Small ad here
Select a size at which to preview the size