Nov 26, 2013 - JBoss ESB JMS client

Comments

In case you have followed this guide and are now wondering how to run the client, here'a a little tip to prevent you from wasting more time.


If you've created the SendJMSMessage.java inside the same project and ran it as a Java Application, then you probably got something that included this:

Caused by: java.lang.ClassNotFoundException: org.jboss.aop.metadata.ClassMetaDataLoader
or this:
Caused by: java.lang.ClassNotFoundException: org.jboss.aop.pointcut.PointcutStats
or even this:
Caused by: java.lang.ClassNotFoundException: org.jboss.aop.metadata.Pointcut

You should create a new Java Project with the SendJMSMessage.java, then go to the project properties and, instead of including every jar in the Java Build Path (as explained here), add two libraries: 1) JBoss ESB Libraries and 2) Server Runtime. The server runtime will be the previously created JBoss server runtime.

Then run this project as a Java Application and it should work.

In case your wondering what software versions I've used and so on, here are they:

  • Eclipse Helios (3.6.2);
  • JBoss Tools 3.2.x installed via Eclipse Marketplace;
  • JBoss ESB Server 4.10;
  • added JBoss Server Runtime as version 5.1;

Links:

JBoss ESB tutorial
he HelloWorld in the JBoss Enterprise Service Bus

Oct 6, 2013 - Rooting Memup SlidePad NG 808DC

Comments

After noticing there were no known methods of rooting the tablet Memup SlidePad NG 808DC (the methods for the other models did not work with this one), I took some hours off in the past 20th of July to check how hard it could be. It seems it's actually pretty easy and, finally, I'm going to post my method. Although the first root method on the web specific for this tablet, it may work for similar devices as well, but that's on your own responsibility.


Para traduzir para português utilizar o controlo à direita da página.
Pour traduire français utiliser le commande vers la droite de la page.




The following steps assume you know how to flash a ROM to your SlidePad, as well as using ADB to get the tablet's shell.

Pre-requisites: If not already, flash the original 4.1.1 ROM provided in the french memup website: http://www.memup.net/support/fr/produit.php?id_produit=112; ADB must be installed in your computer (http://www.howtogeek.com/125769/how-to-install-and-use-abd-the-android-debug-bridge-utility/http://pplware.sapo.pt/smartphones-tablets/android/como-usar-o-android-debug-bridge-adb/);

Step 1: Make sure /usr/xbin/su must already exists, the original 4.1.1 ROM provides it, so it's okay;

Step 2: Download http://download.clockworkmod.com/superuser/superuser.zip;

Step 3: Get the "su" binary from superuser.zip/armeabi to the SD card (/storage/sdcard0/external_sdcard);

Step 4: Enter the tablet's shell, using the command adb shell;

Step 5: Go root in the shell, using the command su;

Step 6: Backup /system/xbin/su, using cp /system/xbin/su /system/xbin/su.bak;

Step 7: Replace the system's "su" with the SD card one, using cp /storage/sdcard0/external_sdcard/su /system/xbin/su and then, chmod 6755 /system/xbin/su;

Step 8: Install Superuser APK (ClockworkMod's one) from the superuser.zip or Play Store;

Step 9: Run Superuser and let it update the "su" binary if a newer version is available;

Done!

You're welcome to ask for any clarification on the steps above.
Originally written on 20th July 2013, posted on 6th October 2013.

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:

    May 5, 2013 - Tabata Trainer - Android App

    Comments

    Today I released my first Android application, Tabata Trainer.
    Developing this app has made learning Android development a very pleasant experience, while at the same time adding something new to the mobile ecosystem.

    This app aims at providing a way for Tabata practitioners and general sports fans to do their exercises in an appropriate and automated timely manner. It also provides the ability for users to define/plan their own training exercises and times. More features are planned for next releases!

    Tabata is a form of high-intensity interval training (HIIT) 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.

    Summary of features:
    • Tabata timer;
    • Start/pause/stop controls;
    • Definition of rest and exercise time;
    • Definition of the number of rounds;
    • Definition of any number of exercises, with textual descriptions, that form a custom training/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;
    • English (UK) and Portuguese (Portugal) text languages supported;
    • Text-to-speech in Portuguese is not available due to lack of support from Android;
    • No ads and no special access permissions required;
    • Sound, speech and display sleeping mode configurable;
    • Ability to share current workout;
    • 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.]

      If you are willing to do some working out with this application, head over to the Tabata Trainer's Play Store page or Amazon Appstore and give it a try!

      Tabata Trainer has been mentioned in the following websites: