Developing for Android is really fun, as you have probably noticed if you want to have a wide user base you will have to give your application for free on the Android Market. From there, you have different way to monetize your application, you can limit features and unlock them in a payed version, display ads in free version and provide a way to disable ads (in-app purchase for example). In this article I will explain how to detect ad blocking in your applications.

This post is only available in French

A qui est destiné ce document

Ce document est à l'attention des développeurs ayant de bonnes connaissances techniques. En revanche il est intéressant pour un chef de projet de connaître les généralités énoncées dans la première partie du document.


Qu'est ce qu'un test unitaire

D'après Wikipédia :

En programmation informatique, le test unitaire est un procédé permettant de s'assurer du fonctionnement correct d'une partie déterminée d'un logiciel ou d'une portion d'un programme (appelée « unité » ou « module »). On écrit un test pour confronter une réalisation à sa spécification.
Ils consistent en liste de tests à valider afin d'être conforme à la documentation fonctionnelle. Ces tests doivent être exécutés le plus souvent possible au cours de la réalisation, en effet ils permettent en autre de mettre en évidence toutes régression dans le processus de développement.

I am one of the lucky guys getting this hyped discontinued tablet from HP at the lowest price. I'll sum up here few things I did on it.

First impressions

I am an iPad owner for almost a year now, so I have my habits and I now know that tablets are mainly useful for consuming content (producing content is not really convenient when you have to use the virtual keyboard). The Touchpad is really what you expect from a tablet, full web consuming, multitasking, flash support, at a really decent speed.

Continuous delivery

After Continuous Integration, this is the word we see on the web these days. Its meaning is really simple, it consists in reducing steps in application deployment. In order to do so a set of tools actually exists, you can use the same PaaS images (thanks to the newcomer Micro Cloud Foundry by VMWare or use a special amazon ec2 instance) to have a development environment similar to production one. And you can use Chef to manage and automate your configuration. While these alternatives are really interesting, I think they are way too powerful and difficult to setup in simple cases.
I will explain my "simple" solution based on maven, shell scripts and hostname detection.

Example release archive

An example is better than a thousand words, you will find an example of my solution in a github repository Easy Release Archive. It is a maven project building a zip artifact containing everything to be deployed, and an example script to setup the Glassfish server.

What is inside ?

To understand how it works, the best thing is to look what's inside.

  • an assembly.xml file describing the files to include and their output name and location.
  • a few scripts in /src/main/resources
    • : helper script sourcing the correct variables depending on the hostname of the machine and ensuring variables are correctly setup
    • : a sample script used to setup a Glassfish server with its required datasources and other parameters
    • a global folder containing global configuration files
    • a per hostname folder (in my case samva-mbp) containing a shell/ shell script to setup necessary variables and a config folder for special environment configuration files.
  • the pom.xml file describing artifact versions to use in the assembly and the lifecycle to use.

A simple mvn package will build the zip archive with everything described in the assembly.xml file. You will just have to unzip and run the script(s) corresponding to the application deployment for it to be done. You can add this command line to your build server and you will have a simple but powerful continuous delivery system !