Category Archives: Android

Blizzard released Heathstone for Android tablet

In the Christmas Eve 2014. Blizzard released its card game Hearthstone to Google Play

Click the link below to download from Google Play

Download only email subject in JavaMail & imaps

I’m trying to download only subject of emails, because it should take less time (downloading ~10 emails with photos take approximately 10 min :/).

Code that I’m now using is:

it seems to me that you should look into prefetching the messages with:

erasing EditText and EditView in Android

This is linked to a previous post:
My layout is like this:




When the user enters an input & upon button click the output text appears.
I have to make sure I make the input & output disappear some 10 seconds after the button click(and after the output text appears).

Now, I cannot add a “TextWatcher” on TextView.
Initially I tried to use Handler on inputText which can have a TextWatcher. But somehow the Handler keeps running all the time in the background & I cannot “cancel” it.

So I switched to using timers. I used a method in the button onCick() method:

And after 10 seconds I would like to call timer.cancel() ( yet don’t know where!!)
As you can see the problem is that I obtain an error complaining that only UI threads can alter views. How can do this ?


I would use Handler class. You can easily post delayed code & cancel it. It will run in correct Thread. Also, you can add TextWatcher or OnFocusChangeListener to detect & cancel text erasing when a user starts editing text again.

Tell when Android device is in sleep mode

Is there a way to tell when an Android device is in sleep mode? When testing my app, I press the power button to turn off the screen & need to wait until sleep mode is active. I then send messages to my device using Google Cloud Messaging (GCM) & then play a sound & notification once it arrives. But if I send this message before sleep mode is active, then I am not sure whether it received the message because it was still alive or because my service routine received started by the GCM broadcast receiver.

You can find out when the screen goes off using android.intent.action.SCREEN_OFF intent yet there is no Intent to find out with certainty if the device is in sleep mode as far as I know.

Need a Bitmap image of TabHost Layout

Hi friends am new to android. I created an application form filling with 4 tabs & now I need a screen shot of the layout if its edit text is filled on button click of save. Is it possible to do in android, if not in any format yet i want a copy of the fields with its image

Hi in the above code its a relative layout where i tried for the layout output as image yet it shows error as width & height > 0

try this it may assist you

Custom view with button in ArrayAdapter

I have defined a custom view (xml) for my ArrayAdapter for a ListView, which adds a Button. I’d like to create an OnClickListener for this Button per row, yet without creating a custom adapter. Is that possible, or does Android force me to create a custom ArrayAdapter for my ListView?

Here’s a snippet of what I’m doing:

Now I’d like to add an OnClickListener for the Button in my custom view.

Thanks in advance,


You have to implement you own Adapter & in getView() method set OnClickListener on your button. Here kick off example:

ViewHolder here for optimization. You can read approximately this there.

Display scrollview button click event

I have images under scrollview. I have a button to click event. When i click the button i need to display scrollview. But when i install app the scrollview is automatically displaying bottom of the page.


Button click:

By default set visiblity of android:id=”@+id/scrl” as invisible in xml.
After click on button
HorizontalScorllView srl=(HorizontalScrollView)findViewById(;
set visiblity of srl as visble.

Install 64GB SD Card on Samsung Galaxy Tablet II P311x

Samsung Galaxy Tablet II P311X only support maximum 32GB external SD Card, Here is the solution that I make it support 64GB SDCard to store media & game files into external SD Card.

First of all the device must be rooted,

Download Paragon exFAT, NTFS & HFS+ from

, & format your sdcard with it as HFS, note: after format, this sdcard will no longer accessable by windows operation system with card reader directly.
Do NOT format this sdcard with the application in Android settings -> storage as this will format the sdcard into extfat format again.

After format, set the mount point & tick the auto-mount on boot.

Then install ¬†“FolderMount”,
I recommend you to go pro version as it can setup as many as mount point you want, the free version can only set 3 of them.

Then you can move any application/game folders which require large space with folder mount to safe the space of your internal SDCard

Use clipboard in Android

You can access the clipboard ClipboardManager service

Main code is as follows: 


  1. Copy: Produce a number randomly, install clipboard next;
  2. Paste: Obtain data from clipboard,  installing EditText;
  3. Clear: Clear empty clipboard—-Stopped with Copy principle actually;


PS: Detailed content asks referenced developer documentation! : )