This is an old site. Please visit the new site!

Kaloer.com

RSS Feed

Make your application speak

July 21, 2009 by Mads Kalør

Filed under: Android, Programming

Google has developed a text-to-speech library for Android. This project is primarily made for blind people, so they can use an Android powered phone. However, the text-to-speech library can be useful in other applications - imaging a talking translate application. You don't need to know how to pronounce the words because the application will say them for you. If the application could recognize speech and convert it to text, this can work as an digital interpreter.
(more...)

Incoming SMS Messages

June 24, 2009 by Mads Kalør

Filed under: Android, Programming

During the development of version 1.3 of Kaloer Clock, I wanted to show an icon when a new sms message was received. This was not the biggest problem, though. If the sms message was read, the icon should be invisible. Therefore, it was necessary to check the sms messages in the inbox using a URI.

The following guide shows how I did this.

(more...)

Android Preferences

May 14, 2009 by Mads Kalør

Filed under: Android, Programming

Preferences are an important part of an Android application. It is important to let the users have the choice to modify and personalize their application depending on their needs.

Android preferences can be set in two ways. You can create a preferences.xml file in the res/xml directory, or you can set the preferences from code.
The first example shows a preferences.xml file. Every preference needs to have a android:key value, that we call to get the preference's value. The android:title is the preference's title, and the android:summary is a summary about the preference. The android:defaultValue is the default value of the preference - fx. true or false.
Currently there are 5 different preference views:

  • The CheckBoxPreference is a simple checkbox, that can return true or false.
  • The ListPreference, which shows a radioGroup where only 1 item can be selected a time. The android:entries links to an array in the res/values/arrays, and the android:entryValues is an other array with the items to be returned.
  • The EditTextPreference shows a dialog with an editText view. This returns a String.
  • The RingtonePreference shows a radioGroup that shows the ringtones.
  • The Preference is a custom preference. This works like a Button.
  • The PreferenceScreen is a screen with preferences. When you have a PreferenceScreen inside an other PreferenceScreen, it simply opens a new screen with other preferences.
  • The PreferenceCategory is a category with preferences.

(more...)