New app in the Google Play Store!

I finished a new app yay! :). It gets your impulsiveness score by using the BIS-11 scale. With this application I learned:

  • How to change locale
  • How to support many languages
  • How to use different string.xml files for each language
  • How to create a global context to perform common tasks among activities
  • How to make a difference between android API’s
  • How to add a pop-up menu to the Action Bar
  • How to make the application make effective use of the “back button”
  • How to configure a Google Wallet account
  • How to get paid for applications
  • How to use different kinds of Dialogs

Following knowledge increased:

  • Weights
  • Layouts
  • Image Button
  • Toast
  • Android execution lifecycle

Stuff I enjoyed the most:

  • I created a chart by using buttons and weights
  • I got in contact with the research team of BIS-11
  • Providing multiple languages
  • Designing the icon
  • Providing support to Android 2.2

Challenges for the upcoming new project:

  • Use fragments
  • Use sherlock
  • Use Google API
  • Use OpenGL

Screen Shot 2014-05-18 at 12.06.21 PM


Refresh Options menu in API > 11 and API < 11

I let the user change the app locale whenever he feels like to do it. Menu strings have to meet the new language within this configuration change, in order to do that, the options menu has to be refreshed.

Keep in mind that there are two different ways to achieve this depending on whether you are using API > 11 or API < 11.

Code is really simple and goes as follows:

	public static void refreshOptionsMenu(Activity activity, Menu menu)
		int currentVersion = android.os.Build.VERSION.SDK_INT;
		if (currentVersion >= android.os.Build.VERSION_CODES.HONEYCOMB)
		else if (menu != null)

I added that method as static to a “GlobalContext” class so I can use it along with any of my activities. Enjoy.

Change locale within an Android application

I wanted users to have the ability to change application locale. Took me hours, but finally this is the code to do it. goBack() method forces a refreshment of strings among application visual elements.

public class LanguageMenu extends Activity{

	protected void onCreate(Bundle savedInstanceState) {
	public void selectEnglish (View view)
		selectLanguage(new Locale("en"));
	public void selectSpanish (View view)
		selectLanguage(new Locale("es"));
	public void selectItalian (View view)
		selectLanguage(new Locale("it"));
	public void selectPortuguese (View view)
		selectLanguage(new Locale("pt"));
	public void selectDutch (View view)
		selectLanguage(new Locale("nl"));
	public void selectLanguage(Locale locale)
		Configuration config = new Configuration();
		config.locale = locale;
	public void goBack()
		int activity_id = getIntent().getIntExtra("calling-activity", 0);
		Intent intent = null;
			case ActivityConstants.ACTIVITY_QUESTIONS:
				intent = new Intent(this, QuestionScreen.class);
			case ActivityConstants.ACTIVITY_RESULTS:
				intent = new Intent(this, ResultsScreen.class);
			case ActivityConstants.ACTIVITY_SPLASH:
				intent = new Intent(this, SplashScreen.class);

Color scheme button generator for Android

Screen Shot 2014-02-10 at 9.49.21 PM

I was sicking tired of having to manually modify the HEX values of my XMLs every time I wanted to make a little change in the color. Also you have to modify three files: the idle, the pressed and the selector (at least for a basic rounded coloured button). The problem is actually bigger when you want to use a complete set of colours. I’m one of the most laziest persons all over the world and I’m a programmer so something smart was obligated to come up.

My solution for this problem is a perl script that receives the name of your color scheme, and a file with the Radius, Stroke and Color array information. At the end you will have three files per color inside a folder which you can put inside the drawable directory of your Android project.

Katziders-MacBook:Button Schemes katzider$ perl -scheme_name Windows_8 -input_file windows_8.txt; ls -la Windows_8 | grep sky_blue

-rw-r--r--   1 katzider  staff  676 Feb 10 21:25 button_bg_sky_blue.xml

-rw-r--r--   1 katzider  staff  763 Feb 10 21:25 button_idle_sky_blue.xml

-rw-r--r--   1 katzider  staff  763 Feb 10 21:25 button_pressed_sky_blue.xml

Find detailed instructions in the header of the perl script. Even though the usage of this program should be straight forward, you can contact me in case of any problem =)

Download it here, includes the Windows 8 schema (or a very similar).

Screen Shot 2014-02-10 at 9.44.45 PM

P.S. I tried hard to do a good work on, post your feedback if you have some.

Windows 7 button like (but rounded) Android buttons

Screen Shot 2014-02-10 at 1.01.02 AM


On activity code:








On res/drawable/idle_crimson.xml

<shape xmlns:android=""

android:shape="rectangle" >

<!-- you can use any color you want I used here gray color-->

<solid android:color="#a20025"/>








android:color="#000000" />


I got these colours from: google(“Windows 7 color scheme codes”);