<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Android Genuine</title>
	<atom:link href="http://androidgenuine.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://androidgenuine.com</link>
	<description>Android Development Community and Android Tutorials</description>
	<lastBuildDate>Tue, 07 May 2013 09:33:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>How to get the battery level of your Android device</title>
		<link>http://androidgenuine.com/?p=888</link>
		<comments>http://androidgenuine.com/?p=888#comments</comments>
		<pubDate>Tue, 16 Apr 2013 13:56:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Widgets]]></category>
		<category><![CDATA[android battery level]]></category>
		<category><![CDATA[battery level in android]]></category>
		<category><![CDATA[get battery level android]]></category>
		<category><![CDATA[how to get android battery level]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=888</guid>
		<description><![CDATA[Hi, in this post i want to show you the simplest method to get the current battery level of the battery in Android. Implement the following snippet: public void onCreate&#40;Bundle savedInstanceState&#41; &#123; ... this.registerReceiver&#40;this.myBatteryReceiver , new IntentFilter&#40;Intent.ACTION_BATTERY_CHANGED&#41;&#41;; ... &#125; &#160; private BroadcastReceiver myBatteryReceiver = new BroadcastReceiver&#40;&#41; &#123; @Override public void onReceive&#40;Context context, Intent intent&#41; &#123;<a href="http://androidgenuine.com/?p=888">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
in this post i want to show you the simplest method to get the current battery level of the battery in Android.<br />
Implement the following snippet:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    ...
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">registerReceiver</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">myBatteryReceiver</span> , <span style="color: #000000; font-weight: bold;">new</span> IntentFilter<span style="color: #009900;">&#40;</span>Intent.<span style="color: #006633;">ACTION_BATTERY_CHANGED</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ...
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> BroadcastReceiver myBatteryReceiver <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BroadcastReceiver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReceive<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context, Intent intent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">int</span> level <span style="color: #339933;">=</span> intent.<span style="color: #006633;">getIntExtra</span><span style="color: #009900;">&#40;</span>BatteryManager.<span style="color: #006633;">EXTRA_LEVEL</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//here you can use level as you wish.</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-888">
		  			<input type="hidden" class="kklike-id" value="888" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=888</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to implement your custom listener on Android</title>
		<link>http://androidgenuine.com/?p=881</link>
		<comments>http://androidgenuine.com/?p=881#comments</comments>
		<pubDate>Fri, 22 Mar 2013 16:32:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[android custom listener]]></category>
		<category><![CDATA[android listener]]></category>
		<category><![CDATA[implement own listener]]></category>
		<category><![CDATA[listen to my events in android]]></category>
		<category><![CDATA[observer pattern android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=881</guid>
		<description><![CDATA[Hi, Today i want to show you something very interesting in Android. I see that on the internet there are no tutorials for helping you to implement from A &#8211; Z your own listener. Let me give an use case. So you have two classes. One extends Activity in which you have a Button, and<a href="http://androidgenuine.com/?p=881">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
Today i want to show you something very interesting in Android. I see that on the internet there are no tutorials for helping you to implement from A &#8211; Z your own listener.<br />
Let me give an use case.<br />
So you have two classes. One extends Activity in which you have a Button, and in the second one you need to listen to events, in our case you will listen to the event that a click was done in some Activity.<br />
You will need to implement an interface and a singleton class like this:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;">&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> <span style="color: #003399;">EventListener</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onEventHappened<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This interface must be in a separate file (Interface)called EventListener<br />
Now the class:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;">&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyEvent
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">EventListener</span> listener<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> MyEvent instance<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> MyEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> MyEvent getInsance<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>instance <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
			instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> instance<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setEventListener<span style="color: #009900;">&#40;</span><span style="color: #003399;">EventListener</span> listen<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>		
		listener <span style="color: #339933;">=</span> listen<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> eventHappened<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>		
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>listener <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			listener.<span style="color: #006633;">onEventHappened</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now that you have those two classes copied in your project let me tell you how to use them.<br />
So in the Activity where you have the Button in onClick method you put the code:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;">MyEvent.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">eventHappened</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now let s say that in any of your other classes you want to be notified about this event.<br />
You will put in your other class the following code:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;">MyEvent.<span style="color: #006633;">getInsance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">EventListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
&nbsp;
			@Override
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onEventHappened<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
                            <span style="color: #666666; font-style: italic;">//here is your code that will happen when the button from the other Activity was pressed</span>
                        <span style="color: #009900;">&#125;</span>
                 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-881">
		  			<input type="hidden" class="kklike-id" value="881" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=881</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to clear whole cache programatically in android</title>
		<link>http://androidgenuine.com/?p=877</link>
		<comments>http://androidgenuine.com/?p=877#comments</comments>
		<pubDate>Wed, 13 Mar 2013 15:33:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[android cache]]></category>
		<category><![CDATA[clear cache android]]></category>
		<category><![CDATA[clear shared preferences]]></category>
		<category><![CDATA[delete all databases android]]></category>
		<category><![CDATA[delete all saved data android]]></category>
		<category><![CDATA[delete cache android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=877</guid>
		<description><![CDATA[Hi, Below i will show you a method to delete all cache saved by your app. You will clear shared preferences, files and folders from data/data/ folder, databases, and all you got in cache. This is the method: public void clearApplicationData&#40;&#41; &#123; File cache = getCacheDir&#40;&#41;; File appDir = new File&#40;cache.getParent&#40;&#41;&#41;; if &#40;appDir.exists&#40;&#41;&#41; &#123; String&#91;&#93;<a href="http://androidgenuine.com/?p=877">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
Below i will show you a method to delete all cache saved by your app. You will clear shared preferences, files and folders from data/data/ folder, databases, and all you got in cache.<br />
This is the method:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> clearApplicationData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">File</span> cache <span style="color: #339933;">=</span> getCacheDir<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">File</span> appDir <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>cache.<span style="color: #006633;">getParent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>appDir.<span style="color: #006633;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> children <span style="color: #339933;">=</span> appDir.<span style="color: #006633;">list</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> s <span style="color: #339933;">:</span> children<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>s.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;lib&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#123;</span>
					deleteDir<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>appDir, s<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					Log.<span style="color: #006633;">i</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;TAG&quot;</span>, <span style="color: #0000ff;">&quot;File /data/data/APP_PACKAGE/&quot;</span> <span style="color: #339933;">+</span> s <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; DELETED &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-877">
		  			<input type="hidden" class="kklike-id" value="877" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=877</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to receive notification when you received a message on android</title>
		<link>http://androidgenuine.com/?p=872</link>
		<comments>http://androidgenuine.com/?p=872#comments</comments>
		<pubDate>Sun, 10 Mar 2013 13:03:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Telephony]]></category>
		<category><![CDATA[android message notification]]></category>
		<category><![CDATA[android sms receive]]></category>
		<category><![CDATA[sms receive]]></category>
		<category><![CDATA[sms received in anroid]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=872</guid>
		<description><![CDATA[Hi, this is a simple and efficient working example of how you can know when device received a message. So in your launch activity put the code: registerReceiver&#40;new BroadcastReceiver&#40;&#41; &#123; @Override public void onReceive&#40;Context context, Intent intent&#41; &#123; Log.d&#40;&#34;MyTag&#34;, &#34;You have received a message&#34;&#41;; &#125; &#125;, new IntentFilter&#40;&#34;android.provider.Telephony.SMS_RECEIVED&#34;&#41;&#41;; And in your manifest put the permission:<a href="http://androidgenuine.com/?p=872">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi, this is a simple and efficient working example of how you can know when device received a message.<br />
So in your launch activity put the code:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;">registerReceiver<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BroadcastReceiver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	        @Override
	        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReceive<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context, Intent intent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	           Log.<span style="color: #006633;">d</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MyTag&quot;</span>, <span style="color: #0000ff;">&quot;You have received a message&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	        <span style="color: #009900;">&#125;</span>
	    <span style="color: #009900;">&#125;</span>, <span style="color: #000000; font-weight: bold;">new</span> IntentFilter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;android.provider.Telephony.SMS_RECEIVED&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And in your manifest put the permission:</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.RECEIVE_SMS&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-872">
		  			<input type="hidden" class="kklike-id" value="872" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=872</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to restart a service on restart device on android</title>
		<link>http://androidgenuine.com/?p=856</link>
		<comments>http://androidgenuine.com/?p=856#comments</comments>
		<pubDate>Tue, 12 Feb 2013 06:56:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Widgets]]></category>
		<category><![CDATA[android service restart]]></category>
		<category><![CDATA[restart a service on boot device]]></category>
		<category><![CDATA[restart service on boot completed android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=856</guid>
		<description><![CDATA[In your element: &#60;uses-permission android:name=&#34;android.permission.RECEIVE_BOOT_COMPLETED&#34; /&#62; 2) In your element (be sure to use a fully-qualified [or relative] class name for your BroadcastReceiver): &#60;receiver android:name=&#34;com.example.MyBroadcastReceiver&#34;&#62; &#60;intent-filter&#62; &#60;action android:name=&#34;android.intent.action.BOOT_COMPLETED&#34; /&#62; &#60;/intent-filter&#62; &#60;/receiver&#62; public class MyBroadcastreceiver extends BroadcastReceiver &#123; @Override public void onReceive&#40;Context context, Intent intent&#41; &#123; Intent startServiceIntent = new Intent&#40;context, MyService.class&#41;; context.startService&#40;startServiceIntent&#41;; &#125; &#125; &#124;&#124;&#124;&#124;&#124;<a href="http://androidgenuine.com/?p=856">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>In your element:</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>2) In your element (be sure to use a fully-qualified [or relative] class name for your BroadcastReceiver):</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;receiver</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.example.MyBroadcastReceiver&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.intent.action.BOOT_COMPLETED&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>  
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/receiver<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyBroadcastreceiver <span style="color: #000000; font-weight: bold;">extends</span> BroadcastReceiver <span style="color: #009900;">&#123;</span>
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReceive<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context, Intent intent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        Intent startServiceIntent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Intent<span style="color: #009900;">&#40;</span>context, MyService.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        context.<span style="color: #006633;">startService</span><span style="color: #009900;">&#40;</span>startServiceIntent<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-856">
		  			<input type="hidden" class="kklike-id" value="856" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=856</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to show Menu button on ActionBar android</title>
		<link>http://androidgenuine.com/?p=851</link>
		<comments>http://androidgenuine.com/?p=851#comments</comments>
		<pubDate>Tue, 18 Dec 2012 21:54:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Compatibility]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[ActionBar]]></category>
		<category><![CDATA[menu button on ActionBar]]></category>
		<category><![CDATA[show menu button on ActionBar]]></category>
		<category><![CDATA[three dots showing in ActionBar android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=851</guid>
		<description><![CDATA[Hi, I want to show you a method that can help you to show the three dots(Menu button) on Action Bar. This button is not shown on the ActionBar if the device HAS ALREADY A MENU BUTTON. To overcome this please call in your onCreate() method the following method: private void getOverflowMenu&#40;&#41; &#123; &#160; try<a href="http://androidgenuine.com/?p=851">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
I want to show you a method that can help you to show the three dots(Menu button) on Action Bar.<br />
This button is not shown on the ActionBar if the device HAS ALREADY A MENU BUTTON.<br />
To overcome this please call in your onCreate() method the following method:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> getOverflowMenu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
     <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        ViewConfiguration config <span style="color: #339933;">=</span> ViewConfiguration.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">Field</span> menuKeyField <span style="color: #339933;">=</span> ViewConfiguration.<span style="color: #000000; font-weight: bold;">class</span>.<span style="color: #006633;">getDeclaredField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sHasPermanentMenuKey&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>menuKeyField <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            menuKeyField.<span style="color: #006633;">setAccessible</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            menuKeyField.<span style="color: #006633;">setBoolean</span><span style="color: #009900;">&#40;</span>config, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-851">
		  			<input type="hidden" class="kklike-id" value="851" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=851</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a GridView in android with Custom Adapter</title>
		<link>http://androidgenuine.com/?p=844</link>
		<comments>http://androidgenuine.com/?p=844#comments</comments>
		<pubDate>Sat, 08 Dec 2012 10:52:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Widgets]]></category>
		<category><![CDATA[custom adapter gridview]]></category>
		<category><![CDATA[custom gridview android]]></category>
		<category><![CDATA[grid layout android]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[gridview example in android]]></category>
		<category><![CDATA[gridview in android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=844</guid>
		<description><![CDATA[Hi, i want to show you how you can add implement a simple GridView to your app. There is a widget in Android called GridView. You will need just to add it in to your xml and create an adapter like on a ListView and things will work. Please look on example below: res/layout/main.xml &#60;?xml<a href="http://androidgenuine.com/?p=844">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi, i want to show you how you can add implement a simple GridView to your app.<br />
There is a widget in Android called GridView. You will need just to add it in to your xml and create an adapter like on a ListView and things will work. Please look on example below:</p>
<p>res/layout/main.xml</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;GridView</span> <span style="color: #000066;">xmlns:android</span>=<span style="color: #ff0000;">&quot;http://schemas.android.com/apk/res/android&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/gridView1&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:numColumns</span>=<span style="color: #ff0000;">&quot;auto_fit&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:gravity</span>=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:columnWidth</span>=<span style="color: #ff0000;">&quot;100dp&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:stretchMode</span>=<span style="color: #ff0000;">&quot;columnWidth&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/GridView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>res/layout/custom_adapter.xml</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LinearLayout</span> <span style="color: #000066;">xmlns:android</span>=<span style="color: #ff0000;">&quot;http://schemas.android.com/apk/res/android&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:padding</span>=<span style="color: #ff0000;">&quot;5dp&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ImageView</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/grid_item_image&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;50px&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;50px&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:layout_marginRight</span>=<span style="color: #ff0000;">&quot;10px&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:src</span>=<span style="color: #ff0000;">&quot;@drawable/android_logo&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ImageView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextView</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/grid_item_label&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:text</span>=<span style="color: #ff0000;">&quot;@+id/label&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:layout_marginTop</span>=<span style="color: #ff0000;">&quot;5px&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">android:textSize</span>=<span style="color: #ff0000;">&quot;15px&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TextView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LinearLayout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You must put in drawable folder one icon called android_logo.png<br />
Now the CustomAdapter class:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.myapp.android</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.LayoutInflater</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.ViewGroup</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.BaseAdapter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ImageView</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.TextView</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.mkyong.android.R</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ImageAdapter <span style="color: #000000; font-weight: bold;">extends</span> BaseAdapter <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Context</span> context<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> mobileValues<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> ImageAdapter<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context, <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> mobileValues<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">context</span> <span style="color: #339933;">=</span> context<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">mobileValues</span> <span style="color: #339933;">=</span> mobileValues<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">View</span> getView<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position, <span style="color: #003399;">View</span> convertView, ViewGroup parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		LayoutInflater inflater <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>LayoutInflater<span style="color: #009900;">&#41;</span> context
			.<span style="color: #006633;">getSystemService</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span>.<span style="color: #006633;">LAYOUT_INFLATER_SERVICE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">View</span> gridView<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>convertView <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			gridView <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">View</span><span style="color: #009900;">&#40;</span>context<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// get layout from custom_adapter.xml</span>
			gridView <span style="color: #339933;">=</span> inflater.<span style="color: #006633;">inflate</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">custom_adapter</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// set value into textview</span>
			TextView textView <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>TextView<span style="color: #009900;">&#41;</span> gridView
					.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">grid_item_label</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			textView.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>mobileValues<span style="color: #009900;">&#91;</span>position<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// set image based on selected text</span>
			ImageView imageView <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ImageView<span style="color: #009900;">&#41;</span> gridView
					.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">grid_item_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #003399;">String</span> mobile <span style="color: #339933;">=</span> mobileValues<span style="color: #009900;">&#91;</span>position<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//you will need to add this icons in your drawable folder</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mobile.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Windows&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				imageView.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">windows_logo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mobile.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;iOS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				imageView.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">ios_logo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mobile.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Blackberry&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				imageView.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">blackberry_logo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				imageView.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">android_logo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			gridView <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span><span style="color: #009900;">&#41;</span> convertView<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">return</span> gridView<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> getCount<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> mobileValues.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> getItem<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">long</span> getItemId<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>


<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.myapp.android</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.myapp.android.ImageAdapter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.AdapterView</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.GridView</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.TextView</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.Toast</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.AdapterView.OnItemClickListener</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GridViewActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
&nbsp;
	GridView gridView<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> MOBILE_OS <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> 
		<span style="color: #0000ff;">&quot;Android&quot;</span>, <span style="color: #0000ff;">&quot;iOS&quot;</span>,<span style="color: #0000ff;">&quot;Windows&quot;</span>, <span style="color: #0000ff;">&quot;Blackberry&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		gridView <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>GridView<span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">gridView1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		gridView.<span style="color: #006633;">setAdapter</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ImageAdapter<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>, MOBILE_OS<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		gridView.<span style="color: #006633;">setOnItemClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> OnItemClickListener<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onItemClick<span style="color: #009900;">&#40;</span>AdapterView<span style="color: #339933;">&lt;?&gt;</span> parent, <span style="color: #003399;">View</span> v,
					<span style="color: #000066; font-weight: bold;">int</span> position, <span style="color: #000066; font-weight: bold;">long</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				Toast.<span style="color: #006633;">makeText</span><span style="color: #009900;">&#40;</span>
				   getApplicationContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
				   <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>TextView<span style="color: #009900;">&#41;</span> v.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">grid_item_label</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
				   .<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, Toast.<span style="color: #006633;">LENGTH_SHORT</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>How it looks:<br />
<img src="http://androidgenuine.com//wordpress/wp-content/themes/Nyke/Nyke/images/android-gridview-example.png" alt="gridview android"></p>

		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-844">
		  			<input type="hidden" class="kklike-id" value="844" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=844</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Halo Theme , and also have minSdkVersion</title>
		<link>http://androidgenuine.com/?p=818</link>
		<comments>http://androidgenuine.com/?p=818#comments</comments>
		<pubDate>Tue, 27 Nov 2012 07:07:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Themes]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[android compatibility themes]]></category>
		<category><![CDATA[android Holo Theme]]></category>
		<category><![CDATA[holo theme android api 10]]></category>
		<category><![CDATA[set Holo Theme compatibility android]]></category>
		<category><![CDATA[set Holo Theme in android API 8]]></category>
		<category><![CDATA[set themes in android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=818</guid>
		<description><![CDATA[Hi, After the API 3.0 has appeared, now we need to handle a new Theme: Halo Theme. But if you want to use Halo theme you must have minSDK Version 11. But there is a way to have minSDKVersion]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
After the API 3.0 has appeared, now we need to handle a new Theme: Halo Theme.<br />
But if you want to use Halo theme you must have minSDK Version 11.<br />
But there is a way to have minSDKVersion<11, like 7 or 8 or whatever you want.<br />
You must create your style so that you can extend the Halo Theme or Normal Theme in function of device API.</p>
<p>You need to create beside res/values/ folder , other 2 folders called values-v11 and values-v14 like in image:<br />
<img src="http://dc174.2shared.com/img/TjzztsEK/snapshot3.png"/a></p>
<p>After creating these two folders please modify the styles.xml file in the values-v11 and values-v14 folder&#8230;<br />
So styles.xml in res/values folder will look like this:</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Theme.White&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Light&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><b>styles.xml in res/values-v11 folder will look like this:</b></p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Theme.White&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Holo.Light&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><b>styles.xml in res/values-v14 folder will look like this:</b></p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Theme.White&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Holo.Light&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you can saw all the styles have the same name,but extends a diferent parent in function of device API VERSION.<br />
Now to set universal theme for your app write in your Manifest file</p>

<div class="wp_code"><div class="pre"><pre class="xml" style="font-family:'Times New Roman',Garamond, Times;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application</span> <span style="color: #000066;">android:label</span>=<span style="color: #ff0000;">&quot;@string/app_name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activity</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;.MyActivity&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">android:theme</span>=<span style="color: #ff0000;">&quot;@style/Theme.White&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">android:label</span>=<span style="color: #ff0000;">&quot;@string/app_name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Also for Halo theme to work, do not forget to targetSdkVersion=14.<br />
and minSdkVersion can be whatever.</p>

		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-818">
		  			<input type="hidden" class="kklike-id" value="818" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">1</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=818</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to resize a drawable in Android</title>
		<link>http://androidgenuine.com/?p=825</link>
		<comments>http://androidgenuine.com/?p=825#comments</comments>
		<pubDate>Mon, 26 Nov 2012 13:52:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Widgets]]></category>
		<category><![CDATA[bitmap drawable resize android]]></category>
		<category><![CDATA[drawable resizing]]></category>
		<category><![CDATA[resize a drawable in android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=825</guid>
		<description><![CDATA[Hi, this is a snippet with how you can really resize a Drawable. Drawable drawable = getResources&#40;&#41;.getDrawable&#40;android.R.drawable.ic_search_category_default&#41;; &#160; Bitmap bitmap = &#40;&#40;BitmapDrawable&#41; drawable&#41;.getBitmap&#40;&#41;; Drawable d = new BitmapDrawable&#40;getResources&#40;&#41;, Bitmap.createScaledBitmap&#40;bitmap, 30, 30, true&#41;&#41;; &#124;&#124;&#124;&#124;&#124; 0 I Like It! &#124;&#124;&#124;&#124;&#124;]]></description>
			<content:encoded><![CDATA[<p>Hi, this is a snippet with how you can really resize a Drawable.</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"> Drawable drawable <span style="color: #339933;">=</span> getResources<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getDrawable</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">R</span>.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">ic_search_category_default</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    Bitmap bitmap <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>BitmapDrawable<span style="color: #009900;">&#41;</span> drawable<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getBitmap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    Drawable d <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BitmapDrawable<span style="color: #009900;">&#40;</span>getResources<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, Bitmap.<span style="color: #006633;">createScaledBitmap</span><span style="color: #009900;">&#40;</span>bitmap, <span style="color: #cc66cc;">30</span>, <span style="color: #cc66cc;">30</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-825">
		  			<input type="hidden" class="kklike-id" value="825" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">0</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=825</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a layout animation in android</title>
		<link>http://androidgenuine.com/?p=801</link>
		<comments>http://androidgenuine.com/?p=801#comments</comments>
		<pubDate>Wed, 21 Nov 2012 07:26:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[android simple animation of layout]]></category>
		<category><![CDATA[animate layout in android]]></category>
		<category><![CDATA[hwo to animate a layout in android]]></category>
		<category><![CDATA[transition animation for layouts in android]]></category>

		<guid isPermaLink="false">http://androidgenuine.com/?p=801</guid>
		<description><![CDATA[Hi, I want to show you how to animate a layout in android. Let&#8217;s say you want to animate a group of views and not only a view. I will give you example a LinearLayout. For referring to a LinearLayout you need to have an id for it in xml file like this: &#60;LinearLayout android:id=&#34;@+id/myLayoutId&#34;<a href="http://androidgenuine.com/?p=801">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
I want to show you how to animate a layout in android.<br />
Let&#8217;s say you want to animate a group of views and not only a view. I will give you example a LinearLayout.<br />
For referring to a LinearLayout you need to have an id for it in xml file like this:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;"><span style="color: #339933;">&lt;</span>LinearLayout   android<span style="color: #339933;">:</span>id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;@+id/myLayoutId&quot;</span>
                    android<span style="color: #339933;">:</span>layout_width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fill_parent&quot;</span>
                    android<span style="color: #339933;">:</span>layout_height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;wrap_content&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>LinearLayout<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Then you will search for this layout in your java code and apply TransitionAnimation:</p>

<div class="wp_code"><div class="pre"><pre class="java" style="font-family:'Times New Roman',Garamond, Times;">onCreate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
toolbarWidget <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>LinearLayout<span style="color: #009900;">&#41;</span>findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">toolbarWidget</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
toolbarWidget.<span style="color: #006633;">startAnimation</span><span style="color: #009900;">&#40;</span>inFromRightAnimation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">private</span> Animation inFromRightAnimation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        Animation inFromRight <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TranslateAnimation<span style="color: #009900;">&#40;</span>
                Animation.<span style="color: #006633;">RELATIVE_TO_PARENT</span>,  <span style="color: #339933;">+</span>1.0f, Animation.<span style="color: #006633;">RELATIVE_TO_PARENT</span>,  0.0f,
                Animation.<span style="color: #006633;">RELATIVE_TO_PARENT</span>,  0.0f, Animation.<span style="color: #006633;">RELATIVE_TO_PARENT</span>,   0.0f
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        inFromRight.<span style="color: #006633;">setDuration</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        inFromRight.<span style="color: #006633;">setInterpolator</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AccelerateInterpolator<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> inFromRight<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Hope this is usefull for you.</p>

		<div class="kklike-content kklike-button-light">
			<span style="display: none;">|||||</span>
		  		<a href="#" class="kklike-box kk-right " rel="kklike-801">
		  			<input type="hidden" class="kklike-id" value="801" />
		  			<input type="hidden" class="kklike-type" value="post" />
		  			<input type="hidden" class="kklike-action" value="like" />
		  			<input type="hidden" class="kklike-ou" value="0" />
					<span class="kklike-ico"></span> 
					<span class="kklike-value ">1</span>
					<span class="kklike-text">I Like It!</span>
				</a>
			<span style="display: none;">|||||</span>
			<div class="kkclear"></div>
		</div>
	 	]]></content:encoded>
			<wfw:commentRss>http://androidgenuine.com/?feed=rss2&#038;p=801</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
