jan 24

Context

On most services (applications or web sites), there is a strong need regarding input dates.

The best way of achieving this is by displaying a calendar to the user. There are many ways of doing this using JavaScript but since the HTML5 team has created a specific tag to deal with that, we could use it, at least on devices that support it.

HTML5 – what does the W3C tell us

« The input element with a type attribute whose value is « date » represents a control for setting the element’s value to a string representing a date. »

A valid full-date as defined in RFC 3339, with the additional qualification that the year component is four or more digits representing a number greater than 0.
Example: 1996-12-19

In the HTML source, it looks like this : <input type=”date” name=”mydate”>

What do we expect ?

This tag is designed to input a date. We are expecting that a compliant browser would display a calendar without any use of JavaScript or at least it would display an optimized keyboard on touch screen devices.
Continue reading »

Tagged with:
nov 26

Why statistics matter

To know how often the pages of your app are viewed or which feature is used the most is hugely important. It lets you know how to improve your app, and more importantly what to improve in priority.

Roman Nurik, Android Developer Advocate at Google pointed out this need in this post about « Improving App Quality ».

As he says, statistics can lead you to move some less used functionalities of your app into a sub-menu, or even remove them entirely.

Continue reading »

Tagged with:
nov 09

The dreaded word: « Fragmentation »

With today’s rapid adoption of the Android platform, more and more articles on the web have been dedicated to the supposed « fragmentation » of the OS. Dan Morrill wrote a great post on this topic (even if he prefers talking about compatibility, and I agree with him). You can argue on the terms, but even Dan Morrill admits that there are issues that developers must solve to reach as much users as possible on the Android market. Some of the biggest are:

  • The several bugs of Android 1.5 Cupcake. This is the biggest « compatibility » problem in my opinion, but I would advise you to drop this version as it represents less than 8% of the devices according to Google.
  • The diversity of screen sizes and densities
  • The bugs specific to custom Android interfaces (such as HTC Sense)

So what do we do?

The obvious answer is: testing, testing, testing.

Alright, testing is the solution. But if you are a developer, you will probably tell me that deploying on several Android devices is painful, and that you do not have time for that (because you are so busy developing the new killer app for the Android Market). Here at Backelite, we totally understand you. So here is an attempt to ease the deployment process on several Android devices (either real ones or AVDs).

Our solution: BkDroidTester

This solution is simple, yet quite powerful. It is basically an USB Hub (optional), and a few lines of shell script to automatically deploy an app on several devices (thanks to Cyril Siman for the original idea).

The hardware part (optional)

To connect several Android phones to one single computer, without having any alimentation trouble, the obvious solution is to use an AC-Powered USB Hub.

We went a little further with a complete test bench composed of a metal box, an USB Hub, and several universal cell phone holders. One of the benefits of this approach is to have a single USB cable (the one between the computer and the hub) to plug in and out (for example to quickly give the test bench to a colleague).

Here is a schema of the system:

And here is a picture of the final result (some people call it « the octopus »…):

BkDroidTester picture

The USB Hub is obviously inside the box, and the painted metal provide a great surface for the suction cups to hold onto. We decided to go with 3 mini and one micro USB for the plugs. You can use a converter if you need to use a mini USB plug with a device using micro.

The software part

We developed two small scripts that you can also use without the hardware part described above (just plug several devices to your computer and/or launch several AVD).

The scripts list all the android devices currently connected, and deploy the specified app on them all through ADB shell. More precisely, they make use of the following commands:

adb devices
adb -s <device_number> install -r <path_to_apk>
adb -s <device_number> shell am start -n <package_name>

Now let’s see how to use those scripts.

Step 1: Download the scripts
To use BkDroidTester, you first have to checkout the scripts available here. There is one to deploy an app, and one to deploy and launch a monkey test.

Step 2: Plug in the devices
You just have to connect one or more devices to your computer and/or launch AVDs (make sure all the devices are recognized using ADB).

Step 3: Configure your IDE
If you do not want to launch the BkDroidTester scripts through command line, you can integrate them directly in Eclipse or any IDE that allows you to configure external command line tools.

Here is the way to do it for Eclipse :

  1. Select ‘Run > External tools > External tools configuration » or clic on the arrow next to this icon and select « External tools configuration »
  2. Select « program » and press the « New » button to add a new external tool
  3. Then, configure like this:
    1. Name: <the name you want>           example: « MyApp – Deploy on all Androids »
    2. Location: <path to one of the scripts (deploy or monkey)>          example: « /Users/FabienDevos/work/BkLabs/BkDroidTester/deployOnAllAndroid.sh »
    3. Working directory: <path to the APK>           example: « ${workspace_loc}/MyApp/bin »
    4. Arguments: <APK name> <package name>/<first activity with package name> example: MyApp.apk com.me.myapp/com.me.myapp.MyActivity
  4. You can then launch the script by clicking on the arrow next to the icon  and choosing the script you just created (you can also configure Eclipse to launch the last used script by clicking the green icon)

The screenshot below sums it up:

The configuration is almost the same for the « monkey » script. It needs one additional parameter at the end: the number of events you want to send (eg: 5000). You also have to remove the name of the Activity: MyApp.apk com.me.myapp 5000

Pending improvements

So that’s pretty cool, but it could be a lot better. Here are a few features that we would like to add in the future:

  • Android Manifest file parsing to automatically determine some parameters like the package name (and thus avoid passing them as arguments of the scripts)
  • Automated cleaning of preferences or caches to have a clean fresh app each times you deploy

But as Android developers, we do like the culture of Open Source, which is why we are releasing those scripts as an Open Source Google Code project under the Apache license 2.0. Feel free to use or modify it, and if you do modify it, do not hesitate to share your improvement!

I do hope you enjoyed this article. If you have any feedback, you can either write a comment here, or submit bugs/requests on the Google Code project page.

Fabien Devos
Android engineer at Backelite

Tagged with:
août 31

PHP a aujourd’hui 15 ans et est utilisé sur plus de 50% des serveurs web. Avec 5 millions de développeurs, c’est la 3ème technologie après Java et C/C++. Les services conçus en PHP sont variés : petit site personnel, site de commerce en ligne, site de réseau social de taille mondiale, scripts de traitements complexes… tout est facilement réalisable avec cette technologie. Il faut désormais que les outils et processus évoluent pour devenir de plus en plus professionels afin d’améliorer la qualité des livrables, de diminuer le temps de développement et de faciliter son utilisation par les développeurs.

L’article Backelite – Industrialisation PHP – Le déploiement de sites automatisés (PDF) reprends notre vision chez Backelite sur l’automatisation des tâches liées aux mises en production de sites. L’article détaille les attentes et les solutions trouvées aux problématiques posées. N’hésitez pas à nous commenter l’article et à nous contacter sur php AT backelite DOT com afin de partager vos expériences et retours.
juin 25

This post will focus on animations. While Silverlight is a very capable technology for creating rich user interfaces, Windows Phone 7’s UI languages, codenamed Metro, has very strong red threads and principles which push typography, panoramic navigation and animation. One might find the experience a bit bland at first, but it really comes alive when one sees the UI in motion. A post dedicated to Metro is planned, but for now I suggest you read these nice articles.

If you base your design principles on Metro and try to embrace the design of WP7’s default applications, you will want to animate parts of your UI on actions or based on a timer.

Continue reading »

juin 21

This post is the first of a series of articles and samples targeting Microsoft’s newest mobile OS, Windows Phone 7 (WP7).

Read on to learn about:

  • the development platform
  • the development frameworks
  • designing for Windows Phone 7
  • getting up to speed quickly

Continue reading »

preload preload preload