Category Archives: Android

How to define a Android Multiline EditText

Defining an Android Mulitline EditText Field is done via the inputType=”textMultiline”. Unfortunately the text looks strangely aligned. To solve that also use the gravity=”left|top” attribute. With the gravity flag it looks like the following. Without it, it looks like the … Continue reading

Posted in Android | Tagged | Comments Off on How to define a Android Multiline EditText

Honored to be a Java Champion –

I’m very honored to be now part of the Java Champions Group. The website describes the group as following: The Java Champions are an exclusive group of passionate Java technology and community leaders who are community-nominated and selected under a … Continue reading

Posted in Android, Eclipse, Java, vogella | 8 Comments

Why Starbucks, BMW, Honda, Nike and Android are suffering from fragmentation

Starbucks is offering coffee in lots of different sizes and flavors. Obviously this business model is doomed out of the following reasons: 1.) First and foremost the production of coffee at Starbucks has a higher complexity than in a shop … Continue reading

Posted in Android | 14 Comments

Why the missing device fragmentation is hurting the iPhone

For ages I have been hearing the argument that Android is suffering from the fact that Android devices come in all different sizes and configurations and that this fragmentation is making the success of Android really difficult. Of course fragmentation … Continue reading

Posted in Android | 13 Comments

Using Android SDK Icons

The Android SDK contains lots of useful icons, which you can reuse in your application. The Android team does not want you to link to some of them directly, as they might change in a future version and your icons … Continue reading

Posted in Android | Comments Off on Using Android SDK Icons

Show your Android phone screen on your computer screen

I recently found Droid@Screen. Its a tiny Java lib which you can start with java -jar droidAtScreen-0.5.jar. Once started it will use the Android adb to show the screen of you phone on your computer. Can be handy for demos.

Posted in Android | 1 Comment

Android: How to check if a LocationProvider is available?

In Android the LocationProvider for example for GPS might not be available. You can find out if a LocationManager is enabled via the isProviderEnabled() method. If its not enabled you can send the user to the settings via an Intent … Continue reading

Posted in Android | Tagged , | Comments Off on Android: How to check if a LocationProvider is available?

How to determine the ID in the R.java file of a drawable resource in Android?

Assume you have several drawables in your Android resource folder and what to iterate over them. You use a certain naming schema and would like to use this to determine the resources ID’s. The following snippets shows how to get … Continue reading

Posted in Android | Tagged , | 2 Comments

How to center a Button in an Android Layout?

In my last Android Training several people asked how they could center a single view, e.g. a Button, so I assume it is worth a short blog entry. If you have a single Button in your Activity and you want … Continue reading

Posted in Android | Tagged , | Comments Off on How to center a Button in an Android Layout?

Android StrictMode – NetworkOnMainThreadException

I have writen about StrictMode before. In case you have not noticed; StrictMode for network access results in a fatal error as for Android 3.0 (Honeycomb) or later, unless your app is targeting an API version before Honeycomb. The right … Continue reading

Posted in Android | Tagged , , , | Comments Off on Android StrictMode – NetworkOnMainThreadException