Wednesday, 13 June 2012

How to get Notified when a widget is deleted?


I have already covered a tutorial on how to start with widgets and how to create a simple widget here..

<a href="http://www.coderzheaven.com/2012/06/07/create-widget-android/" title="Create a Widget" target="_blank">http://www.coderzheaven.com/2012/06/07/create-widget-android/</a>

Today I will show you how to get notified when a widget is deleted.

if you have already gone through my <a href="http://www.coderzheaven.com/2012/06/07/create-widget-android/" title="Create a widget" target="_blank">previous post</a>, then there is only a small change in the "MyWidget.java" file.

we have to add the onReceive() method to the class like this.

Read complete post from here...

http://www.coderzheaven.com/2012/06/10/notified-widget-deleted/

Android hits 900k activations per day


The Google Android Army is coming again...

Google’s Android platform sees 900,000 activations a day, according to a tweet from Android head Andy Rubin. The statistic, of course, doesn’t distinguish between smartphones and tablets, so it’s hard to get a clear picture of the Android ecosystem.

<img src="http://coderzheaven.com/uploads/images/Google-Android-army.jpg" alt="Google Android" />


See more about this new from here.

http://www.washingtonpost.com/business/technology/android-hits-900k-activations-per-day/2012/06/11/gJQA1tlfUV_story.html

Sunday, 10 June 2012

CoderzHeaven on Facebook, New Fan Page


Please find us on Facebook for more updates.


This is our new Fab page Url.

http://www.facebook.com/CoderzHeavenFans

By adding us on Facebook, you can get access to our new updates fast and get answers to your questions quickly.

So please add us on Facebook.


Please find us on Twitter also..

https://twitter.com/coderzheaven


Monday, 4 June 2012

How to read a text file in ANDROID?


Hi all…..


In this post I will show you how to read a text file in ANDOID.
Let your file is in the assets folder of your ANDOID project.
The file is named “myfile.txt”


This example reads the file line by line using readLine() function till the end of the file. Here your need two classes named “InputStreamReader” and “BufferedReader”. For writing into the file you need “OutputStreamReader” class. The result is displayed in a Toast. Make sure you notice it.

Read more from here...

http://www.coderzheaven.com/2012/04/22/how-to-read-a-text-file-in-android-2/

Sunday, 27 May 2012

Crop an Image in ANDROID.

Cropping an image in <a href="http://www.coderzheaven.com/android/" target="_blank">ANDROID</a> programmatically has always been a problem for ANDROID developers.
So Here I am putting a sample code to demonstrate this.
For cropping an <a href="http://www.coderzheaven.com/?p=1397" target="_blank">image in ANDROID</a> we need a source bitmap which is our image itself, the other one is the target <a href="http://www.coderzheaven.com/?p=3911" target="_blank">bitmap</a> which we have to
set the size as we want and a matrix.

Read the complete post from here..

http://www.coderzheaven.com/2011/03/15/crop-an-image-in-android/

Thursday, 24 May 2012

Custom progressbar in android with text - part 3


Hello all......

I have posted two posts on how to customize a progressbar in android.

1. <a href="http://www.coderzheaven.com/2012/03/29/custom-indeterminate-progressbar-for-android/" target="_blank">Custom Indeterminate progressBar for android?</a>
2. <a href="http://www.coderzheaven.com/2012/05/12/build-custom-progressbar-android-part-2/" target="_blank">How to build a custom progressBar in android- Part 2?</a>

Here is another one with update text on top of the progressbar.

Here is how we start.

After creating a fresh project create a new java file and name it "TextProgressBar.java".

Now copy this code to the above file.
This file extends the progressbar to add additional functionality.

[java]
package com.coderzheaven.pack;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.ProgressBar;

public class TextProgressBar extends ProgressBar {
private String text;
private Paint textPaint;

public TextProgressBar(Context context) {
super(context);
text = "0/100";
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
}

public TextProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
text = "0/100";
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
}

public TextProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
text = "0/100";
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
}

@Override
protected synchronized void onDraw(Canvas canvas) {
super.onDraw(canvas);
Rect bounds = new Rect();
textPaint.getTextBounds(text, 0, text.length(), bounds);
int x = getWidth() / 2 - bounds.centerX();
int y = getHeight() / 2 - bounds.centerY();
canvas.drawText(text, x, y, textPaint);
}

public synchronized void setText(String text) {
this.text = text;
drawableStateChanged();
}

public void setTextColor(int color) {
textPaint.setColor(color);
drawableStateChanged();
}
}
[/java]

OK the progressbar class is now complete.

Monday, 14 May 2012

Samsung Galaxy S III India launch in June first week


Samsung is expected to launch its all new Galaxy S III smartphone in India in the first week of June. According to NDTV Gadgets, India is in the first list of countries to get smartphone, which will see the launch starting May 29.

The smartphone will be priced at INR 38,000, while the street price is likely to be in the vicinity of INR 34,000.

Saturday, 12 May 2012

How to build a custom progressBar in android- Part 2?


Hello all.......

Today I am going to show you how to create a custom progressbar in android.
Previously in another posts I have already shown <a href="http://www.coderzheaven.com/?p=2689" target="_blank">how to build a custom indeterminate progressbar in android.</a>
And in this post I will show you how to customize the horizontal progressbar.

See the complete post here....
http://www.coderzheaven.com/2012/05/12/build-custom-progressbar-android-part-2/

Custom Indeterminate progressBar for android?


Hello everyone...

Today we will see how to customize an indeterminate progressBar in android.
<strong>For that we have to create an xml with a progress animation.For this I used these three images</strong>

Continue from here.....
http://www.coderzheaven.com/2012/03/29/custom-indeterminate-progressbar-for-android/