Google I/O 2011 Android videos

All the lectures related with Android in the Google I/O 2011. Click on the titles to redirect to the video website.

 

 

 

 

Cleaning unused Android resources

On middle/big projects we usually add lots of resources that we can use on code files, layouts or other resources. When we start to do modifications to the project, sometimes we forgot to remove unused strings, drawables, layouts and so on.

I wanted to create a script to check these unused resources on our Android project, but I found a project which already does this task. This project is called android-unused-resources (good name to google it), and we can download it from:

http://code.google.com/p/android-unused-resources/

The use is simple, add the file to the root project and execute it:

java -jar AndroidUnusedResources.jar

Check missing strings for a multi-language Android application

When we are creating a multi-language application for Android, we need to create several folders to save the strings of different languages (see Android tip #014 – Multi-language application). When we are handling hundred or thousand of strings, we can forget adding a string in all language files.

Looking for a tool to organize all the strings in my project and check if any string was missing, I found the W.F.M.H’s blog were you can download a PHP script to help you for checking all your strings.

The usage is easy (using ES language as example)

./string-check.php values/strings.xml values-es/strings.xml

You could get a result similar to:

Missing in <LANG> (You need to add these to your file)
File: values-es/strings.xml
------------------------------------------------------
header_title
description_label

Missing in EN (you probably shall remove it from your <LANG> file)
File: values/strings.xml
------------------------------------------------------------------
mysection_label

Summary
----------------
BASE file: 'values/strings.xml'
LANG file: 'values-de/strings.xml'
   2 missing strings in your LANG file.
   1 obsolete strings in your LANG file.

For more information about the project, visit the main website (recommended):
W.F.M.H.’s blog, Android translators’ helper tool

Or download the script directly from his/her website: strings-check.zip