Why do I get access denied to data folder when using adb?

I connected to my live device using the adb and the following commands: C:\>adb -s HT829GZ52000 shell $ ls ls sqlite_stmt_journals cache sdcard etc system sys sbin proc logo.rle init.trout.rc init.rc init.goldfish.rc init default.prop data root dev $ cd data cd data $ ls ls opendir failed, Permission denied I was surprised to see that […]

Update data in ListFragment as part of ViewPager

I’m using the v4 compatibility ViewPager in Android. My FragmentActivity has a bunch of data which is to be displayed in different ways on different pages in my ViewPager. So far I just have 3 instances of the same ListFragment, but in the future I will have 3 instances of different ListFragments. The ViewPager is […]

“Rate This App”-link in Google Play store app on the phone

I’d like to put a “Rate This App”-link in an Android App to open up the app-listing in the user’s Google Play store app on their phone. What code do I have to write to create the market:// or http://-link open in the Google Play store app on the phone? Where do you put the […]

Android dex gives a BufferOverflowException when building

When compiling a specific Android project, and only on my Windows machine, I get a java.nio.BufferOverflowException during from dex. The problem occurs both when using Eclipse and when using Ant. The output when using Ant is: … [dex] Pre-Dexing C:\MyProject\libs\android-support-v4.jar -> android-support-v4-5f5341d3c1b10a79d7d93f9c1e64421e.jar [dex] Converting compiled files and external libraries into C:\MyProject\bin\classes.dex… [dx] [dx] UNEXPECTED TOP-LEVEL […]

Android: Vertical alignment for multi line EditText (Text area)

I want to have 5 lines for the height of the text area. I am using the following code. <EditText android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:gravity=”center” android:singleLine=”false” android:lines=”5″ android:layout_marginLeft=”10dip” android:layout_marginRight=”10dip” /> The text area looks fine, but the problem is that the cursor is blinking in the middle of the text field. I want it to blink at […]

Android Studio Google JAR file causing GC overhead limit exceeded error

I am using Android Studio on OS X. I am getting this error message: FAILURE: Build failed with an exception. What went wrong: Execution failed for task ‘:app:preDexDebug’. com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Applications/Android Studio.app/sdk/build-tools/android-4.4W/dx –dex –output /Users/alex/AndroidStudioProjects/SilentSMS/app/build/intermediates/pre-dexed/debug/android-4.3_r2.1-f22bbff4d1017230e169a4844a9c2195f13060d2.jar /Users/alex/AndroidStudioProjects/SilentSMS/app/libs/android-4.3_r2.1.jar Error Code: 3 Output: UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: GC overhead limit exceeded at com.android.dx.cf.code.RopperMachine.getSources(RopperMachine.java:665) at com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:288) at […]

Valid values for android:fontFamily and what they map to?

In the answer to this question the user lists values for android:fontFamily and 12 variants (see below). Where do these values come from? The documentation for android:fontFamily does not list this information in any place (I checked here, and here). The strings are listed in the Android styles.xml file in various places, but how do […]

Programmatically set left drawable in a TextView

I have a textView in xml here. <TextView android:id=”@+id/bookTitle” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_weight=”1″ android:drawableLeft=”@drawable/checkmark” android:gravity=”center_vertical” android:textStyle=”bold” android:textSize=”24dip” android:maxLines=”1″ android:ellipsize=”end”/> As you can see I set the DrawableLeft in xml. I would like to change the drawable in code. Is there anyway to go about doing this? Or setting the drawableLeft in code for the text view?

How do I make WRAP_CONTENT work on a RecyclerView

I have a DialogFragment that contains a RecyclerView (a list of cards). Within this RecyclerView are one or more CardViews that can have any height. I want to give this DialogFragment the correct height based on the CardViews that are contained within. Normally this would be simple, I would set wrap_content on the RecyclerView like […]

Android Studio was unable to find a valid Jvm (Related to MAC OS)

I am unable to start my Android Studio for Android development on Mac OS (10.10.1 – Yosemite)

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