tag:blogger.com,1999:blog-19558378802339226982024-02-20T02:45:56.713-08:00Android SupporterThis blog is to help the android people in Application Development.The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-1955837880233922698.post-58564528162268849082012-03-18T01:14:00.000-07:002012-03-18T01:14:30.707-07:00<b><span style="font-size: large;">Saving Objects(Synchronized) in Files in Android</span></b><br />
<b><span style="font-size: large;"><br /></span></b><br />
We can save the all the synchronized Objects in Android using File Connections even if the Object is a customized or user defined object.<br />
<br />
<b> Saving the Objects:</b><br />
<b><br /></b><br />
<b>step 1: </b><br />
<br />
Open a file using the below code.<br />
<br />
File suspend_f = new File("/data/data/com.rama.rama/cache/check.txt");<br />
<br />
here i had saved the file in the application space in the device which will be removed when the application is un-installed. You can save it any where. but you should remember it for further fetching of the objects.<br />
<br />
<b>Step 2:</b><br />
<br />
Opening an outputStream for the File object and writing the object to file as shown below.<br />
<br />
<blockquote class="tr_bq">
fos = new FileOutputStream(suspend_f);<br /> oos = new ObjectOutputStream(fos);<br /> oos.writeInt(10);<br /> for(int i=0 ;i<10;i++)<br /> oos.writeObject(new Lecture("Mahesh"+i, "sta", "end", "one", true));</blockquote>
<br />
We should read the objects in the same order that you write objects.<br />
<br />
<br />
<b>Reading the Objects:</b><br />
<b><br /></b><br />
<b>step 1:</b><br />
<b><br /></b><br />
Opening the file object just as like the above step1.<br />
<br />
<b>Step 2:</b><br />
<b><br /></b><br />
Opening InputStream of the File Object and reading the objects in the same order that we write in the file.<br />
<br />
<br />
<blockquote class="tr_bq">
fis = new FileInputStream(suspend_f);<br /> ois = new ObjectInputStream(fis);<br /> String s = "";<br /> int j=ois.readInt();<br /> for(int i=0;i<j;i++)<br> {<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span> _l = (Lecture)ois.readObject();<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span> s+=_l;<br /> }</j;i++)<br></blockquote>
The whole code can be downloaded from <a href="https://docs.google.com/open?id=0B6Bh4iS4gMZxajJuQXhGR2lUTGFKbUFDVjNFQXh6QQ" target="_blank">this link</a>.<br />
The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0tag:blogger.com,1999:blog-1955837880233922698.post-32774657909313396922012-03-18T00:23:00.001-07:002012-03-18T00:23:11.160-07:00<title>Blog Update</title><style type="text/css">
ol{margin:0;padding:0}p{margin:0}.c5{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c1{color:#1155cc;text-decoration:underline}.c8{color:inherit;text-decoration:inherit}.c0{font-size:14pt;font-weight:bold}.c4{color:#7f0055;font-weight:bold}.c7{height:11pt}.c12{color:#646464}.c6{color:#0000c0}.c13{font-weight:bold}.c11{color:#7f0055}.c10{color:#2a00ff}.c9{color:#009900}.c2{color:#000099}.c3{direction:ltr}.title{padding-top:24pt;line-height:1.15;text-align:left;color:#000000;font-size:36pt;font-family:Arial;font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:Georgia;padding-bottom:4pt}body{color:#000000;font-size:11pt;font-family:Arial}h1{padding-top:24pt;line-height:1.15;text-align:left;color:#000000;font-size:18pt;font-family:Arial;font-weight:bold;padding-bottom:6pt}h2{padding-top:18pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:Arial;font-weight:bold;padding-bottom:4pt}h3{padding-top:14pt;line-height:1.15;text-align:left;color:#666666;font-size:12pt;font-family:Arial;font-weight:bold;padding-bottom:4pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:11pt;font-family:Arial;padding-bottom:2pt}h5{padding-top:11pt;line-height:1.15;text-align:left;color:#666666;font-size:10pt;font-family:Arial;font-weight:bold;padding-bottom:2pt}h6{padding-top:10pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:10pt;font-family:Arial;padding-bottom:2pt}
</style><br />
<div class="c3">
<span class="c13" style="font-size: x-large;">Custom Broadcasts:</span></div>
<div class="c3">
<br /></div>
<div class="c3">
Unlike system originated broadcasts, these are the broadcasts which are sent by user. Usually these are useful in communicating back with activity from services.</div>
<div class="c3">
<br /></div>
<div class="c3">
<span class="c13">Step 1: </span>Write the below code where ever you want to send a custom broadcast:</div>
<div class="c3">
<br /></div>
<div class="c3">
Intent broadcastIntent = <span class="c4">new</span> Intent();</div>
<div class="c3">
broadcastIntent.setAction(<span class="c10">"com.vl.dumptruck.ACTION_LOGOUT"</span>);</div>
<div class="c3">
sendBroadcast(broadcastIntent);</div>
<div class="c3">
<br /></div>
<div class="c3">
In above code, we are creating a Intent with custom action and broadcasting it.</div>
<div class="c3">
<br /></div>
<div class="c3">
<span class="c13">Step 2: </span>Write the below code in the class which will be responsible for receiving broadcasts:</div>
<div class="c3">
<span class="c4">private</span></div>
<div class="c3">
BroadcastReceiver <span class="c6">logoutReceiver</span>;</div>
<div class="c3">
IntentFilter logoutIntentFilter = <span class="c11">new</span> IntentFilter();</div>
<div class="c3">
logoutIntentFilter.addAction(<span class="c10">"com.vl.dumptruck.ACTION_LOGOUT"</span>);</div>
<div class="c3">
<span class="c6">logoutReceiver</span> = <span class="c11">new</span> BroadcastReceiver() {</div>
<div class="c3">
<span class="c12"> @Override</span></div>
<div class="c3">
<span class="c11"> public</span> <span class="c11">void</span> onReceive(Context context, Intent intent) {</div>
<div class="c3">
//perform the task here</div>
<div class="c3">
}</div>
<div class="c3">
};</div>
<div class="c3">
registerReceiver(<span class="c6">logoutReceiver</span>, logoutIntentFilter);</div>
<div class="c3">
<br /></div>
<div class="c3">
1. In the above code, we are creating an IntentFilter with the action same as specified when sending the broadcast.</div>
<div class="c3">
2. And a BroadcastReceiver, which is responsible for performing a task upon receing the broadcast(override the onReceive() method).</div>
<div class="c3">
3. Now, register the broadcast using registerReceiver() method by passing BroadcastReceiver and IntentFilter objects. Here receiver is to call the callback method onReceive() and intent filter is to check whether the the receiver is authorized to respond to the broadcasted intent.</div>
<div class="c3">
4. Finally, unregister the broadcast receiver using unregisterReceiver() by passing the receiver object, otherwise you will get a broadcast leaked exception.</div>
<div class="c3">
<br /></div>
<div class="c3">
unregisterReceiver(<span class="c6">logoutReceiver</span>);</div>
<div class="c3">
<br /></div>
<div class="c3">
<span class="c13">Note: </span>Be careful with registering and unregistering broadcasts.</div>
<div class="c3">
1. If you register a broadcast in onCreate(), then you have to unregister it in onDestroy(), with this the activity is capable of receiving the broadcasts even when activity is in background(i.e, in onPause() state also). </div>
<div class="c3">
2. If you register a broadcast in onCreate() and you dont want to respond to broadcasts when you are in background(onPause()), then unregister your receiver in onPause() and register again in onResume() to start receiving broadcasts again and finally unregister it in onDestroy().</div>
<div class="c7 c3">
</div>
<b><span style="font-size: large;"><br /><br /><br />Move Android Apps Installation to SD Card</span></b><div class="c7 c3">
</div>
<div class="c3">
Please start using the tag name <span class="c9">android:installation</span> as shown below to enable the option to move the installation files to SDCard.</div>
<div class="c3 c7">
</div>
<div class="c3">
<span class="c2"><manifest xmlns:android=</span><span class="c1"><a class="c8" href="http://schemas.android.com/apk/res/android">"http://schemas.android.com/apk/res/android"</a></span></div>
<div class="c3">
<span class="c2"> package="xxx.xx.xxxx"</span></div>
<div class="c3">
<span class="c2"> android:versionCode="1"</span></div>
<div class="c3">
<span class="c2"> android:versionName="0.9.6" </span><span class="c9">android:installLocation= "auto"</span><span class="c2"> ></span></div>
<div class="c7 c3">
<span class="c2"></span></div>
<div class="c7 c3">
<span class="c2"></span></div>
<div class="c3">
This property is introduced in Introduced in API Level 8.</div>
<div class="c7 c3">
</div>
<div class="c3">
Reference :<a class="c8" href="http://developer.android.com/guide/topics/manifest/manifest-element.html#install"> </a><span class="c1"><a class="c8" href="http://developer.android.com/guide/topics/manifest/manifest-element.html#install">http://developer.android.com/guide/topics/manifest/manifest-element.html#install</a></span></div>
<div class="c7 c3">
<span class="c1"><a class="c8" href="http://developer.android.com/guide/topics/manifest/manifest-element.html#install"></a></span></div>
<div class="c7 c3">
</div>The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0tag:blogger.com,1999:blog-1955837880233922698.post-42091066031663553942012-01-29T08:04:00.000-08:002012-01-29T08:18:38.923-08:00Android Project Tracking & Management & Tools<title>BlogUpdater_1_27_2012.doc</title><style type="text/css">
@import url('https://themes.googleusercontent.com/fonts/css?kit=wAPX1HepqA24RkYW1AuHYA');ol{margin:0;padding:0}p{margin:0}.c1{line-height:1.0;padding-top:5pt;direction:ltr;padding-bottom:5pt}.c2{color:#0000c0;font-size:12pt;font-style:italic}.c24{width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c22{list-style-type:disc;margin:0;padding:0}.c21{list-style-type:decimal;margin:0;padding:0}.c5{height:11pt;direction:ltr}.c0{color:#7f0055;font-weight:bold}.c3{text-decoration:underline;font-weight:bold}.c10{color:#3f7f5f;font-weight:bold}.c11{color:inherit;text-decoration:inherit}.c15{list-style-position:inside;text-indent:27pt}.c8{padding-left:0pt;direction:ltr}.c13{color:#0000ff}.c9{direction:ltr}.c18{text-decoration:underline}.c7{font-size:9pt}.c4{font-size:12pt}.c16{height:11pt}.c23{margin-left:144pt}.c19{padding-left:0pt}.c12{color:#0000c0}.c17{color:#3f7f5f}.c14{text-indent:36pt}.c6{margin-left:36pt}.c20{font-weight:bold}body{color:#000000;font-size:11pt;font-family:Calibri}h1{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:16pt;font-family:Arial;font-weight:bold;padding-bottom:3pt}h2{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-style:italic;font-size:14pt;font-family:Arial;font-weight:bold;padding-bottom:3pt}h3{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:13pt;font-family:Arial;font-weight:bold;padding-bottom:3pt}h4{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:14pt;font-family:Calibri;font-weight:bold;padding-bottom:3pt}h5{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-style:italic;font-size:13pt;font-family:Calibri;font-weight:bold;padding-bottom:3pt}h6{padding-top:12pt;line-height:1.15;text-align:left;color:#000000;font-size:11pt;font-family:Calibri;font-weight:bold;padding-bottom:3pt}
</style><br />
<div class="c9">
Hi friends, after a long time I want to help all of you people in the below concerns.</div>
<ol class="c22" start="1">
<li class="c15 c9 c6">Architecture:</li>
<li class="c15 c9 c6">Exception Tracking</li>
<li class="c9 c6 c15">2DScrollView</li>
<li class="c15 c9 c6">C2DM</li>
<li class="c15 c9 c6">Tools</li>
</ol>
<div class="c9">
Architecture</div>
<div class="c9">
I know lot of you people knows about this. But, let me explain this for the other people. The structure of the project should be as shown in thebelow format.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrp9QlJ7_xYmVgkZPcmj8ExpIKlIBpd3d4MTGknnUT-BSUih9XhmhcET9nN9IrxobtXqCq2PWf7bB8w78F5d5TRb4a16BU2YWN6lGJnGl19QbduV_g2a_ZMkfeLThe_7IRSyRybWyMUuo/s1600/image00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrp9QlJ7_xYmVgkZPcmj8ExpIKlIBpd3d4MTGknnUT-BSUih9XhmhcET9nN9IrxobtXqCq2PWf7bB8w78F5d5TRb4a16BU2YWN6lGJnGl19QbduV_g2a_ZMkfeLThe_7IRSyRybWyMUuo/s320/image00.png" width="198" /></a></div>
<div class="c9 c14">
In the above image the custom Activity is the Super Activity for all of the activities where you can add unique requirements throughout the project. i.e., Exception tracking/MenuItems handling according to currentModule etc…,</div>
<div class="c5 c14">
</div>
<div class="c9 c14">
First of all we should take care about the architecture while we are starting a project which will helps you a lot in the process of project enhancements and re-usability.</div>
<div class="c9">
<span class="c3">package.ui:</span><span class="c20"> </span>Here we need to add all the custom views that are developed. So that we can use these UI from anywhere in the project and can also be maintained same for all of your future projects.</div>
<div class="c9">
<span class="c3">package.util:</span><span class="c20"> </span>Here we need to add all the constants and utility functions like validations for dates/times or project specific things which can be used from the project.</div>
<div class="c9">
<span class="c3">Dispatchmodule:</span> This is the startup module for all the projects. So that you can easily identify the starting activity in all the projects.</div>
<div class="c9">
Every module should have an engine. All the activities should implement CustomActivity which is there in the package.ui which is implementing Activity.</div>
<div class="c9">
<span class="c3">Module1,2…..n:</span> Depending upon the project, the number of modules will be divided to manage the project with ease.</div>
<div class="c9">
At any instant, we can know all the information about the project (i.e., Module ID, Activity ID, Stack which contains all the Activity instances which are running in the background etc…,).</div>
<div class="c9">
<span class="c3">NetworkHandler:</span> We should write all the handlers which can give the project running status information. Every time we starting a module/activity, this class should be intimated with the corresponding information.</div>
<div class="c5">
</div>
<div class="c9">
<span class="c3">Exception Tracking:</span></div>
<div class="c9">
Here is a simple class file which will be very useful to track your Android applications even after sending it to the client or to the market or to the testers. This class will always track your application and it will get informed with all the exceptions (even if it is a Force Close).</div>
<div class="c9">
<a href="http://pavandroid.in/data/index">Click here to get this class.</a></div>
<div class="c9">
How to use this:</div>
<ol class="c21" start="1">
<li class="c6 c8">Just copy and paste the downloaded java file in to your project.</li>
<li class="c8 c6">Create an instance for this activity in the CustomActivity as shown below.</li>
</ol>
<div class="c5 c6">
</div>
<div class="c9 c6">
<span class="c0">protected</span> PostMortemReportExceptionHandler <span class="c12">mDamageReport</span> = <span class="c0">new</span> PostMortemReportExceptionHandler(<span class="c0">this</span>);</div>
<div class="c9 c6">
<br /></div>
<div class="c9 c6">
</div>
<div class="c5 c6">
</div>
<ol class="c21" start="3">
<li class="c8 c6">Just to start the exception tracking.</li>
</ol>
<div class="c1 c14 c6">
<span class="c0">public</span> <span class="c0">void</span> onCreate(Bundle savedInstanceState) {</div>
<div class="c1 c23">
<span class="c0">super</span>.onCreate(savedInstanceState);<span class="c12"> mDamageReport</span>.initialize();</div>
<div class="c1 c6 c14">
}</div>
<ol class="c21" start="4">
<li class="c1 c6 c19">Closing/Stopping the tracker in the Activity.</li>
</ol>
<div class="c1 c14 c6">
<span class="c0">protected</span> <span class="c0">void</span> onDestroy() {</div>
<div class="c1">
<span class="c12"> mDamageReport</span>.restoreOriginalHandler();</div>
<div class="c1">
<span class="c12"> mDamageReport</span> = <span class="c0">null</span>;</div>
<div class="c1">
<span class="c0"> super</span>.onDestroy();</div>
<div class="c1">
}</div>
<div class="c1 c6 c16">
</div>
<div class="c1 c6">
Every thing done. You can get updated with crash or exceptions.</div>
<div class="c1">
<span class="c3">Customizing the Tracker:</span></div>
<div class="c9">
We can customize the way of getting the information of the exception or crash from the mobile device to the server. Either we can go for creating a specific web service to catch the crash report or else we can go for mail option in which we can respect the user’s privacy and can ask for his permission to send the mail.</div>
<div class="c5">
</div>
<div class="c1">
<span class="c0 c4">private</span><span class="c4"> </span><span class="c0 c4">static</span><span class="c4"> </span><span class="c0 c4">final</span><span class="c4"> </span><span class="c0 c4">int</span><span class="c4"> </span><span class="c2">SENDING_OPTION</span><span class="c4"> = 1;</span><span class="c4 c17">// 0 --> Send Through Mail (Need user interference)</span></div>
<div class="c1">
<span class="c4 c17"> // 1 --> Sending without user interference or confirmation</span></div>
<div class="c1">
<span class="c4 c17">By using this variable, we can select the options wether </span><span class="c4 c10">we can directly post it to our webservice</span><span class="c4 c17"> or </span><span class="c10 c4">to</span><span class="c4 c17"> </span><span class="c10 c4">take the user's permission</span><span class="c4 c17"> </span><span class="c10 c4">by preparing a mail and asking him to send it.</span><span class="c4 c17"> </span></div>
<div class="c1">
<span class="c4">if we want to send it to a mail id the we can specify the mail id for the below variable</span></div>
<div class="c1">
<span class="c0 c4">private</span><span class="c4"> </span><span class="c0 c4">static</span><span class="c4"> </span><span class="c0 c4">final</span><span class="c4"> String </span><span class="c2">MSG_SENDTO</span><span class="c4"> = </span><span class="c13 c18 c4"><a class="c11" href="http://www.blogger.com/blogger.g?blogID=1955837880233922698">xyz@gmail.com</a></span><span class="c4">;</span></div>
<div class="c1">
<span class="c0 c4">private</span><span class="c4"> </span><span class="c0 c4">static</span><span class="c4"> </span><span class="c0 c4">final</span><span class="c4"> String </span><span class="c2">BUG_TRACKER_URL</span><span class="c4"> = </span><span class="c13 c4 c18"><a class="c11" href="http://tracking.webservice/gather.php">http://tracking.webservice/gather.php</a></span><span class="c4">; </span></div>
<div class="c1">
<br /></div>
<div class="c1">
<span class="c4">// This is the webservice URL which is used to post the issue info</span></div>
<div class="c5">
<span class="c4"></span></div>
<div class="c5">
<span class="c4"></span></div>
<div class="c9">
<span class="c3">2DscrollView:</span></div>
<div class="c5">
<span class="c3"></span></div>
<div class="c9">
In Android, we should not add a scrollview to another scrollview. Because, If we add in such a way then it will leads to the memory issues. If you want both horizontal and vertical scrolls for a single view, then you should go for a CustomFrameView.</div>
<div class="c9">
For further information about the 2Dscroll view please click on the below link.</div>
<div class="c5">
</div>
<div class="c9">
<span class="c3 c13"><a class="c11" href="http://blog.gorges.us/2010/06/android-two-dimensional-scrollview/">http://blog.gorges.us/2010/06/android-two-dimensional-scrollview/</a></span></div>
<div class="c9">
<br /></div>
<div class="c9">
<br /></div>
<div class="c5">
<span class="c3 c13"><a class="c11" href="http://blog.gorges.us/2010/06/android-two-dimensional-scrollview/"></a></span></div>
<div class="c9">
<span class="c3">C2DM:</span></div>
<div class="c9">
Cloud To Device Messaging is a concept which is introduced in Android from OS version 2.2. The concept of C2DM is to optimize the network usage of the Android applications in push notifications. </div>
<div class="c9">
Normally for every application, in order to get the push notifications, we should have a separate thread /service running in the background of the operating system continuously hitting the server in equal intervals of time which will drains the battery of the device and unnecessary usage of network. If we want push notifications for ‘n’ number of applications, then we should run ‘n’ number of services to get the notifications for n applications.</div>
<div class="c9">
For every Android device, there will be default Google service running in the background which will take care about all the Google applications in device. After 2.2, they gave us an option to use the same Google service. So, that there is no need of running separate threads for each and every application.</div>
<div class="c9">
We should send the desired message with the device ID to the Google C2DM server. then, the message will be sent to the device from the Google C2DM server.</div>
<div class="c9">
We can get the device ID from the device after registering it to the Google C2DM server. We should send this ID from device to our Application third party Server. Then after, the application server will send the message to that specific device by using this device ID.</div>
<div class="c9">
The device ID will be updated every time when the Google server get refreshed. Then the Google server will automatically send a broadcast message to the device and then we should get the device ID again and should intimate about the change of the Device ID to application third party server. So, that the application server will send the messages by using the updated device ID.</div>
<div class="c5">
</div>
<div class="c9">
I will update this later by adding the code snippets later.</div>
<div class="c5">
</div>
<div class="c9">
<span class="c3">TOOLS:</span></div>
<div class="c9">
<span class="c3 c7">DDMS:</span></div>
<div class="c9">
<span class="c7">This is used to fetch the logs, process id’s of the applications and to get the memory usage of the operating system and many more. </span></div>
<div class="c9">
<span class="c3 c7">ADB:</span></div>
<div class="c9">
<span class="c7">This is used to install/uninstall/to fetch running devices/pushing or pulling files/opening shell/fetching logs/ starting or killing the adb server.</span></div>
<div class="c9">
<span class="c3 c7">ADT:</span></div>
<div class="c9">
<span class="c7"> This is a plugin for eclipse, which will be helpful in developing android applications in Eclipse.</span></div>
<div class="c9">
<span class="c3 c7">9-patch:</span></div>
<div class="c9">
<span class="c7">This tool is used to optimize the usage of assets. This tool will add a single line pixel around the image. In which we can specify whether the corresponding pixels can be stretched or not. If we change the white space to black, then it resembles that the corresponding pixels are stretchable.</span></div>
<div class="c9">
<span class="c3 c7">Hierarchyviewer:</span></div>
<div class="c9">
<span class="c7">This is used to view the hierarchy of the layouts in the application. Even we can download the psd’d of the screen which will provide the complete information of the screen in photoshop.</span></div>
<div class="c9">
<span class="c3 c7">Monkeyrunner:</span></div>
<div class="c9">
<span class="c7"> This is a tool for automation testing. We can specify the number of turns for testing basing on which it will test the application.</span></div>
<div class="c9">
<span class="c3 c7">sqlite3:</span></div>
<div class="c9">
<span class="c7"> This is used to check the sqllite database.</span></div>The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0tag:blogger.com,1999:blog-1955837880233922698.post-13594505438107099262011-08-10T02:30:00.000-07:002011-08-10T02:32:10.986-07:00Checking Internet Connection in Androidprivate boolean checkInternetConnection() {
<br />
<br /> ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
<br /> if (conMgr.getActiveNetworkInfo() != null
<br /> && conMgr.getActiveNetworkInfo().isAvailable()
<br /> && conMgr.getActiveNetworkInfo().isConnected()) {
<br />
<br /> //tryLogic;
<br /> return true;
<br />
<br /> } else {
<br />
<br /> Toast.makeText(Login.this, “Internet Connection Not Present”, Toast.LENGTH_LONG).show();
<br /> Log.v(TAG, “Internet Connection Not Present”);
<br /> return false;
<br />
<br /> }
<br />}The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0tag:blogger.com,1999:blog-1955837880233922698.post-64461764958549955972011-08-06T19:02:00.000-07:002011-08-06T20:01:27.801-07:00Exiting the Android Application Safely<title>Myblog.doc</title><style type="text/css">ol{margin:0;padding:0}p{margin:0}.c11{vertical-align:top;width:414.8pt;border-style:solid;border-color:#000000;border-width:1pt;padding:2.8pt 2.8pt 2.8pt 2.8pt}.c7{color:#7f0055;font-size:10pt;font-family:Courier New;font-weight:bold}.c0{color:#0000ff;font-size:10pt;font-family:Courier New;font-weight:bold}.c1{color:#0000ff;font-size:10pt;font-family:Courier New}.c8{width:498.6pt;background-color:#ffffff;padding:56.7pt 56.7pt 56.7pt 56.7pt}.c4{font-size:10pt;font-style:italic;font-family:Courier New}.c12{font-size:10pt;font-family:Courier New}.c6{height:12pt}.c9{border-collapse:collapse}.c3{direction:ltr}.c10{height:0pt}.c2{color:#0000ff}.c5{font-style:italic}body{color:#000000;font-size:12pt;font-family:Times New Roman}h1{padding-top:12pt;line-height:1.0;text-align:left;color:#000000;font-size:16pt;font-family:Arial;font-weight:bold;padding-bottom:3pt}h2{padding-top:12pt;line-height:1.0;text-align:left;color:#000000;font-style:italic;font-size:14pt;font-family:Arial;font-weight:bold;padding-bottom:3pt}h3{padding-top:12pt;line-height:1.0;text-align:left;color:#000000;font-size:13pt;font-family:Arial;font-weight:bold;padding-bottom:3pt}h4{padding-top:12pt;line-height:1.0;text-align:left;color:#000000;font-size:14pt;font-family:Times New Roman;font-weight:bold;padding-bottom:3pt}h5{padding-top:12pt;line-height:1.0;text-align:left;color:#000000;font-style:italic;font-size:13pt;font-family:Times New Roman;font-weight:bold;padding-bottom:3pt}h6{padding-top:12pt;line-height:1.0;text-align:left;color:#000000;font-size:11pt;font-family:Times New Roman;font-weight:bold;padding-bottom:3pt}</style><p class="c3"><span class="c7"> </span></p><p class="c3"><span class="c7"> </span><span class="c12">Android don't have a proper option to exit the complete application with a single line code. The only option we can do is, just calling the finish in all the activities. Even after calling finish(), the static variables wont go, will be there even after restarting the application. In order to exit the application completely we have to follow the bottom trick. We should call “addActivityInstance” method from all the activities. This method will save all the activitiy instances in </span><span class="c4">_list_screens which is nothing but a ArrayList<Activity>. Whenevr you want to exit the application, just call the method “closeAllScreens”. Where we just called the finish of all the activities and after that we are calling “android.os.Process.killProcess” to kill the whole process including all the static data.</span></p><p class="c6 c3"><span class="c4"></span></p><p class="c6 c3"><span class="c4"></span></p><table class="c9" cellpadding="0" cellspacing="0"><tbody><tr class="c10"><td class="c11"><p class="c3"><span class="c0">public</span><span class="c2"> </span><span class="c0">static</span><span class="c2"> </span><span class="c0">void</span><span class="c2"> </span><span class="c1">addActivityInstance(Activity _activity)</span></p><p class="c3"><span class="c1">{</span></p><p class="c3"><span class="c2"> </span><span class="c0">if</span><span class="c1">( </span><span class="c1 c5">_list_screens</span><span class="c2"> </span><span class="c1">== </span><span class="c0">null</span><span class="c2"> </span><span class="c1">)</span></p><p class="c3"><span class="c2"> </span><span class="c1">{</span></p><p class="c3"><span class="c2"> </span><span class="c1 c5">_list_screens</span><span class="c2"> </span><span class="c1">= </span><span class="c0">new</span><span class="c2"> </span><span class="c1">ArrayList<Activity>();</span></p><p class="c3"><span class="c2"> </span><span class="c1">}</span></p><p class="c3"><span class="c2"> </span><span class="c1 c5">_list_screens</span><span class="c1">.add(_activity);</span></p><p class="c3"><span class="c1">}</span></p><p class="c6 c3"><span class="c1"></span></p><p class="c3"><span class="c0">public</span><span class="c2"> </span><span class="c0">static</span><span class="c2"> </span><span class="c0">void</span><span class="c2"> </span><span class="c1">closeAllScreens()</span></p><p class="c3"><span class="c1">{</span></p><p class="c3"><span class="c2"> </span><span class="c0">if</span><span class="c1">(</span><span class="c1 c5">_list_screens</span><span class="c1">!=</span><span class="c0">null</span><span class="c1">)</span></p><p class="c3"><span class="c2"> </span><span class="c0">for</span><span class="c1">(</span><span class="c0">int</span><span class="c2"> </span><span class="c1">i=0;i<</span><span class="c1 c5">_list_screens</span><span class="c1">.size();i++)</span></p><p class="c3"><span class="c2"> </span><span class="c0">if</span><span class="c1">(</span><span class="c1 c5">_list_screens</span><span class="c1">.get(i)!=</span><span class="c0">null</span><span class="c1">)</span></p><p class="c3"><span class="c2"> </span><span class="c1 c5">_list_screens</span><span class="c1">.get(i).finish();</span></p><p class="c3"><span class="c2"> </span><span class="c0">try</span><span class="c1">{</span></p><p class="c3"><span class="c2"> </span><span class="c1">android.os.Process.</span><span class="c1 c5">killProcess</span><span class="c1">(android.os.Process.</span><span class="c1 c5">myPid</span><span class="c1">());</span></p><p class="c3"><span class="c2"> </span><span class="c1">}</span><span class="c0">catch</span><span class="c1">(Exception e){</span></p><p class="c3"><span class="c2"> </span></p><p class="c3"><span class="c2"> </span><span class="c1">}</span></p><p class="c3"><span class="c1">}</span></p><p class="c3 c6"><span class="c1"></span></p></td></tr></tbody></table><p class="c6 c3"><span class="c1"></span></p><p class="c6 c3"><span class="c1"></span></p><p class="c6 c3"><span class="c1"></span></p><p class="c3"><span class="c7"> </span></p>The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0tag:blogger.com,1999:blog-1955837880233922698.post-45240919850716087182010-09-28T09:10:00.000-07:002011-02-07T19:09:06.764-08:00<title>How to create a Calendar in Android.doc</title><style type="text/css">ol{margin:0;padding:0}p{margin:0}.c0{line-height:1.15;text-indent:0pt;direction:ltr;padding-bottom:10.0pt}.c1{color:#000000;font-size:11pt;font-family:Trebuchet MS}.c3{text-decoration:underline;font-weight:bold}.c2{background-color:#ffffff}</style><p class="c0"><span class="c1 c3">How to create a Calendar in Android</span></p><p class="c0"><span class="c1"> Hi dudes, In Android there is no Calendar View (Android 2.2 version or above has Calendars). If u want it then we need to create our own Calendar. So, I had developed a dummy Calendar in Android.</span></p><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1">Here is the simple code for Calendar. I used the </span><span class="c1">Java Calendar so Java’s Calendar Limitation is this calendar’s Limitation.</span></p><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1">You can download Source from <a href="https://docs.google.com/leaf?id=0B2qCFbmeiTFxYWUxOTIyMjAtODJiYy00NzliLTg2YWYtYzkzYjBiZjc1NjI2&hl=en&authkey=CLq2jJcP">here </a>or <a href="http://pavandroid.ucoz.com/CalendarPreparation.zip">here</a>.</span></p><p class="c0"><span class="c1"> </span></p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhykfMUZQ9vFQeuJRqVMGeI_nAxpo9uk7Hi2F41NqtFqIXWzxa_S3MdwhHf60JPis2rnlcSWuTOU5QF2T5z6AFNRF-bYlNJPCph0BXmsiee70qmw3g41Gu508ZXTl_7viGGAWzoezPWpPg/s1600/Calendar.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 165px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhykfMUZQ9vFQeuJRqVMGeI_nAxpo9uk7Hi2F41NqtFqIXWzxa_S3MdwhHf60JPis2rnlcSWuTOU5QF2T5z6AFNRF-bYlNJPCph0BXmsiee70qmw3g41Gu508ZXTl_7viGGAWzoezPWpPg/s320/Calendar.png" alt="" id="BLOGGER_PHOTO_ID_5521998044343008370" border="0" /></a><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1 c3">Implementation of “Please wait” Dialogues in Android projects</span></p><p class="c0"><span class="c1"> Implementing Dialogue boxes also plays with us some times. In order to handle it properly again it’s better to handle the AsyncTask in Android as shown in the previous blog for handling the list of Server Images downloading.</span></p><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1"> Here you can download the source for previous XML parsing with Dialog Bar Implementation.</span></p><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1">You can download Source from <a href="https://docs.google.com/leaf?id=0B2qCFbmeiTFxN2ViZjVlOTUtNmY3ZS00NThhLTg3N2UtYjVkYjgyM2Y4MWUy&hl=en&authkey=COeP8JYN">here </a>or <a href="http://pavandroid.ucoz.com/XmlParsing_Dialog.zip">here</a>.</span></p><p class="c0"><span class="c1"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFDgRsj-S5elqAQoVxg4eRi7raXKJs25TPaLwV1krmJQbbO5ZWdktwHmKz2gZbRnCRy2dlMG1TyoP8IDdSdriaQk_-PkoVHW1x42CCcmclMU2pgYz2f_PF8ZbDjt_rNYblFpFzgSIdp8I/s1600/Loadin_bar.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 227px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFDgRsj-S5elqAQoVxg4eRi7raXKJs25TPaLwV1krmJQbbO5ZWdktwHmKz2gZbRnCRy2dlMG1TyoP8IDdSdriaQk_-PkoVHW1x42CCcmclMU2pgYz2f_PF8ZbDjt_rNYblFpFzgSIdp8I/s320/Loadin_bar.png" alt="" id="BLOGGER_PHOTO_ID_5521998284353714706" border="0" /></a></span></p><p class="c0"><span class="c1">
<br /></span></p><p class="c0"><span class="c1"> </span></p><p class="c0"><span class="c1"> </span></p>The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com4tag:blogger.com,1999:blog-1955837880233922698.post-24176594476769745512010-07-11T19:48:00.000-07:002010-08-06T20:16:41.371-07:00Splashscreen, Customizing List, Connecting Internet, XML Parsing,Downloading Images, Updating the User Interface Images at Runtime<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><meta http-equiv="Content-Style-Type" content="text/css"></meta><meta name="generator" content="Aspose.Words for Java 4.0.2.0"><title></title></head><body><div><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Hi Friends,</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Here is the next part of my blog. Here I am going to discuss about the important things today. Every project will starts with a splash in first page. So let’s discuss about the splash.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">Splash Screen</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">We need to display the logo at the middle of the screen, whatever the screen mode it may be. So in order to handle this we will use the below XML file.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="background-color:#f2dbdb; border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:477.7pt"><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"><?</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">xml</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">version</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"1.0"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">encoding</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"utf-8"</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">?></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"><</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">LinearLayout</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">xmlns:android</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"http://schemas.android.com/apk/res/android"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:orientation</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"vertical"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:layout_width</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"fill_parent"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:layout_height</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"fill_parent"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:background</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"@color/white"</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"><</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">ImageView</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:id</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"@+id/ImageView01"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:scaleType</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"center"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:layout_height</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"fill_parent"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:layout_width</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"fill_parent"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:layout_centerInParent</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"true"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:src</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"@drawable/sun"</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"></</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">ImageView</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"></</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">LinearLayout</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">></span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">In the above XML file we have a layout with an ImageView which is centered in parent, without stretching it completely to its parent. Here according to the background of the logo we need to change the background color of the layout. Here it is “@color/White” in the above example. These colors will be maintained in project</span><span style="color:#e36c0a; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">\res\values\color.xml</span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> folder. We can add new colors, which are needed for our project over there. That’s it, our layout is ready now. Let’s go to source.</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none"> </span></p><p style="margin:0pt"><span style="color:#7f0055; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">There is a class named Handler in android which will be going to handle the assigned work to do after some particular time. You may already know that we can start the Activities by using the Intents, we will start the activity after a period of </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">splashTime </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">as shown below</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="background-color:#f2dbdb; border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:420.75pt"><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Handler().postDelayed(</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Runnable(){</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">public</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">void</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> run() {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">startActivity(</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Intent(MainActivity.</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">this</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, MainMenu.</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">class</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">));</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> finish();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> }</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> }, </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">_splashTime</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Finally we are moving to the main menu from splash. The whole above process works perfectly if and only if the logo doesn’t have designs and different colors on the background screen. If you have different kinds of logo with lot of background colors then let’s go for the second option.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Here we need to prepare two images of splash one is for portrait and another is for landscape. Create a xml file in the folder project</span><span style="color:#e36c0a; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">\res\layout-land\menu.xml </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">with the same name in the layout folder. According to the screen mode the xml files will be used. But don’t forget to maintain the same names just like in </span><span style="color:#e36c0a; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">\layout</span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> folder.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">If we want Fade-in or fade-out effects for our splash then we need to create xml files with desired effects as shown below and need to place it in </span><span style="color:#e36c0a; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">\anim </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">folder.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="background-color:#f2dbdb; border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:508.4pt"><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"><?</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">xml</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">version</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"1.0"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">encoding</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"utf-8"</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">?></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"><</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">set</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"><</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">alpha</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">xmlns:android</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"http://schemas.android.com/apk/res/android"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:interpolator</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"@android:anim/accelerate_interpolator"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:fromAlpha</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"0.0"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:toAlpha</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"1.0"</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">android:duration</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">=</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">"1000"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">/></span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"></</span><span style="color:#3f7f7f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">set</span><span style="color:#008080; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">></span></p></td></tr></table><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">fromAlpha, toAlpha and duration will be used according to your requirements. If we change the values </span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">fromAlpha </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">to</span><span style="color:#7f007f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> toAlpha </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">then we will get fadeout effect.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">The total source with Fadein and Fadeout effects can be downloaded from below link.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><a name="id.434ebf7dc45a"></a><a href="https://docs.google.com/leaf?id=0B2qCFbmeiTFxOTFhYWFkNWMtNzVmNy00NjViLThhZGQtZjQwNDIxZmViZWQ3&authkey=CIqolp8N&hl=en"><span style="color:#0000ff; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:underline">You can download the project with source from here.</span></a> or <a href="http://pavandroid.ucoz.com/SplashTrail.zip"><span style="color:#0000ff; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:underline">You can download the project with source from here.</span></a></p><p style="font-size:24pt; line-height:115%; margin:12pt 0pt 3pt"><span style="color:#000000; font-family:'Times New Roman'; font-size:24pt; font-style:normal; font-weight:bold; text-decoration:underline">Customizing List, Connecting Internet, XML Parsing,Downloading Images, Updating the User Interface Images at Runtime, Handling UI without specifying height and width of any view in the layout</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">Connecting to the internet</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">We have two methods in connecting the internet server.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt 36pt; text-indent:-18pt"><span style="color:#000000; font-family:'Times New Roman'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">1.</span><span style="font:7.0pt 'Times New Roman'"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Get</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt 36pt; text-indent:-18pt"><span style="color:#000000; font-family:'Times New Roman'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">2.</span><span style="font:7.0pt 'Times New Roman'"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Post</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">In first method as you already know all the values will be appended to the url . In the second (Post) method we will send the data separately which is secured. I am going to give both the methods to connect the net.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">1)Get Method</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="background-color:#eeece1; border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:504.65pt"><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">private</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> InputStream openHttpConnection(String urlStr) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">InputStream in = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">int</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> resCode = -1;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">try</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"URL:"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+urlStr);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">URL url = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> URL(urlStr);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">URLConnection urlConn = url.openConnection();//Opening Connection</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">if</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (!(urlConn </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">instanceof</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> HttpURLConnection)) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">throw</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> IOException (</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"URL is not an Http URL"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"httpConn:1"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">HttpURLConnection httpConn = (HttpURLConnection)urlConn;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpConn.setAllowUserInteraction(</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">false</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> httpConn.setInstanceFollowRedirects(</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">true</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> httpConn.setRequestMethod(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"GET"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> httpConn.setRequestProperty(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"User-Agent"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Mozilla/5.0 (X11; U; Linux "</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> httpConn.setRequestProperty(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Content-Type"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"application/x-www-form-urlencoded"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"setting requests and properties"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> httpConn.connect(); </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Connected successfully"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> resCode = httpConn.getResponseCode(); </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"resCode"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+resCode);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">if</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (resCode == HttpURLConnection.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">HTTP_OK</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> in = httpConn.getInputStream(); </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Fetchinf data done"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> } </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (MalformedURLException e) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">e.printStackTrace();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"1"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+e);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (IOException e) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">e.printStackTrace();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"openHttpConnection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">""</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+e);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">return</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> in;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">The above code will connect to the specific site and will get the response and the data in the form of InputStream. The variable </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">resCode </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">will get the response from the server. The value should be 200 i.e.,</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> HttpURLConnection.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">HTTP_OK </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">otherwise we have some problem with server.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">2)Post Method:</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">This method will send the data separately .The code is as shown below.This method needs two strings. One is for URL and the other is for the data which we want to post the data. </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:514.9pt"><p style="margin:0pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">private</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> InputStream </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:underline">postPage(String url, String data)</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">InputStream is = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">ret</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpClient</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.getParams().setParameter(ClientPNames.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">COOKIE_POLICY</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, CookiePolicy.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">RFC_2109</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpPost</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> HttpPost(url);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">response</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">StringEntity tmp = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpPost</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.setHeader(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"User-Agent"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Mozilla/5.0 (X11; U; Linux "</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> +</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpPost</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.setHeader(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Accept"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"text/html,application/xml,"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> +</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpPost</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.setHeader(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Content-Type"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"application/x-www-form-urlencoded"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">try</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">tmp = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> StringEntity(data,</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"UTF-8"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (UnsupportedEncodingException e) {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">System.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">out</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.println(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"HTTPHelp : UnsupportedEncodingException : "</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+e);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpPost</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.setEntity(tmp);</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">try</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">response</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpClient</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.execute(</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">httpPost</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">,</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">localContext</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (ClientProtocolException e) {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">System.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">out</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.println(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"HTTPHelp : ClientProtocolException : "</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+e);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (IOException e) {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">System.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">out</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.println(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"HTTPHelp : IOException : "</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+e);</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">ret</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">response</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.getStatusLine().toString();</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> HttpEntity he = </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">response</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.getEntity();</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">try</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">InputStream inStream = he.getContent();</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">is = inStream;</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (IllegalStateException e) {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">// </span><span style="color:#7f9fbf; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">TODO</span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Auto-generated catch block</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">e.printStackTrace();</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (IOException e) {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">// </span><span style="color:#7f9fbf; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">TODO</span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Auto-generated catch block</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">e.printStackTrace();</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">return</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> is;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">Downloading Images</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Lets discuss about downloading the images. Here we have some issues with google api. Some times this is throwing </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:italic; font-weight:bold; text-decoration:none">decoder->decode returned false</span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">. For this I am also trying. 95% it wont come. Most of the cases it works well and code is as shown below.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:447.65pt"><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">public</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Drawable downloadDrawable(String imageUrl) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">try</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"downloadDrawable"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Starting Connection"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> URL url = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> URL(imageUrl);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> URLConnection conn = url.openConnection();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> conn.connect();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"downloadDrawable"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Connection Created Successfully"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> InputStream is = conn.getInputStream();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"downloadDrawable"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"InputStream created Successfully"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = Drawable.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">createFromStream</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(is, url.toString());</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"downloadDrawable"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Drawable created Successfully"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> is.close();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> } </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (IOException e) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"ERROR3"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"Ex::"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+e);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> }</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">return</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">Updating UI at Runtime after completion of the downloading Image using AsyncTask</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">This is very important one in Android. Normally in the other Technologies we will download the images using a separate Thread. But here if we use the same separate thread then it will create issue at the time of setting the image to the ImageView. </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">Android doesn’t support updating the UI in a separate thread. So, we cannot create a separate thread for updating the UI with images after downloading it. So, Inorder to handle this Android is having a class named </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">AsyncTask</span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">. This really helps us a lot. The code is as shown below.</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:none">Calling AsyncTask</span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:481.45pt"><p style="margin:0pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">try</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> {</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> DownloadFilesTask d = </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> DownloadFilesTask();</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d.execute(</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">new</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> URL(</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">bookImageUrl</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">));//url of the image</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d.sendObjectImageView(</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">iv_logo</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);// This is the object to which the image //has to set</span></p><p style="margin:0pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">} </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">catch</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> (Exception e)</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">e.printStackTrace();</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:none">AsyncTask Code</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">This Class will take care of downloading the image. This is not only for downloading. If we want to know whenever the work completed to it then chose this. The method </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">onPostExecute </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">method will be called by the Asynctask then we can do what ever we want to do after completion of that work. Here we need to set the image to the object that we got from the method </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">sendObjectImageView.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:0pt"><tr><td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:1pt; border-left-color:#000000; border-left-style:solid; border-left-width:1pt; border-right-color:#000000; border-right-style:solid; border-right-width:1pt; border-top-color:#000000; border-top-style:solid; border-top-width:1pt; padding-left:5.4pt; padding-right:5.4pt; vertical-align:top; width:457.65pt"><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">private</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">class</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> DownloadFilesTask </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">extends</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> AsyncTask<URL, Integer, Long> {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">ImageView </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">iv</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">int</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">id</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">protected</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Long doInBackground(URL... urls) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">int</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:underline">count</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = urls.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">length</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">long</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> totalSize = 0;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> downloadDrawable(urls[0].toString());</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">return</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> totalSize;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> }</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">public</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">void</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> sendObjectImageView(ImageView ivLogo) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">// </span><span style="color:#7f9fbf; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">TODO</span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Auto-generated method stub</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">this</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">iv</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = ivLogo;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">id</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = -1;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">public</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">void</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> sendObjectImageView(ImageView iv,</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">int</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> id) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">// </span><span style="color:#7f9fbf; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">TODO</span><span style="color:#3f7f5f; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> Auto-generated method stub</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">this</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">iv</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = iv;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">this</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">id</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> = id;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">protected</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">void</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> onProgressUpdate(Integer... progress) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"DownloadFilesTask"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"onProgressUpdate"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+progress[0]);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> }</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">protected</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">void</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> onPostExecute(Long result) {</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">Log.</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:italic; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"DownloadFilesTask"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">, </span><span style="color:#2a00ff; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">"onPostExecute"</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">+result);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">if</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">!=</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> && </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">iv</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">!=</span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">null</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">)</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">{</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">iv</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">.setImageDrawable(</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">);</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#7f0055; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:bold; text-decoration:none">if</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">(</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">id</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">!=-1)</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">booksImagesList</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">[</span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">id</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">] = </span><span style="color:#0000c0; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">d</span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">;</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none">}</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Courier New'; font-size:10pt; font-style:normal; font-weight:normal; text-decoration:none"> }</span></p></td></tr></table><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">XML Parsing</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">The description of these things will be displayed soon. until then check out the project.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">Layout Handling</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">The description of these things will be displayed soon. until then check out the project.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:bold; text-decoration:underline">Customizing Lists</span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none"> </span><span style="color:#000000; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:none">The description of these things will be displayed soon. until then check out the project.</span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p><p style="font-size:11pt; line-height:115%; margin:0pt 0pt 10pt"><a href="https://docs.google.com/leaf?id=0B2qCFbmeiTFxNmQ0N2QzMWUtYTIyMy00N2ZkLTg5M2ItNTY3NGYxM2RjMGIy&hl=en&authkey=CKHotYwE"><span style="color:#0000ff; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:underline">You can download the project source from here</span></a> or <a href="http://pavandroid.ucoz.com/XmlParsing.zip"><span style="color:#0000ff; font-family:'Trebuchet MS'; font-size:11pt; font-style:normal; font-weight:normal; text-decoration:underline">You can download the project source from here</span></a></p><p style="font-size:10pt; line-height:115%; margin:0pt 0pt 10pt"><span style="font-family:'Times New Roman'; font-size:10pt"> </span></p></div></body></html>The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com25tag:blogger.com,1999:blog-1955837880233922698.post-29867848295880974992010-07-04T08:07:00.000-07:002010-08-06T20:11:38.329-07:00<div><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Customizing Buttons</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >We can customize the buttons easily. Just change the background of it and specify the drawable images in the place of button.</span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="background-color: rgb(242, 219, 219); border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 473.45pt;"><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><Button android:id=</span><span style="color: rgb(0, 0, 0); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > android:layout_width=</span><span style="color: rgb(0, 0, 0); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > android:layout_height=</span><span style="color: rgb(0, 0, 0); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > android:background=</span><span style="color: rgb(0, 0, 0); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@drawable/backbtn"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></Button></span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Weight</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >If we have a apple and need to divide in to 4 parts we will cut that in to 0.25 pieces. In the same way if we want to divide a parent layout in to parts then we need to specify the total layout weight for parent layout and we need to specify the each small part in the whole total weight.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >For example if the total layout needs to divide into 3 equal parts we can specify the total layout as weight as 3 and the child layout weight as ‘1’ for all the three Childs. </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >The below example shows how to divide a layout into 3 diff sizes using weight.</span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="background-color: rgb(242, 219, 219); border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 468.7pt;"><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><?</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >xml</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >version</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"1.0"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >encoding</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"utf-8"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >?></span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >LinearLayout</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/LinearLayout01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >xmlns:android</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"http://schemas.android.com/apk/res/android"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:orientation</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"vertical"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:weightSum</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"4"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:text</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_weight</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"1"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:text</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button02"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button02"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_weight</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"2"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:text</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button03"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button03"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_weight</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"1"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >LinearLayout</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrQkQbIGf5TSRLsALuIWqMMjWtG6jnp6aOeeKgChnI0MXTWeJFRuXEie51crh9F6TdqdlUifZgMoJJHQeehvHsGiiKuwSDDSTZfZGAjip_Se0y4n2kP88fG6ME0nLmiodBO_WLyu4WvL4/s1600/index.001.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 239px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrQkQbIGf5TSRLsALuIWqMMjWtG6jnp6aOeeKgChnI0MXTWeJFRuXEie51crh9F6TdqdlUifZgMoJJHQeehvHsGiiKuwSDDSTZfZGAjip_Se0y4n2kP88fG6ME0nLmiodBO_WLyu4WvL4/s320/index.001.png" alt="" id="BLOGGER_PHOTO_ID_5490071722088138194" border="0" /></a>
<br /></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Gravity</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >We can specify the Fields style over here. We have lot of properties and we can easily customize the layouts.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Absolute Layout</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >This layout is deprecated and only supports for a specific resolution. We cannot use this layout if we concentrated our app to work on all the resolutions.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Relative Layout</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >This layout is used to arrange the fields according to the other field. Here we can specify the left, right, top and bottom fields. According to which the other fields will be arranged.</span></p><p style="margin: 0pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="margin: 0pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="margin: 0pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="background-color: rgb(238, 236, 225); border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 457.15pt;"><p style="margin: 0pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><?</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >xml</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >version</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"1.0"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >encoding</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"utf-8"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >?></span></p><p style="margin: 0pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >RelativeLayout</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/RelativeLayout01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"fill_parent"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >xmlns:android</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"http://schemas.android.com/apk/res/android"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="margin: 0pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >EditText</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:text</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/EditText01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/EditText01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >EditText</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="margin: 0pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:text</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/Button01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_toRightOf</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/EditText01"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Button</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >CheckBox</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/CheckBox01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_below</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/EditText01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:text</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/CheckBox01"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >CheckBox</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="margin: 0pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ><</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >ImageView</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_below</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/EditText01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:id</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/ImageView01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_width</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_height</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"wrap_content"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:layout_toRightOf</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@+id/CheckBox01"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >android:background</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >=</span><span style="color: rgb(42, 0, 255); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"@drawable/icon"</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >ImageView</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="margin: 0pt;"><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" ></</span><span style="color: rgb(63, 127, 127); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >RelativeLayout</span><span style="color: rgb(0, 128, 128); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >></span></p><p style="margin: 0pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIL1t9tYzqSvm58jE4Pw9e_RCW6GrKepfHfisQIGi5G3nvqImUjAZuGToji4RiuSIKAGh3YkEBXZpOPYt_UVONbhoZ0ODNZPeIKDI0848zxESS2moSAYR51J8MycGnXqsOF2QcsL1McqE/s1600/index.002.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 104px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIL1t9tYzqSvm58jE4Pw9e_RCW6GrKepfHfisQIGi5G3nvqImUjAZuGToji4RiuSIKAGh3YkEBXZpOPYt_UVONbhoZ0ODNZPeIKDI0848zxESS2moSAYR51J8MycGnXqsOF2QcsL1McqE/s320/index.002.png" alt="" id="BLOGGER_PHOTO_ID_5490073346568253010" border="0" /></a>
<br /></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Table Layout</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >This Layout is used when ever we want to create the screen with Table rows and columns</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >TabHost</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >This is used to create the Tabs as like as you think. But this is fully Buggy. I really worked hard on this to make it work. But, it’s having lot of issues it won’t work properly.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >We are unable to work on the ADT plug-in for Tabs. Really its buggy. It will through NullpointerException, while displaying the screen. Don’t bother about the Nullpointer just run away the code and enjoy the execution.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Most of the time the XML execution Fails for TabHost and TabWidget. I tried to work on this for Android 1.5 SDK. 90% Fail.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >We can handle this by using the code successfully. This one is awesome and easy to handle. I attached the code over here. You can get the both approaches i.e., </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt 36pt; text-indent: -18pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Times New Roman';font-size:10pt;" >1.</span><span style="font: 7pt 'Times New Roman';"> </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >XML approach</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt 36pt; text-indent: -18pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Times New Roman';font-size:10pt;" >2.</span><span style="font: 7pt 'Times New Roman';"> </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Code approach</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >TabHost is used to create the Object for Tab Manager. TabSpec Objects will be added to the TabHost in order to add the Tabs.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Code Approach:</span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="background-color: rgb(238, 236, 225); border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 462.6pt;"><p style="margin: 0pt;"><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >final</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > TabHost tabHost = getTabHost();</span></p><p style="margin: 0pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="margin: 0pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="margin: 0pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > tabHost.addTab(tabHost.newTabSpec(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"TAB1"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >)</span></p><p style="margin: 0pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >.setIndicator(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"Name of the TAB"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >)</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >.setContent(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >new</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > Intent(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >this</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >,XYZ.</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >class</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >)));</span></p><p style="margin: 0pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >tabHost.addTab(tabHost.newTabSpec(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"TAB2"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >)</span></p><p style="margin: 0pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > .setIndicator(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"Name of the TAB"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >)</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > .setContent(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >new</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > Intent(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >this</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >,ABC.</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >class</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >));</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >XML Approach: You can check it in the below linked source</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Source Code for TabHost with source </span><a href="https://docs.google.com/leaf?id=0B2qCFbmeiTFxNzI1YmI4NjYtNTcxZi00MjY3LWE4MDQtZWExMzNlMDRiZDk4&hl=en"><span style="color: rgb(0, 0, 255); font-style: normal; font-weight: normal; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >here</span></a> or <a href="http://pavandroid.ucoz.com/TabHost_using_Source.zip"><span style="color: rgb(0, 0, 255); font-style: normal; font-weight: normal; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >here</span>
<br /><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Source Code for TabHost with XML </span></a><a href="https://docs.google.com/leaf?id=0B2qCFbmeiTFxODQ5MjgwMjgtNjA5ZS00MDgxLWE0NzAtYjczMDE0MjBlZjYy&hl=enn"><span style="color: rgb(0, 0, 255); font-style: normal; font-weight: normal; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >here</span>
<br /></a> or <a href="http://pavandroid.ucoz.com/TabHost_using_XML.zip"><span style="color: rgb(0, 0, 255); font-style: normal; font-weight: normal; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >here</span>
<br /></a></p><p>Android Custom Tab Handling is introdued in Android 1.6. Here you can customize each tab including heights of each tab.</p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Portrait and Landscape Layouts</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >If you want to handle landscape devices then create a “layout-land” named folder in project “res” folder and create the XML files related to landscape devices with same name just like in layout folder and customize it accordingly.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >High,Medum and Low Resolution</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Android sdk 1.6 supports multi dimensions. For which we need to create the below folders to handle different dimensions.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >“drawable-hdpi” ----------</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > for higher Resolutions,</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >” drawable-ldpi” ----------</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > for lower Resolutions,</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >” drawable-mdpi” --------</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > for medium resolutions.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Here we can place the Images to different dimensions and use thw same name for them.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Activity Calls / Data Passing / Object Passing bet Activities</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Setting UI to screen</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Whatever the user interface you need, just create it in XML files. Specify the name of XML from source code just as shown below.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >setContentView(R.layout.XML_FILE_NAME);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Calling an Activity</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Starting an activity can be done by creating an intent as shown below.</span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 355.25pt;"><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Intent i = new Intent(“this activity name”.this, “activity name to start”.class);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >startActivity(i);</span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Finishing the Activity</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Use the following code, then it will finish the current Activity. If you move the Activity to the next Activity then you can easily move to the previous Activity by using Back Button. If you don’t want it to Re-appear again, then just finish the activity so that the activity doesn’t appear back.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >For example if you are displaying the splash and that should be displayed only once @ starting the app only. So after completion of the splash time we need to finish it. So that it won’t appear again even though you press back on the first page of the app.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 111.3pt;"><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >finish();</span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Sending string data</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >As we already know that we can transfer from one to other Activity by using Intents.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >Intent i = new Intent(MainActivity.this,GoActivity.class);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >String data = “bla bla”;//</span><span style="color: rgb(0, 0, 192); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > Data String to send</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >i.putExtra(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"DATA"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >,data );</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >Receiving the Data</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >We can receive the above the string data as shown below.</span></p><p style="margin: 0pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Intent i = getIntent();</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 192); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >String data</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > = i.getStringExtra(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"DATA"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >);// you well get the String data i.e., BLA BLA</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >The Red Colored DATA should be same while sending and receiving the data.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Courier New';font-size:10pt;" >Sending Object</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Here is the code to send the Object from one to other class. One Important thing to send the Object is the class should implement the Serializable class.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >The below Red Colored text should be same.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >//MainActivity.java</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Intent </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: underline;font-family:'Courier New';font-size:10pt;" >i</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > = new Intent(MainActivity.this,startActivity.class);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >ObjectClassName object = new ObjectClassName();</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >i.putExtra(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"THIS"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >, </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Object</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Courier New';font-size:10pt;" >Receiving Object</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >// startActivity.java</span></p><p style="margin: 0pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >Intent </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: underline;font-family:'Courier New';font-size:10pt;" >i</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > = getIntent();</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >ObjectClassName obj</span><span style="color: rgb(0, 0, 192); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >= (ObjectClassName) getIntent().getSerializableExtra(</span><span style="color: rgb(42, 0, 255); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >"THIS"</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >);// TypeCasting needed </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: bold; text-decoration: underline;font-family:'Trebuchet MS';font-size:11pt;" >ListActivity Example</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >The below code is used to create the normal list with String Array .</span></p><p style="line-height: 115%; margin: 0pt;font-size:10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><table style="border-collapse: collapse; margin-left: 0pt;" cellpadding="0" cellspacing="0"><tbody><tr><td style="background-color: rgb(238, 236, 225); border: 1pt solid rgb(0, 0, 0); padding-left: 5.4pt; padding-right: 5.4pt; vertical-align: top; width: 407.55pt;"><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >public</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >class</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > MainActivity </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >extends</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > ListActivity {</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >static</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >final</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > String[] </span><span style="color: rgb(0, 0, 192); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >COUNTRIES</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > = </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >new</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > String[] {</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >“ABC”,”DEF”,”GHI”,”XYZ”</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > };</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >public</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >void</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > onCreate(Bundle savedInstanceState) {</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >super</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >.onCreate(savedInstanceState);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >setListAdapter(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >new</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > ArrayAdapter<String>(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >this</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >,</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > android.R.layout.</span><span style="color: rgb(0, 0, 192); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >simple_list_item_1</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >, </span><span style="color: rgb(0, 0, 192); font-style: italic; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >COUNTRIES</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >));</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > getListView().setTextFilterEnabled(</span><span style="color: rgb(127, 0, 85); font-style: normal; font-weight: bold; text-decoration: none;font-family:'Courier New';font-size:10pt;" >true</span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >);</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > }</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt; font-size: 10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" >}</span></p></td></tr></tbody></table><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" > </span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt;font-size:11pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Trebuchet MS';font-size:11pt;" >This won’t has customization or anything. If you want customized list with different Images or Text or anything you can get it in the next example.</span></p><p style="line-height: 115%; margin: 0pt 0pt 10pt; font-size: 10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p><p size="10pt" style="line-height: 115%; margin: 0pt 0pt 10pt;"><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span><span style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; text-decoration: none;font-family:'Courier New';font-size:10pt;" > </span></p><p size="10pt" style="line-height: 115%; margin: 0pt 0pt 10pt;"><span style=";font-family:'Times New Roman';font-size:10pt;" > </span></p></div>
<br />
<br />Next Post will contain the Internet Connectivity and Customized List with diff Images and XML parsing with src.
<br />
<br />
<br />Thanks Guys,The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com3tag:blogger.com,1999:blog-1955837880233922698.post-7661560525193096922010-06-29T08:58:00.000-07:002010-07-04T08:35:32.604-07:00Traversing through Activities and Sending and Receiving Data and ObjectsHi Dudes,<br /><br /><br />Welcome to my first post. Here we will learn about Activities.<br /><br />If you want a specific Android IDE then just go for Motodev Android<br /><br />You can download it from <a href="http://developer.motorola.com/docstools/motodevstudio/">http://developer.motorola.com/docstools/motodevstudio/</a><br /><br />Here in Android all the pages in the App will be treated as an Activity. All the UI kind of things can be easily handled by using the XML Layouts.<br /><br /><br />I think there is no need to explain how to configure eclipse and installing ADT plug ins, as it is already available in lot of forums and blogs.So lets discuss about how to use the layouts and how to travel from android activities.<br /><br />Normally for the usual applications we will use either LinearLayout and AbsoluteLayouts.<br /><br />LinearLayout has Orientations Horizontal and Vertical.<br />Just like HorizontalFieldManager and VerticalFieldManagers in Blackberry.<br />Fields or Views will be added according to the orientation.<br /><br />AbsoluteLayout is used to specify according to the (x,y) points. It don't have any rules where ever we want we can add what ever we want :)....<br /><br />Every View has width and Height fields where we can specify the width and height of that view.<br />It also has LayoutMarginLeft,Right,Top,Bottom fields in the properties of each view to specify the margins around the view.<br /><br />The remaining info is specified in the next Post.<br /><br /><br />Thanks Dudes,<br />Rock on... :)The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0tag:blogger.com,1999:blog-1955837880233922698.post-57919894241795604122010-06-29T08:48:00.000-07:002010-06-29T08:57:08.756-07:00AndroidHi Guys,<br /><br /><br />I am an Android enthusiast and Developer. I am jumping through the hurdles in Android. I want to share my experiences and want to help the Android buddies through this blog.<br /><br />Post your issues over here. i will try to solve it and and suggest the ways to overcome the issues and at the same time i can get to know some new coding designs and styles.<br /><br />Thanks Guys!<br />Keep Rocking.... :)The Legendhttp://www.blogger.com/profile/12768590666887682352noreply@blogger.com0