Number Preferences in Preference Activity in Android

What I want to do is I am working on a game of life program. I want to take the time delay and make it a preference, but I want to make it available for people to type in a specific time. The number can be in miliseconds or seconds. However I’m a little stuck […]

Programmatically connect to paired Bluetooth device

Is there a way, using the Android SDK, to programmatically connect to an already-paired Bluetooth device? In other words: I can go into Settings -> Wireless & networks -> Bluetooth settings, and tap the device (listed as “Paired but not connected”), at which point it will connect. I’d like to be able to do this […]

How to change a layer-list drawable?

Trying to learn some new things and can’t figure this one out, any help is appreciated. Given this simple code which is right from Google’s documentation: layers.xml: <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=””> <item android:id=”@+id/first_image”> <bitmap android:src=”@drawable/android_red” android:gravity=”center” /> </item> <item android:id=”@+id/second_image” android:top=”10dp” android:left=”10dp”> <bitmap android:src=”@drawable/android_green” android:gravity=”center” /> </item> <item android:id=”@+id/third_image” android:top=”20dp” android:left=”20dp”> <bitmap android:src=”@drawable/android_blue” android:gravity=”center” […]

Create and Share a File from Internal Storage

My goal is to create a XML file on internal storage and then send it through the share Intent. I’m able to create a XML file using this code FileOutputStream outputStream = context.openFileOutput(fileName, Context.MODE_WORLD_READABLE); PrintStream printStream = new PrintStream(outputStream); String xml = this.writeXml(); // get XML here printStream.println(xml); printStream.close(); I’m stuck trying to retrieve a […]


Probably a very basic question, but what is the difference between setting a ListViews choice mode between CHOICE_MODE_MULTIPLE and CHOICE_MODE_MULTIPLE_MODAL? The Android documentation doesn’t really explain much.. From Android Dev site: CHOICE_MODE_MULTIPLE: The list allows multiple choices CHOICE_MODE_MULTIPLE_MODAL: The list allows multiple choices in a modal selection mode

How to change the size of a Switch Widget

In Ice Cream Sandwich a Switch Widget was introduced that displays an On Off Slider. I added the Switch like this: <Switch android:layout_width=”fill_parent” android:layout_height=”48dp” android:textStyle=”bold” android:thumb=”@drawable/switch_thumb_selector” android:track=”@drawable/switch_bg_selector” /> The track and thumb drawables are nine patch images that should scale to all possible sizes. I hoped that the Switch would scale to the maximum size […]

Crouton depends on libraries but is not a library itself

I’m using Android Studio 0.6.1, with Crouton library and today after gradle sync I got next error: Error:A problem occurred configuring root project ‘project_name’. Module version depends on libraries but is not a library itself That’s going on?

Android Studio update 0.5.3 – platform 'android-19' not found

Yesterday I opened Android Studio and it asked me to be updated. I now have v0.5.3, SDK 19 fully installed and gradle 0.9.+. I think this information is correct but I’m not fully aware how the gradle strategy works. The problem is that my gradle apps stopped syncing and even when I create a brand […]

Android sdk manager not fetching other sdk platform

I downloaded the SDK ADT bundle for windows, everything is working well but Android SDK Manager is showing error Failed to fetch URL, reason: SSLPeerUnverified peer not authenticated As I want to install other android platform.

Error: package javax.annotation does not exist after upgrade to lombok 1.16.2

My android project builds fine with lombok 1.16.0, but once I change my dependency to target 1.16.2, I get the following error everywhere I’m using a lombok annotation: Error:(20, 1) error: package javax.annotation does not exist The Android SDK does not include all javax packages. What I’m wondering is if this is a bug in […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.