mobialia


Slot Racing 10th anniversary

This year marks the 10th anniversary of my Slot Racing Android game. I had initially begun working on a 2.0 version, but I couldn’t find the time. A few months ago, I decided to merge the changes back into the previous app and prepare the Slot Racing 10th Anniversary edition:

In this version, I’ve removed the no-longer-functional Facebook integration and replaced it with device IDs for the leaderboard. Users can now choose any username for the times they send from their device.

One significant improvement is not immediately visible. I’ve upgraded from an old JMini3d (OpenGL 1.1) to the latest version using OpenGL 2.0. This enables the use of bitmap fonts allowing races with more than 5 laps (the old version only had textures for numbers 1 to 5).

Over the last 10 years, I’ve learned a lot about development. The code looked horrible for today’s standards, so I did a major code refactor. It now supports various race types, adding races against the chronometer.

A minor physics adjustment has been made to prevent users from taking very tight turns at full throttle, which has rendered all previous leaderboard times invalid. Additionally, the leaderboards now differentiate between each lane and the number of laps completed.

During last summer’s holidays, I added new circuits and seasons, including tracks from the current F1 season and Le Mans. Today, I’m applying the final touches to the Bluetooth code and I expect to release it soon.


LaretasGeek AMA

Los compañeros de LaretasGeek (https://twitter.com/laretasgeek) están llevando a cabo una iniciativa de entrevistas en cadena “AMA” (Ask Me Anything) en la que el entrevistado de cada semana escoge a un invitado y lo entrevista la semana siguiente.

En esta cadena de entrevistas, Eloy Coto de Red Hat escogió entrevistarme a mí, y esta fue la entrevista:

https://www.youtube.com/watch?v=aJkifnWjug0

Una semana después, yo escogí entrevistar a Antón Román, CTO de Quobis, y nos quedó otra entrevista muy chula:

https://www.youtube.com/watch?v=jvFiG1ukAWc


Improving Carballo Chess Engine the hard way

torneo_ajedrez

One year ago my Carballo Chess Engine (https://github.com/albertoruibal/carballo) was stuck: all the improvements that I was trying were not working, and I detected the main problem: I am a poor chess player so I will never be a good chess engine developer. I thought that the main chess programming skill was statistical analysis and not chess knowledge, but I was wrong.

So, I took the decision of starting to learn and play chess. I joined the local chess club Xadrez Ramiro Sabell (http://www.xadrezramirosabell.com) and I was so lucky that in this club teaches chess the International Master Yudania Hernández Estevez. It’s quite curious the amazing people that you can find in a small city like Ponteareas. I also try to help the club in the tournaments organization and with a small Mobialia sponsorship. Now I am playing the Galician Chess League (in third division) and all the tournaments that I can.

My chess level is improving fast (ok, I’m under 1600 ELO yet: http://ratings.fide.com/card.phtml?event=24597015), but the real deal is that the Carballo Chess Engine strength is improving much faster, climbing positions in the CCRL list (http://www.computerchess.org.uk/ccrl/4040/). Learning chess helps me to diagnose the flaws and to understand better what’s going on under the hood.

Finally,  playing chess also helps me to detect the chess player needs, so I realized the main missing feature from Mobialia Chess: a chess database to review historic games and to analyze your own games searching statistics for each position. This year I worked to implement this feature and starting today you can access a Beta version of the database in Mobialia Chess Web (http://chess.mobialia.com).


MobileCONGalicia 2011

El viernes pasado, y gracias a la iniciativa de María Encinar (@encinar) y Martín Pérez (@mpermar), se llevó a cabo el primer evento para desarrolladores móviles en Galicia: MobileCONGalicia.

Las ponencias fueron de los más variado, tuvimos a:

  • Eugenio Estrada (@eugenioestrada) un crack de Windows Phone nos metió a todos el gusanillo de desarrollar en WP
  • Alberto Gimeno (@gimenete), desarrollador iOS nos habló de posibilidades de monetización de apps
  • Elena Pérez (@ilnuska) experta en interfaces de usuario en @SpartanBits, puso a caldo (con conocimiento de causa) al equipo de diseñadores de Android
  • Ricardo Varela (@phobeo), experimentado desarrollador curtido en 1000 batallas, habló de APIs móviles
  • Martín Pérez (@mpermar), nos habló de Tropo, Phono y otras APIs de telefonía dándonos grandes ideas de oportunidades de negocio
  • Hermes Piqué (@hpique) experimentado desarrollador Android e iOS que nos habló de Unit Testing
  • Jordi Bonet de Softonic explicó como han reinventado su negocio orientándolo hacia las descargas móviles
  • Finalmente, Nacho Sanchez nos contó su experiencia empresarial en @InqBarna desarrollando apps

Algunas de las presentaciones se pueden visualizar aquí

Yo participé con una ponencia sobre Android, y como la entrada al evento eran 25 euros (una ganga por cierto), hice una presentación con mis 25 consejos para los que comienzan a desarrollar; ya sabéis, a euro por consejo:

El evento terminó con un AppCircus del que fuí jurado junto con Miguel Sílva (@MSilvaConstenla de @Blusens, Elena (@Ilnuska) de @SpartanBits y Nacho de @INQBarna. Estas fueron las aplicaciones que se presentaron:

  • PictoDroid: Excelente aplicación Android para permitir a las aplicaciones con problemas de expresión comunicarse mediante pictogramas
  • Mussage: Aplicación IOS que permite enviar mensajes con canciones que están en la biblioteca del receptor
  • Chove: Completo radar de lluvia para españa en Android
  • Extremadura Rural: Guía offline de alojamientos rurales en Extremadura
  • ReallyLateBooking: Aplicación IOS y Android para buscar ofertas de hoteles en el mismo día
  • Binaurality: Método para aprender inglés basado en la escucha binaural para IOS y Android
  • Bits4Meetings: Iniciativa para proporcionar un sistema de creación de aplicaciones para eventos personalizadas (de los creadores de Ipoki!)
  • Berokyo: Aplicación iOS que permite organizar en estanterías documentos, contactos y medios digitales, sincronizándolos con DropBox
  • Obradoiros Abertos: Aplicación que ofrece información geolocalizada de talleres, tiendas y puntos de interés de artesanía gallega.
  • Absolute Defense: un shot’em up de gran calidad al más puro estilo R-Type

El nivel de las aplicaciones presentadas fué muy bueno. La app ganadora fue ReallyLateBooking, y la finalista Berokyo, esperamos haber sido justos. Mención especial me merece la presentación de Juan Porta de la aplicación Chove!, un tremendo showman más puro estilo gallego, que nos hizo pasar un momento estupendo, pena que no nos dejaran valorar la presentación.

Referencias en prensa/blogs:

Por si fuera poco y gracias a Blusens, tuvimos una fiesta del evento en una discoteca Santiaguesa, que se adentró en altas horas de la madrugada… Atención al detalle del gorro de Android de @IronSil, y curioso el efecto de “Ojos Blancos” de la cámara del Galaxy Nexus.


Google DevFest 2011 BCN

This week I assisted to the Google DevFest 2011 Barcelona. This year it was celebrated on a great “garage” located on an industrial area of Barcelona. I will tell the more interesting things that I found on the different sessions:

NEW IN HTML

As usual, this session presented by Paul Kinlan showed us the future of HTML5. I love the x-webkit-speech Chrome feature to make voice inputs that we already could see on the Madrid DevFest 2010. Paul made also some demos of WebIntents  a great idea to make something similar to Android intents on the web. Finally we could see that HTML5 is advancing very fast trying to implement many APIS that will make Flash obsolete, like window.navigator.getUserMedia() ot the Web Audio API.

GLSL

This session was presented by Mr. doob aka. Ricardo Cabello, a guy from the demoscene. He made a introduction of how 3D works in the browser and showed us how to use the GLSL language to make great effects on web pages. He has those GLSL demos on his blog.

GOOGLE+ SESSIONS

There were two Google+ sessions driven by Ade Oshineye, one presenting the new social network (also announcing the Google+ Pages) and other with more technical details for developers. One thing that you can do easily is adding the +1 button to your site. Other very interesting tools that we could see were the Google APIs Console and the Google APIs Explorer.

ANDROID SESSIONS

Bruno Oliveira is replacing Reto Meier as our “Android Developer Relations”.  On the first session he made a great review of the Android platform evolution since 2.1 to 4.0. On the second session he gave us great tips to improve UX experience on Android. This guy is a showman!

MAKING A BUSSINESS OUT OF APPS

This session was presented by Paul Kinlan and Bruno Oliveira, showing us that monetization tips are valid for both web and Android apps: Lazy registration, try before you buy, easy payment, in-app payments… Bruno also presented the new multilingual “Guide to the App Galaxy” http://www.guidetotheappgalaxy.com/.

GOOGLE SHOPPING API

Daniel Hermes showed us the Google Shopping API and many integration samples.

CHROME DEV TOOLS

Finally Sam Dutton made a review of the Google Chrome development tools. This tools replaced my FireBug many years ago! He also made his slides available.

APP COMPETITION

This year Google also organized and Appcircus-style app competition. Those were the apps and sites presented:

I won the app competition, but all were great apps. Our presentation and some photos of the app competition are available at our Mobialia Blog.


Mobile 2.0 Open Ideas

This year I was invited to organize a workshop at the Mobile 2.0 Open Ideas event at Barcelona, on 16-17 June. With my experience developing Android apps at Mobialia and the social media integration on Martin Varsavsky’s RadioMe, I proposed the workshop:

Bulding Social Media Enabled Android Apps

This will be a 1-hour workshop In which I’ll provide some examples on how to integrate social media on Android apps, from the simple “Share” button to more complex integrations like using Twitter, LinkedIn or Facebook APIs, including logging-in with social media, the “Like” button, etc.

I will try to do it interesting for developers and also for app designers who want to add cool social features to their apps. Slides and code samples will be available from the day of the event.


SobrosoParty 2011

Hoxe sábado ás 18 horas repetimos o laboratorio de Android “A Miña Primera Aplicación Android” na SobrosoParty no Pavillón Municipal de Ponteareas. Neste taller usaremos como exemplo a aplicación WikiPlaces para explicar cales son os pasos da creación dunha aplicación Android, dende a instalación do SDK e a configuración do Eclipse ata a súa publicación no Android Market.

Esta aplicación ten moitos exemplos de cousas típicas na programación de Android:

  • Deseño de layouts
  • Obte-la ubicación
  • Amosar un mapa e usar overlays para representar información sobre él
  • Amosar unha lista utilizando adapters
  • Obter datos de servidores externos
  • Usar intents para lanzar outras aplicacións dende a nosa
  • Introducción de Anuncios de AdMob

Tentaremos condensa-lo taller en dúas horas que é pouco tempo, xa que no último LabAndroid en Málaga seis horas non chegaron para moito, pero como creo que non vai haber nen enchufes nen ordenadores para todos tentaremos facelo un pouco máis xeral.

Para asistir a este taller non fai falta estar incribito na SobrosoParty (que ten só 300 plazas), con dicirlle a persoa de seguridade que se vai asistir ó taller de Android non debería haber problema en pasar.

Notas de prensa:


Mobialia at LabAndroid

This week I was speaking at LabAndroid, a spanish initiative about Android devices, apps and development.

I developed a special app for this event called “Wikiplaces” and I made the code avaiable as open source on Google Code.

This app shows on a map or on a list places from Wikipedia near your location. I tried to include on it small code snippets for common things like styles on layouts, obtaining location, launching Google Maps Navigation, etc.


Dealing with the “Bitmap Size Exceeds VM Budget” error

One of the most common errors that I found developing Android Apps is the “java.lang.OutOfMemoryError: Bitmap Size Exceeds VM Budget” error. I found this error frecuently on activities using lots of bitmaps after changing orientation: the Activity is destroyed, created again and the layouts are “inflated” from the XML consuming the VM memory avaiable for bitmaps.

Bitmaps on the previous activity layout are not properly deallocated by the garbage collector because they have crossed references to their activity. After many experiments I found a quite good solution for this problem.

First, set the “id” attribute on the parent view of your XML layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:id="@+id/RootView"
>
...

Then, on the onDestroy()  method of your Activity, call the unbindDrawables() method passing a refence to the parent View and then do a System.gc()

@Override
protected void onDestroy() {
	super.onDestroy();

	unbindDrawables(findViewById(R.id.RootView));
	System.gc();
}

private void unbindDrawables(View view) {
	if (view.getBackground() != null) {
		view.getBackground().setCallback(null);
	}
	if (view instanceof ViewGroup) {
		for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
			unbindDrawables(((ViewGroup) view).getChildAt(i));
		}
		((ViewGroup) view).removeAllViews();
	}
}

This unbindDrawables() method explores the view tree recursively and:

  • Removes callbacks on all the background drawables
  • Removes childs on every viewgroup

This solved the problem on many of our Mobialia apps.

UPDATE 2011-03-30:

Today @luiskap from SpartanBits told me another good solution: if you don’t need different layouts for portrait and landscape modes, you can make your activity react to orientation changes (avoiding activity destroy) adding to your activity’s manifest: android:configChanges="keyboardHidden|orientation" and overriding the onConfigurationChanged method, calling setContentView reusing the already created views. There is a good explanation on StackOverflow.


Find Android apps with AppBrain

One of the first things that you can notice after buying an android phone is the great amount of mobile applications (apps) that you can download from the Android Market, but searching for a specific app can be very frustating, and a time-consuming task.

This is due to one of the biggest problems of the Android Market: the lack of a complete web interface to query the applications avaiable, and AppBrain is an independent web (not affiliated with Google) where you can list, search, etc. those apps.

There are many similar webs: Cyrket, Bubiloop, but Appbrain has some features which make the difference:

  • You can sign-in on the web with your Google account
  • Apps can be queried by country, genre (of the user), age range, etc.
  • You can create list of apps and share it with your friends
  • There is an android app (search for AppBrain on the Android Market) to synchronize your mobile with appbrain, and once installed:
  • You can query the installed apps on your mobile
  • You can install apps from the web

And everything with a very simple and pretty interface, so don’t wait to try it:

http://www.appbrain.com