My very first published Android app!

So I finally got round to releasing an app of my own on the Google play store, it’s nothing amazing but might come in handy to a few developers out there. It’s an app that generates a valid South African ID number, which will pass the validation checks that some websites need.

Inspired by Evans chrome extension, I decided to turn it into an Android app.

You can find the app here :
Download

Screenshot_2014-03-28-12-47-33 Screenshot_2014-03-28-12-47-11

A Robotic Guide Dog and Why its a Bad Idea

For my honours dissertation, I decided to undertake a project involving the programming of a Lego Mindstorm Robot. Granted, this blog post is a bit late (2  years later!), but I figured I’d share my experiences so that someone doesn’t attempt the same 🙂 .The outcome of the application was to have a robotic “guide dog” that a blind user would be able to follow. This was purely a concept, as anyone following this robot would probably have died 3 times over 🙂 But a concept none the less.

Lessons Learnt from this project:

  • Microsoft Robotics Studio is a terrible idea.
  • Lego Mindstorm robots are pretty pathetic in their abilities, they are good for basic stuff, but as soon as you want to go into complex object avoidance algorithms, they pretty much fail dismally.
  • Real world vs Theoretic world are two completely different things. When somebody says “Theoretically this should work”, DO NOT believe them.
  • Its better to simulate real life than to actual be in it.

In the end I had 3 components to the system, in the end.

1. An android application that would take in voice commands and determine whether the robot should stop, turn around, left, right etc.

2. The robotic dog

3. A desktop application which issued commands to the robot via Bluetooth, and connects to the android phone via bluetooth.

Ideally, I would have liked to have the application running entirely on the robot, but unfortunately the Lego Mindstorm robot had a tiny amount of memory (maybe the choice of a raspberry pi would have been a better option?).
So the lesson learnt from this experience, a robotic dog is a bad idea for a blind person, and perhaps something like a ultrasound device that you wear would be a better choice than a physical robot that a user would have to carry.

Regardless, below is an example video of how the robot detected obstacles and moved around them.

This video wasn’t the final version, as the final version had the voice commands controlling the robot 😀

Calories Burnt Calculation for Walking or Running in Java

Its surprisingly difficult to find a calorie calculation for Java for performing a number of steps at a certain speed. Based on the Compendium of Physical Activities (https://sites.google.com/site/compendiumofphysicalactivities/corrected-mets )  and using Corrected METS, I have converted the formulas on their website into Java code! I found the website particularly difficult to read as it did not have brackets in the right places to ensure that the calculations were correct. Hopefully I can save someone the hassle of having to wonder what is going on with all their formulas.

Simple Printing in Android to a Network Printer

So for a few days I have been researching how to send a document to a network printer without using any third party libraries in android. This sounds like a simple task but by default Android doesn’t offer this service, sure there are loads of apps that can do it but this took me a while to find, and I think someone else may find it useful one day.

I made use of an AsyncTask so as not to tie up the UI thread. In the doInBackground method, the following simple code helped me achieve printing to a network printer.

This code will allow for sending PDF files, PCL files and PS files directly to the printer by using Sockets. The default port for most printers is 9100. You will also need to know the IP Address of the printer.

This code might not work with all printers but it worked with 2 different brands that I tried it with.

Basic Controls of Lego Mindstorm NXT 2.0

So after the past two days of trying countless tutorials on the web, I decided to sift through the Microsoft articles to see if I could understand their code, and what happened? Success.


I managed to look at the Drive by wire tutorial on Microsoft (http://msdn.microsoft.com/en-us/library/bb483053.aspx).


Basically I first created a DSS Service 4.0 in VS2010, added the partners of the Lego NXT brick (very basic ones, just the Drive Operation and Brick basically) – made sure to select Add Notification Port and then built the solution. Then opened it up in DSS Manifest Editor and followed the blog here http://blogs.gokulnath.com/default.aspx#a4831ceeb-722c-4872-8d31-275b773c9e8a to edit and set up my Manifest file.


Next, I used Microsofts Drive By Wire Tutorial, which is very clever as you create an abstract class that can be then used with any Manifest file that implements the required services, so if your Lego Robot breaks – you can easily use the simulated environment to showcase your skills.


Any ways, I now have a moving robot that can be controlled by bluetooth and simple up, down, left, right and stop commands.


I have accomplished something today. Time for bed.