Thursday 28 June 2012

How to get a Sprite by tag in Cocos2D ?


Hi,

Sometimes you may need to get a sprite using tag while doing a project using Cocos2D. It's easy to get a sprite by a tag in Cocos2D, use the following code to get it.

[java]tempSprite = (CCSprite*)[self getChildByTag:7];[/java]

Here 'tempSprite' is your CCSprite and it will get the sprite with tag 7.

:)

Tuesday 19 June 2012

How to explicitly free memory in android OR Release unwanted memory in Android?


public void freeMemory(){
    System.runFinalization();
    Runtime.getRuntime().gc();
    System.gc();
}

Visit http://www.coderzheaven.com/2012/04/24/explicitly-free-memory-android-release-unwanted-memory-android/ for more information.

Saturday 16 June 2012

Placing Controls in a Widget in Android and Listening to the events from them.


Now in today’s tutorial I am going to show how to place controls like buttons inside the widget and listen to their events and respond to it.


I am proceeding the same as the previous tutorials.
First I will create a new project named “ControlsInWidget” and name the activity “MyActivity.java”.
Now we will create a layout for this main activity. settings.xml
These are the contents of settings.xml
?
1
2
3
4
5
6
7
8
9
10
11
12
13
<TableLayout android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<TextView android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/tv1"
    android:text="CoderzHeaven Widget Settings Activity"
    android:textColor="@android:color/white"
    android:textSize="15dip"
    android:textStyle="bold"
    android:layout_marginTop="5dip"/>
</TableLayout>

Read the complete post from here.

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/