Android TextView Strike

To make a strike in your TextView in Android use the setPaintFlags like this: TextView tv=(TextView) v.findViewById(android.R.id.text1); tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); If you’re using Html.fromHtml to set the text you can’t unfortunately use the <strike> as this is not supported for Android at this moment (in Jelly Bean).

Eclipse XML Layout Text Editor Broken

When editing xml layout file for Android in Eclipse you might encounter the xml being wrong, flipping and broken. When changing tabs between the graphical layout and the xml file, the lines of code will start disappearing or moving around. It becomes even more visible when highlighting a block of text. To fix this you can disable this

Read More

Android 4.2 Enable Developer Options

Developer Options is gone, almost. It’s not just on Nexus 7 or Galaxy Nexus. Google has hidden the developer settings in the latest version of Jelly Bean, 4.2 for some reason. You can however easily enable it again. Go to the settings menu, and scroll down to and click “About phone.” Scroll down to the bottom

Read More

Android Get Width And Height Of Image From Resource

In Android to get the width and height of an image from your res folder do the following: BitmapDrawable bd = (BitmapDrawable) this.getResources().getDrawable(R.drawable.icon); int height = bd.getBitmap().getHeight(); int width = bd.getBitmap().getWidth(); If you want the width and height depending the target density you can use the intrinsic values: BitmapDrawable bd = (BitmapDrawable) this.getResources().getDrawable(R.drawable.icon); int imageHeight =

Read More

Android Can’t Find File android_winusb.inf

The android_winusb.inf file is in a subfolder of the Android SDK directory, specifically: ..\android-sdk\extras\google\usb_driver\android_winusb.inf In older version of the sdk it was in ..\android-sdk\usb_driver\android_winusb.inf Depending on the installation and updates you might have both. The file in extras is the newest.