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.
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
CheckBoxPreferenceis a simple checkbox, that can returntrueorfalse. - The
ListPreference, which shows aradioGroupwhere only 1 item can be selected a time. Theandroid:entrieslinks to an array in theres/values/arrays, and theandroid:entryValuesis an other array with the items to be returned. - The
EditTextPreferenceshows a dialog with aneditTextview. This returns a String. - The
RingtonePreferenceshows aradioGroupthat shows the ringtones. - The
Preferenceis a custom preference. This works like aButton.
- The
PreferenceScreenis a screen with preferences. When you have aPreferenceScreeninside an otherPreferenceScreen, it simply opens a new screen with other preferences. - The
PreferenceCategoryis a category with preferences.