Tag: android

Linear Layout with two buttons side by side – android

I have 3 buttons the layout.xml below where they appear below of each other… <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” android:padding=”10dip” > <LinearLayout android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:orientation=”vertical”> <Button android:id=”@+id/btn_1″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_weight=”1″ android:text=”Car” /> <Button android:id=”@+id/btn_2″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_weight=”1″ android:text=”Vehicle” /> </LinearLayout> <LinearLayout android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:orientation=”vertical” > <Button android:id=”@+id/btn_3″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:text=”Bike” /> </LinearLayout> </LinearLayout> I would like […]

Android findViewById in DialogFragment

I am trying to develop a datepicker that sets the value of a textview when set. But i cannot select the TV from the DialogFragment that handles the datepicker. I tried getView() but the application crashes at the specific point. Here’s my code: import java.util.Calendar; import android.annotation.SuppressLint; import android.app.DatePickerDialog; import android.app.Dialog; import android.app.DialogFragment; import android.os.Bundle; […]

Are there some open-source media players on Android?

Are there some open-source media players on Android?

Enable email keyboard on android for input type email

I am creating application with WebView. I use the WebView to show HTML pages, containing input fields. If the HTML input fields expect an email address to be typed by the user, then I want to enable an email-friendly keyboard layout. Is it possible to set up the HTML or the WebView to show an […]

Disable button with button selector

I have a button selector that changes the button image when it is pressed. I have also set an image for when the button is disabled. I try and disable the button programmatically but the disabled button image is not appearing. Is my button_selector correct? <item android:drawable=”@drawable/red_btn_bg_disabled” android:state_enabled=”false”/> <!– disabled –> <item android:drawable=”@drawable/red_btn_bg_pressed” android:state_pressed=”true”/> <!– […]

Android getChildFragmentManager() level API < 17

I am trying to use getChildFragmentManager() method on api 14, but of course I am getting error. Is there anyway to use this method on lower apis. Thanks

Dependent preferences display wrong color font when disabled

In my app I am using several preferences, including some of them related with dependencies using the following attribute: android:dependency=”pref_key”. Basically, when the checkbox is not selected, all the other preferences below are disabled: The problem happens when I setup back the following 3 lines in my custom theme: <style name=”AppThemeOrange” parent=”@style/AppTheme”> <item name=”android:textColorPrimary”>@color/OrangeMain</item> <item […]

Value for 'keystore' is not valid. It must resolve to a single path

i am trying to build apk from command line with ant. I am able to create build in debug mode while getting this error when i run in release mode for signing the apk file with the key store generated. my local.properties file look like this sdk.dir=E:\\_WorkArea\\adt-bundle-windows-x86\\sdk key.store=C:\Users\\l.keystore key.alias=tys key.store.password=tr key.alias.password=tre D:\Android-Sdks\tools\ant\build.xml:1132: The following error […]

How do I scale a streaming bitmap in-place without reading the whole image first?

I have an Android application that is very image intensive. I’m currently using Bitmap.createScaledBitmap() to scale the image to a desired size. However, this method requires that I already have the original bitmap in memory, which can be quite sizable. How can I scale a bitmap that I’m downloading without first writing the entire thing […]

Android – How to change texts in the preferences activity dynamically?

Hello fellow programmers, I have a little problem with Preferences activity. http://developer.android.com/reference/android/preference/PreferenceActivity.html I’ve got just one preference category and a listPreference: <?xml version=”1.0″ encoding=”utf-8″?> <PreferenceCategory android:title=”@string/basic_settings” > <ListPreference android:defaultValue=”70″ android:entries=”@array/listArray” android:entryValues=”@array/listValues” android:key=”updates_interval” android:persistent=”true” android:summary=”@string/SOME_SUMMARY” android:title=”@string/SOME_TITLE” /> </PreferenceCategory> I need to have the selected value (the default one or the user defined one) written in the […]

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