13 03 2014

mdevcon 2014

J’ai eu la chance de participer (en tant que speaker mais aussi en tant qu’auditeur) à la mdevcon 2014, les 7 et 8 mars derniers à Amsterdam. Mon compte rendu est disponible sur le blog octo.

Ainsi que les slides de ma présentation (en anglais) :

Share
26 10 2013

Droidcon London 2013

Yesterday, I was with Stephane Nicolas in London at the Droidcon conference. We’ve presented our session : « Beef up your Android apps using java tools », same subject as in Paris (DevoxxFR and Droidcon) but with new slides and above all, the integration of Gradle in the Quality Tools for Android project on github. The slides are available here :

Share
11 10 2013

Android Lint on SonarQube

SonarQube

For those who know SonarQube (formerly named Sonar), you can go to the next part.

For the others, SonarQube is an open source tool that manage code quality. This tool is well known by java/jee developers in Western Europe (mainly France and Swiss), but it seems completely unknown across the Atlantic. It is a pity because it is a very good tool.

As you can see in the following picture, this is a web-based dashboard describing the code quality of your application.

sonarqube

It is based on Findbugs, PMD, Checkstyle and Sonar self rules to analyze the code and display metrics (and details : you can see exactly where you got problems in your code). You also have tests indicators (number of tests, execution time, code coverage). It gives you general metrics about your code (number of lines, number of comments, duplicated code, complexity, …).

But the most interesting is that everything is recorded all along the project life, so you can see the evolution and make sure you get better :

Historical

Like I said before, this is a tool we used to since several years on java project. It works perfectly well with maven and gradle.
But what about Android and its quality analysis tool : Lint ?

Android Sonar Plugin

Android Sonar Plugin

A bit of history…

Eight months ago, I decided to provide a Sonar plugin to add the Android Lint violation checks in Sonar. With Stéphane Nicolas, we created the first version on github (deprecated). We had some help from Florian Roncari et Thomas Bores, and after a conf call with Freddy Mallet (from Sonarsource), the plugin has been integrated to the Sonar Community Plugins. More recently, Julien Henry (from SonarSource) made a really good job of refactoring on the plugin to match the Sonar standards. Thanks to him !

How-to

Pre-requisites : You need SonarQube, maven or gradle. I won’t give any details on installation of theses tools, they all have good documentations.

Installation : To install the plugin, go to your SonarQube update center (http://sonarhost:sonarport/updatecenter/available), find the « Android » plugin and install it OR git clone https://github.com/SonarCommunity/sonar-android.git, mvn clean install, retrieve the jar in the target folder and put it in /sonarpath/extensions/plugins. Restart sonar and that’s it ! Easy :) !

Thus, you’ll have all the Android Lint rules (158 exactly) available in your SonarQube instance :

sample report

Usage : In your maven or gradle build, you need to specify some information in order to communicate with the sonar server.

For maven, I suggest to put the following configuration in your settings.xml (generally in $MAVEN_HOME/conf/settings.xml or $HOME/.m2/settings.xml) :

<settings>
    <profiles>
        <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <!-- Example for MySQL-->
                <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8</sonar.jdbc.url>
                <sonar.jdbc.username>sonar</sonar.jdbc.username>
                <sonar.jdbc.password>sonar</sonar.jdbc.password>
 
                <!-- Optional URL to server. Default value is http://localhost:9000 -->
                <sonar.host.url>http://myserver:9000</sonar.host.url>
            </properties>
        </profile>
     </profiles>
</settings>

Then you can execute maven to analyse your application. Specify the profile Android Lint to use the Lint ruleset :

mvn sonar:sonar -Dsonar.profile="Android Lint"

For gradle, there is a plugin to execute sonar : sonar-runner. Like maven, it needs the same information. In your build.gradle, add the following :

apply plugin: 'sonar-runner'
 
sonarRunner {
    sonarProperties {
        property "sonar.host.url", "http://myserver:9000"
        property "sonar.jdbc.url", "jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8"
        property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
        property "sonar.jdbc.username", "sonar"
        property "sonar.jdbc.password", "sonar"
    }
}

You also need to specify some project information, either in a sonar-project.properties file or directly in the build.gradle :

# required metadata
sonar.projectKey=pjk
sonar.projectName=pjn
sonar.projectVersion=1.0
 
# path to source directories (required)
sonar.sources=src/main/java
 
# The value of the property must be the key of the language.
sonar.language=java
 
# Encoding of the source code
sonar.sourceEncoding=UTF-8
 
# Additional parameters
sonar.profile=Android Lint

Finally, run gradle to build the sonar dashboard :

gradle sonarRunner

Result : Here you can see a live report generated with a sample project on nemo (a sonar instance with many open sources projects) :
sample report

Conclusion

SonarQube is a really great tool that go with you all along the project. It ensures to keep a good level of quality in your code and thus to provide a more robust app. Before you could get java problems (probable bugs, coding conventions problems, …), now you also can get android problems ! At OCTO, on nearly all our projects, we add a nightly build on our continuous integration server (jenkins) that run the sonar check. And all the morning, during the standup meeting, we have a look at the report to check if our app is healthy. Give it a try !

Share
18 06 2013

Droidcon Paris 2013

droidcon paris Hier et aujourd’hui avait lieu la première Droidcon Paris… et ce fut à mon avis une réussite, un bel événement, très bien organisé par l’équipe du PAUG. Le format était à peu près le même que les Droidcon Londres auxquelles j’avais assisté en 2010, 2011, à savoir une demi-journée de barcamp et une journée et demi de conférences « magistrales ». Pour ma part, j’ai présenté une session avec Stéphane Nicolas sur la qualité des développements Android, où comment exploiter les outils du monde Java (Tests, courverture, analyse du code) pour améliorer la robustesse des applis Android, conf que nous avions déjà jouée à Devox à Paris cette année (et que nous rejouerons probablement en anglais à la droidcon de Londres). Ci-dessous les slides de la conférence…

Share
25 05 2013

Google I/O

Google-IO-2013 Les 15 et 16 mai dernier, j’ai eu la chance d’aller à la conférence Google I/O à San Fransisco. J’étais invité à présenter Android Holo Colors sur un stand des Sandbox, en parallèle des différentes sessions techniques animées par les Googlers.

Google I/O, c’est la grand-messe annuelle pour tous les développeurs qui souhaitent s’informer sur les produits et technologies Google (Android, Chrome, Google+, Cloud Platform, Maps, …). Cette année encore, c’est près de 6000 développeurs qui se sont retrouvés au Moscone Center de San Fransisco et j’y étais !

Je publierai prochainement un article sur le blog d’OCTO qui m’a permit de me rendre à cette incroyable conférence.

3ème conférence au compteur cette année et ce n’est pas fini puisque je présenterai une session à la DroidCon Paris le 18 juin prochain…


IMAG0369

IMAG0398

Share
26 03 2013

Devoxx France

Demain Devoxx France, saison 2. J’aurai le plaisir d’y présenter une session (Tools in action) avec Stéphane Nicolas sur le sujet de la qualité des développements Android, où comment exploiter les outils disponible en java (tests, analyse de code, couverture, …) sur Android.

En avant-première les slides :

Share
12 01 2013

Présentation Android au JUG Lausanne

J’ai eu l’honneur de présenter la plateforme Android au JUG Lausanne ce jeudi 10 janvier. En voici les slides :

Share
26 10 2012

Start an android project in less than 5 minutes

When you start an Android project, you actually repeat the same operations : manage your dependencies (generally with maven and soon with gradle), create a test project, configure your Theme, tune your ActionBar, … What if we could do this in a few minutes rather than hour ? That’s what maven archetypes propose since a long time and that’s what androidkickstartr and androidbootstrap propose since a few weeks. Let’s give them a try…

Share
18 10 2012

Accessibilité des applications mobiles

Vous trouverez sur le blog d’Octo mon dernier article, sur l’accessibilité des applications mobiles.

05 10 2012

Android-Holo-Colors

I have recently released the Android Holo Colors website, to help developers and gui designers create Holo-based components (checkbox, button, spinners, …) but with custom colors (different from the #33b5e5 Holo color). This website is now part of the indispensable Android Asset Studio, created by Roman Nurik (Android Developer Advocate at Google).
This article presents a feedback on this tool (history, android styles and themes, how to use it, …).

Share
←Older   
online pharmacy overnight shipping |=| viagra super active overnight delivery