Aug 18, 2013 - Wrkout - Android App

Comments

I am now releasing a new Android application, Wrkout.


For fitness and sports fans to do their exercises in a guided, automated and timed manner.
Currently, it relies in the concept of high-intensity interval training (HIIT) which allows looping around multiple exercises with fixed rest and workout times, like Tabata.

Tabata is a form of high-intensity interval training based on a study by Izumi Tabata. It initially consisted of one exercise carried out intensively during 20 seconds with 10 seconds of rest after it. This exercise was looped 8 times, giving a total of 4 minutes.

It provides the ability for users to define/plan their own (multiple) workouts by defining lists of exercises and custom timings.

Wrkout is a featureful and supported version of Tabata Trainer, a free app which you can test and see if you like, prior to purchasing Wrkout.


Unique features provided by Wrkout in comparison to Tabata Trainer:

  • Definition of multiple workouts for quick selection;
  • Free reordering of exercises in each workout;
  • Definition of warm-up time and round rest time;
  • Countdown sounds (3, 2, 1)!

Features already provided by Tabata Trainer:

  • HIIT timer with start/pause/stop controls;
  • Definition of rest time, exercise time and number of rounds;
  • Definition of any number of exercises, with textual descriptions, that form a custom workout;
  • Text-to-speech engine to read exercises' names to guide users throughout their workouts;
  • Sound alerts: Resting; Exercising; Darth Vader breath stimulator; Workout completed;
  • Supported languages: English, Portuguese, Spanish, Italian and French;
  • No ads and no special access permissions required;
  • Sound, speech and the display's sleeping mode are configurable;
  • Horizontal layout and Tablet support;
  • Settings;
  • Customizable sounds;
  • Ability to disable the background gradient.
[the list of features was last updated on November 2013 and is now outdated, please check the changelog.]

    You can start using Wrkout via Google Play Store for a one-time only fee.

    If you just want to try Tabata Trainer for free, you can also get it via Google Play Store or Amazon Appstore.

    Wrkout has been mentioned in the following websites:
    Facebook
    Google+
    Twitter

    May 22, 2013 - Android latest SDK: java.lang.ClassNotFoundException

    Comments

    Since the latest Android SDK revision (22) it is possible to get java.lang.ClassNotFoundException or other unexpected errors with Eclipse, for instance when making use of one Android project in another Android project.


    An example of failure can also be found when trying to use the Android support library:

    05-22 19:49:46.240: E/AndroidRuntime(4094): Caused by: java.lang.NoClassDefFoundError: android.support.v4.app.NotificationCompat$Builder

    To fix this, developers must now explicitly export the Android Private Libraries.

    Fix:

    Open the properties of your Android projects (even the ones that are included by other projects), select Java Build Path, Order and Export, and finally check Android Private Libraries.

    May 10, 2013 - Cloud Endpoints + JPA: failure in checking if entity exists

    Comments

    After defining some entity classes to be used by JPA for persisting data in Google App Engine I auto-generated some Cloud Endpoint classes (for Google Cloud Endpoints), via the Google App Engine SDK, to be used in an Android application. However, it turned out to be a sad out-of-the-box experience due to new entity instances having a null ID.

    Before proceeding, here's the testing entity code (excluding imports):

    @Entity
    public class Testo {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long ID;
    private String description;

    public Long getID() {
    return ID;
    }
    public void setID(Long ID) {
    this.ID = ID;
    }
    public String getDescription() {
    return description;
    }
    public void setDescription(String description) {
    this.description = description;
    }
    }

    A really simple one.

    To test the entity and the endpoint classes, I auto-generated the Cloud Endpoint Client Library and made use of it in an Android testing application (Endpoints Backend enabled). The application would only create a new entity, set its attributes to some value, and then request to insert that entity into the datastore, using Google Cloud Endpoints in the middle.

    After testing it up, though, I got a big stack trace from the Google development server due to a NullPointerException that occurred when checking if that entity existed in the datastore.

    The exception referred to the fact that no entity ID was set. So, if new entities don't have an ID, how can they be checked for existence requiring a valid ID?

    The point of failure
    (at least in my specific case)

    The endpoint class TestoEndpoint.java, auto-generated method: containsTesto(Testo testo):
    private boolean containsTesto(Testo testo) {
    EntityManager mgr = getEntityManager();
    boolean contains = true;
    try {
    Testo item = mgr.find(Testo.class, testo.getID());
    if (item == null) {
    contains = false;
    }
    } finally {
    mgr.close();
    }
    return contains;
    }

    This method makes use of the Entity Manager's find() method, which in this context takes a null ID and crashes, not even being able to tell if the datastore contains or not that entity.

    What I changed

    To work around this annoying problem I added a null check for the entity argument:

    private boolean containsTesto(Testo testo) {
    EntityManager mgr = getEntityManager();
    boolean contains = true;
    try {
    // If no ID was set, the entity doesn't exist yet.
    if(testo.getID() == null)
    return false;

    Testo item = mgr.find(Testo.class, testo.getID());
    if (item == null) {
    contains = false;
    }
    } finally {
    mgr.close();
    }
    return contains;
    }

    Some links: