<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8375270122264838256</id><updated>2024-12-19T08:55:25.356+05:30</updated><category term="Technology"/><category term="Java"/><category term="Android"/><category term="OAuth"/><category term="Documentation"/><category term="Oracle"/><category term="Solaris"/><category term="Jersey"/><category term="Linux"/><category term="Restful"/><category term="Webservices"/><category term="AngularJS"/><category term="Cricket"/><category term="General"/><category term="Springs"/><category term="Word of the day"/><title type='text'>InfoAlly</title><subtitle type='html'>Technology Trends Oracle Java J2EE Solaris Android Jersey JQuery Ajax OAuth Maven Bootstrap AngularJS  Springs Hibernate </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Swapna</name><uri>http://www.blogger.com/profile/17204476212542850232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-2306814165207203405</id><published>2015-07-11T22:23:00.004+05:30</published><updated>2015-07-11T22:24:15.164+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Android: Adding easy share </title><content type='html'>&lt;br /&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;For implementing user friendly share in action bar is made easy.&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; clear: right; color: rgba(0, 0, 0, 0.682); display: inline ! important; float: right; font-family: Roboto,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin-bottom: 1em; margin-left: 1em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&lt;img src=&quot;http://developer.android.com/images/training/sharing/share-text-screenshot.png&quot; /&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;Add Menu item as follows &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;:id=&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;@+id/menu_item_share&quot;&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;:showAsAction=&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;always&quot;&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;:title=&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;Share&quot;&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;:icon=&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;@drawable/abc_ic_menu_share_mtrl_alpha&quot;&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;:orderInCategory=&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;:actionProviderClass=&lt;/span&gt;&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;android.widget.ShareActionProvider&quot; &lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;Update the share intent associated with that action item. Here&#39;s an example:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: rgba(0, 0, 0, 0.682353); display: inline !important; float: none; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;
private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ShareActionProvider&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; mShareActionProvider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onCreateOptionsMenu&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Menu&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Inflate menu resource file.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; getMenuInflater&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;inflate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;menu&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;share_menu&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Locate MenuItem with ShareActionProvider&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;MenuItem&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; item &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;findItem&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;menu_item_share&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Fetch and store ShareActionProvider&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; mShareActionProvider &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ShareActionProvider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;getActionProvider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Return true to display menu&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Call to update the share intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; setShareIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; shareIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;mShareActionProvider &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mShareActionProvider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;setShareIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;shareIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; font-family: &#39;Courier New&#39;; font-size: 9.0pt;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/2306814165207203405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/07/android-adding-easy-share.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/2306814165207203405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/2306814165207203405'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/07/android-adding-easy-share.html' title='Android: Adding easy share '/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-1317219565426958150</id><published>2015-06-22T20:12:00.002+05:30</published><updated>2015-06-22T20:12:48.222+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Using lists in Android (ListView) - Tutorial</title><content type='html'>1.&amp;nbsp;Android and Lists
                     &lt;div class=&quot;section&quot;&gt;
&lt;div class=&quot;titlepage&quot;&gt;
&lt;div&gt;
&lt;div&gt;
                  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;androidlists_overview&quot;&gt;&lt;/a&gt;1.1.&amp;nbsp;Using lists in Android
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The display of elements in a list is a very common pattern in
                  mobile
                  applications. The user sees a list of items and can scroll
                  through
                  them. Such an activity is depicted in the following picture.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Listview example&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistview_scheme10.png.pagespeed.ic.A_Hx4U7T3Z.jpg&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

               
                  Typically the user interacts with the list via the
                  action bar,
                  for example, via a refresh button. Individual list items can
                  be
                  selected. This selection can update
                  the
                  action bar or
                  can
                  trigger a
                  detailed screen for the selection. The following graphic sketches
                  that. On the selection of a list item another activity is started.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Listview example&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistview_scheme20.png.pagespeed.ic.260DiaCtwz.jpg&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;androidlists_view&quot;&gt;&lt;/a&gt;1.2.&amp;nbsp;Views for handling lists
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Android provides the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  and the
                  &lt;code class=&quot;code&quot;&gt;ExpandableListView&lt;/code&gt;
                  classes
                  which is capable of displaying a scrollable list of items.
                  
               &lt;br /&gt;

               
                  The
                  &lt;code class=&quot;code&quot;&gt;ExpandableListView&lt;/code&gt;
                  class
                  supports a grouping of items.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;androidlists_inputtype&quot;&gt;&lt;/a&gt;1.3.&amp;nbsp;Possible input types for lists
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The input to the list (items in the list) can
                  be arbitrary Java
                  objects. The adapter extracts the correct data from the data object
                  and assigns
                  this data to the
                  &lt;em class=&quot;wordasword&quot;&gt;views&lt;/em&gt;
                  in the row of the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  These items are
                  typically called the
                  &lt;em class=&quot;wordasword&quot;&gt;data model&lt;/em&gt;
                  of the list.
                  An adapter can receive data as input.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;androidlists_adapterintro&quot;&gt;&lt;/a&gt;1.4.&amp;nbsp;Adapters
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
An
                  &lt;em class=&quot;wordasword&quot;&gt;adapter&lt;/em&gt;
                  manages the data model and adapts it to the individual entries in the widget. An adapter extends the
                  &lt;code class=&quot;code&quot;&gt;BaseAdapter&lt;/code&gt;
                  class.
                  
               &lt;br /&gt;

               
                  Every line in the widget displaying the data consists of a layout which can
                  be as
                  complex as you want. A typical line in a list has an image
                  on the
                  left side and two text lines in the middle as depicted in the
                  following graphic.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Listview example layout&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistview_line10.png.pagespeed.ic.V-pIawT-_J.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

               
                  A layout file for a such a line might look like the following.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;RelativeLayout&lt;/span&gt; &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;?android:attr/listPreferredItemHeight&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:padding&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;6dip&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;ImageView&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/icon&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignParentBottom&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignParentTop&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_marginRight&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;6dip&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:contentDescription&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;TODO&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:src&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/secondLine&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;26dip&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignParentBottom&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignParentRight&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_toRightOf&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@id/icon&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:ellipsize&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;marquee&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:singleLine&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:text&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;Description&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textSize&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;12sp&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/firstLine&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_above&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@id/secondLine&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignParentRight&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignParentTop&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_alignWithParentIfMissing&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_toRightOf&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@id/icon&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:gravity&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;center_vertical&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:text&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;Example application&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textSize&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;16sp&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt;

&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/RelativeLayout&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  The adapter would inflate the layout for each row in its
                  &lt;code class=&quot;code&quot;&gt;getView()&lt;/code&gt;
                  method
                  and assign the data to the individual views in the row.
                  
               &lt;br /&gt;

               
                  The adapter is assigned to the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  via the
                  &lt;code class=&quot;code&quot;&gt;setAdapter&lt;/code&gt;
                  method on the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  object.
                  
               &lt;br /&gt;

               &lt;div class=&quot;tip&quot; style=&quot;margin-left: 0.5in; margin-right: 0.5in;&quot;&gt;
                  &lt;h3 class=&quot;title&quot;&gt;
Tip&lt;/h3&gt;
Adapters are not only used by &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;, but also by other views which
                     extend &lt;code class=&quot;code&quot;&gt;AdapterView&lt;/code&gt; as, for example,
                     &lt;code class=&quot;code&quot;&gt;Spinner&lt;/code&gt;,
                     &lt;code class=&quot;code&quot;&gt;GridView&lt;/code&gt;,
                     &lt;code class=&quot;code&quot;&gt;Gallery&lt;/code&gt;
                     and
                     &lt;code class=&quot;code&quot;&gt;StackView&lt;/code&gt;.
                     
                  &lt;br /&gt;

               &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;androidlists_filtersort&quot;&gt;&lt;/a&gt;1.5.&amp;nbsp;Filtering and sorting
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Filtering and sorting of the data is handled by the adapter. You
                  need to
                  implement the logic in your custom adapter implementation.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterown_updates&quot;&gt;&lt;/a&gt;1.6.&amp;nbsp;Data updates in the adapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The
                  &lt;code class=&quot;code&quot;&gt;notifyDataSetChanged()&lt;/code&gt;
                  method on the adapter is called if the data has changed or if new
                  data is available.
                  
               &lt;br /&gt;

               
                  The
                  &lt;code class=&quot;code&quot;&gt;notifyDataSetInvalidated()&lt;/code&gt;
                  method is called if the data is not available anymore.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_adapterlistener&quot;&gt;&lt;/a&gt;1.7.&amp;nbsp;Listener
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
To react to selections in the list, set an &lt;code class=&quot;code&quot;&gt;OnItemClickListener&lt;/code&gt; to
                  your
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;listView.setOnItemClickListener(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; OnItemClickListener() {
  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onItemClick(AdapterView&amp;lt;?&amp;gt; parent, View view,
    &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
    Toast.makeText(getApplicationContext(),
      &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Click ListItem Number &quot;&lt;/span&gt; + position, Toast.LENGTH_LONG)
      .show();
  }
}); &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_defaultadapter&quot;&gt;&lt;/a&gt;2.&amp;nbsp;Default adapter
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_defaultadapter&quot;&gt;&lt;/a&gt;2.1.&amp;nbsp;Default platform adapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Android provides default
                  adapter implementations; the most important
                  are
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  and
                  &lt;code class=&quot;code&quot;&gt;CursorAdapter&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  can handle data based on
                  &lt;code class=&quot;code&quot;&gt;Arrays&lt;/code&gt;
                  or
                  &lt;code class=&quot;code&quot;&gt;java.util.List&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  &lt;code class=&quot;code&quot;&gt;SimpleCursorAdapter&lt;/code&gt;
                  can
                  handle database related data.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;arrayAdapter&quot;&gt;&lt;/a&gt;2.2.&amp;nbsp;Using ArrayAdapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  class can handle a list or array of Java objects as input. Every Java
                  object is mapped to one row. By
                  default,
                  it maps the
                  &lt;code class=&quot;code&quot;&gt;toString()&lt;/code&gt;
                  method of the object to a view in the row layout.
                  
               &lt;br /&gt;

               
                  You can
                  define
                  the ID
                  of the view in the constructor of the
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  otherwise the
                  &lt;code class=&quot;code&quot;&gt;android.R.id.text1&lt;/code&gt;
                  ID is used as default.
                  
               &lt;br /&gt;

               
                  The
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  class allows to remove all elements in its underlying data structure
                  with the
                  &lt;code class=&quot;code&quot;&gt;clear()&lt;/code&gt;
                  method call. You can then add new elements via the
                  &lt;code class=&quot;code&quot;&gt;add()&lt;/code&gt;
                  method or a &lt;code class=&quot;code&quot;&gt;Collection&lt;/code&gt; via the
                  &lt;code class=&quot;code&quot;&gt;addAll()&lt;/code&gt;
                  method.
                  
               &lt;br /&gt;

               
                  You can also directly modify the underlying data structure and call
                  the
                  &lt;code class=&quot;code&quot;&gt;notifyDataSetChanged()&lt;/code&gt;
                  method on the
                  adapter
                  to notify it about the changes in data.
                  
               &lt;br /&gt;

               &lt;div class=&quot;warning&quot; style=&quot;margin-left: 0.5in; margin-right: 0.5in;&quot;&gt;
                  &lt;h3 class=&quot;title&quot;&gt;
Warning&lt;/h3&gt;
If you want to change the data in your adapter, the underlying data
                     structure must support this operation. This is, for example, the case
                     for the
                     &lt;code class=&quot;code&quot;&gt;ArrayList&lt;/code&gt;
                     class,
                     but not for arrays.
                     
                  &lt;br /&gt;

               &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_listviewexample&quot;&gt;&lt;/a&gt;2.3.&amp;nbsp;ListView example with ArrayAdapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following listing shows a layout file called
                  &lt;code class=&quot;filename&quot;&gt;activity_listviewexampleactivity.xml&lt;/code&gt;
                  which includes a
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;ListView&lt;/span&gt; &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/listview&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  The following example shows the usage of the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  view in an activity. It uses a default layout from the Android
                  platform for the row layout. It also demonstrates the removal of list
                  items and uses
                  animations for
                  the removal.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.listview.withanimation;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; ListViewExampleActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; Activity {

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    setContentView(R.layout.activity_listviewexampleactivity);

    &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; ListView listview = (ListView) findViewById(R.id.listview);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt; };

    &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; ArrayList&amp;lt;String&amp;gt; list = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayList&amp;lt;String&amp;gt;();
    &lt;span class=&quot;hl-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; values.length; ++i) {
      list.add(values[i]);
    }
    &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; StableArrayAdapter adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; StableArrayAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;, list);
    listview.setAdapter(adapter);

    listview.setOnItemClickListener(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; AdapterView.OnItemClickListener() {

      &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
      &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onItemClick(AdapterView&amp;lt;?&amp;gt; parent, &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; View view,
          &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
        &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; String item = (String) parent.getItemAtPosition(position);
        view.animate().setDuration(&lt;span class=&quot;hl-number&quot;&gt;2000&lt;/span&gt;).alpha(&lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;)
            .withEndAction(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; Runnable() {
              &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
              &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; run() {
                list.remove(item);
                adapter.notifyDataSetChanged();
                view.setAlpha(&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);
              }
            });
      }

    });
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; StableArrayAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt; {

    HashMap&amp;lt;String, Integer&amp;gt; mIdMap = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; HashMap&amp;lt;String, Integer&amp;gt;();

    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; StableArrayAdapter(Context context, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; textViewResourceId,
        List&amp;lt;String&amp;gt; objects) {
      &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;(context, textViewResourceId, objects);
      &lt;span class=&quot;hl-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; objects.size(); ++i) {
        mIdMap.put(objects.get(i), i);
      }
    }

    &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; getItemId(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position) {
      String item = getItem(position);
      &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; mIdMap.get(item);
    }

    &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; hasStableIds() {
      &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
    }

  }

} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterown&quot;&gt;&lt;/a&gt;3.&amp;nbsp;Custom adapter implementations
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterown_custom&quot;&gt;&lt;/a&gt;3.1.&amp;nbsp;Developing a custom adapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  is limited as it supports only the mapping of
                  &lt;code class=&quot;code&quot;&gt;toString()&lt;/code&gt;
                  to one view in the row layout.
                  To control the data assignment and to
                  support
                  several views, you
                  have to
                  create your
                  custom adapter
                  implementation.
                  
               &lt;br /&gt;

               
                  For this you would extend an
                  existing adapter
                  implementation or
                  subclass the
                  &lt;code class=&quot;code&quot;&gt;BaseAdapter&lt;/code&gt;
                  class directly.
                  
               &lt;br /&gt;

               &lt;div class=&quot;tip&quot; style=&quot;margin-left: 0.5in; margin-right: 0.5in;&quot;&gt;
                  &lt;h3 class=&quot;title&quot;&gt;
Tip&lt;/h3&gt;
Frequently you extend
                     &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                     to write a custom adapter, as this is simpler than extending
                     &lt;code class=&quot;code&quot;&gt;BaseAdapter&lt;/code&gt;
                     directly.
                     
                  &lt;br /&gt;

               &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterown_inflating&quot;&gt;&lt;/a&gt;3.2.&amp;nbsp;Preparing a row for the list
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The adapter needs to create a layout for each row of the list.
                  The
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  instance
                  calls the
                  &lt;code class=&quot;code&quot;&gt;getView()&lt;/code&gt;
                  method on the adapter for each data element. In this method the
                  adapter creates the row
                  layout and maps the data to the views in the
                  layout.
                  
               &lt;br /&gt;

               
                  This root of the layout is typically a
                  &lt;code class=&quot;code&quot;&gt;ViewGroup&lt;/code&gt;
                  (layout manager)
                  and contains several other
                  views
                  , e.g., an
                  &lt;code class=&quot;code&quot;&gt;ImageView&lt;/code&gt;
                  and a
                  &lt;code class=&quot;code&quot;&gt;TextView&lt;/code&gt;. The following graphic shows a list with different layouts for odd
                  and even rows.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Adapter provides data and defines the layout per row&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xadapter10.png.pagespeed.ic.Wb9PqhtB3Q.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

               
                  Within the
                  &lt;code class=&quot;code&quot;&gt;getView()&lt;/code&gt;
                  method you would inflate an XML based layout and then set
                  the
                  content
                  of
                  the individual views based on the Java object for this row.
                  To
                  inflate the XML layout file, you can use the
                  &lt;code class=&quot;code&quot;&gt;LayoutInflator&lt;/code&gt;
                  system
                  service.
                  
               &lt;br /&gt;

               &lt;div class=&quot;note&quot; style=&quot;margin-left: 0.5in; margin-right: 0.5in;&quot;&gt;
                  &lt;h3 class=&quot;title&quot;&gt;
Note&lt;/h3&gt;
This layout inflator service can get accessed via the
                     &lt;code class=&quot;code&quot;&gt;getLayoutInflator()&lt;/code&gt;
                     method of the
                     activity
                     or via the
                     &lt;code class=&quot;code&quot;&gt;context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)
                        &lt;/code&gt;
                     method call.
                     
                  &lt;br /&gt;

               &lt;/div&gt;
After the adapter inflated the layout, it searches for the relevant
                  views in the layout and fills them with the data.
                  The individual
                  elements
                  in the layout can be found via
                  the
                  &lt;code class=&quot;code&quot;&gt;findViewById()&lt;/code&gt;
                  method call on the top level view.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterown_example&quot;&gt;&lt;/a&gt;3.3.&amp;nbsp;Example for a custom adapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following code shows an implementation of a custom adapter. This
                  adapter
                  assumes that you have two png files (no.png and ok.png) in
                  one of
                  your
                  &lt;code class=&quot;filename&quot;&gt;res/drawable&lt;/code&gt;
                  folders. The coding inflates an XML layout file,
                  finds the relevant
                  views
                  in the layout and sets their content based on the input data.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.content.Context;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.LayoutInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ViewGroup;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ImageView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.TextView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MySimpleArrayAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt; {
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; Context context;
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; String[] values;

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; MySimpleArrayAdapter(Context context, String[] values) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;(context, -&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;, values);
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.context = context;
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.values = values;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) context
        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.rowlayout, parent, false);
    TextView textView = (TextView) rowView.findViewById(R.id.label);
    ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
    textView.setText(values[position]);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// change the icon for Windows and iPhone&lt;/em&gt;
    String s = values[position];
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;)) {
      imageView.setImageResource(R.drawable.no);
    } &lt;span class=&quot;hl-keyword&quot;&gt;else&lt;/span&gt; {
      imageView.setImageResource(R.drawable.ok);
    }

    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; rowView;
  }
} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterown_interaction&quot;&gt;&lt;/a&gt;3.4.&amp;nbsp;Updating the data model from the adapter
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The row can also contain
                  &lt;em class=&quot;wordasword&quot;&gt;views&lt;/em&gt;
                  which interact with the underlying data model via the adapter. For
                  example, you can
                  have
                  a
                  &lt;code class=&quot;code&quot;&gt;Checkbox&lt;/code&gt;
                  in your row layout and if the
                  &lt;code class=&quot;code&quot;&gt;Checkbox&lt;/code&gt;
                  is selected, the underlying data is changed.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listactivity&quot;&gt;&lt;/a&gt;4.&amp;nbsp;ListActivity and ListFragment
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listactivity_overview&quot;&gt;&lt;/a&gt;4.1.&amp;nbsp;Default container for using ListView
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Android provides specialized fragment and activity classes to
                  simplify list
                  handling.
                  
               &lt;br /&gt;

               
                  The classes are the
                  &lt;code class=&quot;code&quot;&gt;ListActivity&lt;/code&gt;
                  class if you want to use lists in activities and the
                  the
                  &lt;code class=&quot;code&quot;&gt;ListFragment&lt;/code&gt;
                  class if you want to use lists in fragments.
                  
               &lt;br /&gt;

               
                  You do not have to assign a layout to these elements. If you do
                  not define a layout, the activity or fragment contains a
                  single
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  by default.
                  &lt;code class=&quot;code&quot;&gt;ListActivity&lt;/code&gt;
                  and
                  &lt;code class=&quot;code&quot;&gt;ListFragment&lt;/code&gt;
                  also allow you to override
                  a
                  &lt;code class=&quot;code&quot;&gt;onListItemClick()&lt;/code&gt;
                  method for handling selection of list items.
                  
               &lt;br /&gt;

               
                  Both classes allow you to set the adapter to the default
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  via the
                  &lt;code class=&quot;code&quot;&gt;setListAdapter()&lt;/code&gt;
                  method.
                  
               &lt;br /&gt;

               
                  The following example code shows a simple
                  &lt;code class=&quot;code&quot;&gt;ListFragment&lt;/code&gt;
                  implementation.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.fragments;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.content.Intent;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListFragment;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListFragment &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListFragment {

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onActivityCreated(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onActivityCreated(savedInstanceState);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(getActivity(),
        android.R.layout.simple_list_item_&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;, values);
    setListAdapter(adapter);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onListItemClick(ListView l, View v, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// TODO implement some logic &lt;/em&gt;
  }
} &lt;/pre&gt;
&lt;br /&gt;

               
                  The next example code demonstrates the usage of a
                  &lt;code class=&quot;code&quot;&gt;ListActivity&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;, values);
    setListAdapter(adapter);
  }
} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listactivity_layout&quot;&gt;&lt;/a&gt;4.2.&amp;nbsp;ListActivity and custom layout
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
You can use a custom layout with
                  &lt;code class=&quot;code&quot;&gt;ListActivity&lt;/code&gt;
                  or
                  &lt;code class=&quot;code&quot;&gt;ListFragment&lt;/code&gt;. In this case the fragment or activity searches in the provided
                  layout for a
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  with the pre-defined
                  &lt;code class=&quot;code&quot;&gt;android:id&lt;/code&gt;
                  attribute set to
                  &lt;code class=&quot;code&quot;&gt;@android:id/list&lt;/code&gt;. This usage is demonstrated by the following code snippet.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;ListView&lt;/span&gt;
  &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@android:id/list&quot;&lt;/span&gt;
  &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
  &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;
&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/ListView&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               &lt;div class=&quot;warning&quot; style=&quot;margin-left: 0.5in; margin-right: 0.5in;&quot;&gt;
                  &lt;h3 class=&quot;title&quot;&gt;
Warning&lt;/h3&gt;
If you do not use this ID or do not include a
                     &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                     into your layout, the application crashes once you try to display
                     the activity or the fragment.
                     
                  &lt;br /&gt;

               &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listactivity_emptyview&quot;&gt;&lt;/a&gt;4.3.&amp;nbsp;Placeholder for an empty list
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
You can also use a view with the
                  &lt;code class=&quot;code&quot;&gt;@android:id/empty&lt;/code&gt;
                  ID in your layout. The corresponding activity and fragment shows this
                  view automatically if the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  is empty and hides it otherwise.
                  For example, you could
                  display
                  an
                  error message
                  in such
                  a view.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;ad-inBetween01&quot;&gt;
             
            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;exercise_listsactivity_simple&quot;&gt;&lt;/a&gt;5.&amp;nbsp;Exercise: Using ListView and ListActivity
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following exercise demonstrates how to use a
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
               in an
               &lt;code class=&quot;code&quot;&gt;ListActivity&lt;/code&gt;. You use
               the predefined
               &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
               class
               and an existing Android layout for the rows.
               
            &lt;br /&gt;

            
               Create a new Android project called
               &lt;em class=&quot;wordasword&quot;&gt;de.vogella.android.listactivity&lt;/em&gt;
               with the
               activity
               called
               &lt;code class=&quot;code&quot;&gt;MyListActivity&lt;/code&gt;.
               
            &lt;br /&gt;

            
               Change
               &lt;code class=&quot;code&quot;&gt;MyListActivity&lt;/code&gt;
               class based on the
               the following code example. Note that the
               &lt;code class=&quot;code&quot;&gt;setContentView()&lt;/code&gt;
               method is not used.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;, values);
    setListAdapter(adapter);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onListItemClick(ListView l, View v, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
    String item = (String) getListAdapter().getItem(position);
    Toast.makeText(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, item + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot; selected&quot;&lt;/span&gt;, Toast.LENGTH_LONG).show();
  }
} &lt;/pre&gt;
&lt;br /&gt;

            
               
            &lt;br /&gt;

            &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;ListActivity shows the items&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistactivity10.png.pagespeed.ic.hJc-76OIyv.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listsactivity_layout&quot;&gt;&lt;/a&gt;6.&amp;nbsp;Exercise: ListActivity with own layout
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
In our
               example your will define your layout for the rows and use
               it in your adapter.
               
            &lt;br /&gt;

            
               Create the
               &lt;code class=&quot;filename&quot;&gt;rowlayout.xml&lt;/code&gt;
               layout file
               in the
               &lt;code class=&quot;filename&quot;&gt;res/layout&lt;/code&gt;
               folder of
               the
               &lt;code class=&quot;code&quot;&gt;de.vogella.android.listactivity&lt;/code&gt;
               project.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;LinearLayout xmlns:android=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    android:layout_width=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
    android:layout_height=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt; &amp;gt;

    &amp;lt;ImageView
        android:id=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/icon&quot;&lt;/span&gt;
        android:layout_width=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;22px&quot;&lt;/span&gt;
        android:layout_height=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;22px&quot;&lt;/span&gt;
        android:layout_marginLeft=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;4px&quot;&lt;/span&gt;
        android:layout_marginRight=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;10px&quot;&lt;/span&gt;
        android:layout_marginTop=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;4px&quot;&lt;/span&gt;
        android:src=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt; &amp;gt;
    &amp;lt;/ImageView&amp;gt;

    &amp;lt;TextView
        android:id=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/label&quot;&lt;/span&gt;
        android:layout_width=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        android:layout_height=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        android:text=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/label&quot;&lt;/span&gt;
        android:textSize=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;20px&quot;&lt;/span&gt; &amp;gt;
    &amp;lt;/TextView&amp;gt;

&amp;lt;/LinearLayout&amp;gt; &lt;/pre&gt;
&lt;br /&gt;

            
               Change your
               activity
               so that is using the new layout.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// use your custom layout&lt;/em&gt;
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        R.layout.rowlayout, R.id.label, values);
    setListAdapter(adapter);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onListItemClick(ListView l, View v, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
    String item = (String) getListAdapter().getItem(position);
    Toast.makeText(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, item + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot; selected&quot;&lt;/span&gt;, Toast.LENGTH_LONG).show();
  }
} &lt;/pre&gt;
&lt;br /&gt;

            
               
            &lt;br /&gt;

            &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Displaying a ListView with a own layout&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistlayout10.png.pagespeed.ic.AySLgw_ZrH.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;tutorial_ownadapter&quot;&gt;&lt;/a&gt;7.&amp;nbsp;Tutorial: Implementing your own adapter
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following uses
               two images &quot;no.png&quot; and &quot;ok.png&quot;. I placed it
               in the
               &quot;res/drawable-mdpi&quot; folder. You must create your own icons. In
               case you do not find any icons just copy &quot;icon.png&quot; and use a drawing
               program to
               change
               it a little bit.
               
            &lt;br /&gt;

            
               Create the class
               &lt;code class=&quot;code&quot;&gt;MySimpleArrayAdapter&lt;/code&gt;
               which will serve as our adapter.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.content.Context;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.LayoutInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ViewGroup;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ImageView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.TextView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MySimpleArrayAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt; {
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; Context context;
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; String[] values;

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; MySimpleArrayAdapter(Context context, String[] values) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;(context, R.layout.rowlayout, values);
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.context = context;
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.values = values;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) context
        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.rowlayout, parent, false);
    TextView textView = (TextView) rowView.findViewById(R.id.label);
    ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
    textView.setText(values[position]);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Change the icon for Windows and iPhone&lt;/em&gt;
    String s = values[position];
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;) || s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;)
        || s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;)) {
      imageView.setImageResource(R.drawable.no);
    } &lt;span class=&quot;hl-keyword&quot;&gt;else&lt;/span&gt; {
      imageView.setImageResource(R.drawable.ok);
    }

    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; rowView;
  }
} &lt;/pre&gt;
&lt;br /&gt;

            
               To use this adapter, change the
               &lt;em class=&quot;wordasword&quot;&gt;activity&lt;/em&gt;
               to
               the following.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };
    MySimpleArrayAdapter adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; MySimpleArrayAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, values);
    setListAdapter(adapter);
  }

} &lt;/pre&gt;
&lt;br /&gt;

             If you run this example you should get a list with different
               icons for the certain elements.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;

            &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;ListView with different elements for each row&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistlayoutIndividual10.png.pagespeed.ic.E3l_nPH4Ba.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterperformance&quot;&gt;&lt;/a&gt;8.&amp;nbsp;ListViews and performance
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterperformance_motivation&quot;&gt;&lt;/a&gt;8.1.&amp;nbsp;Motivation
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Performance is especially important on Android as users expect
                  fast reaction times. Compared to desktop computers an Android
                  device
                  is relatively slow from the hardware perspective.
                  
               &lt;br /&gt;

               
                  This part describes how to reduce these operations to implement your
                  custom list adapter efficiently. The default Android adapters like
                  &lt;code class=&quot;code&quot;&gt;ArrayAdapter&lt;/code&gt;
                  are already performance optimized.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterperformance_problems&quot;&gt;&lt;/a&gt;8.2.&amp;nbsp;Time consuming operations
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Every
                  view
                  which get inflated from an XML layout file will result
                  in a Java
                  object. Inflating layouts and creating Java objects is
                  expensive with regards to
                  time and
                  memory
                  consumption.
                  
               &lt;br /&gt;

               
                  In addition using the
                  &lt;code class=&quot;code&quot;&gt;findViewById()&lt;/code&gt;
                  method is relatively time consuming, even though it is not as bad
                  as
                  XML inflating.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterperformance_convertview&quot;&gt;&lt;/a&gt;8.3.&amp;nbsp;Avoiding layout inflation and object creation
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
A
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  typically contains more data than the number of displayed rows.
                  If the
                  user scrolls
                  the
                  list, then rows and
                  their
                  associated
                  views
                  are being
                  scrolled
                  out of the visible area. The Java objects which
                  represents the
                  rows
                  can be reused for newly visible rows.
                  
               &lt;br /&gt;

               
                  If Android determines that a
                  row is not visible anymore, it allows the
                  &lt;code class=&quot;code&quot;&gt;getView()&lt;/code&gt;
                  of the adapter
                  method to reuse the associated view via the
                  &lt;code class=&quot;code&quot;&gt;convertView&lt;/code&gt;
                  parameter.
                  
               &lt;br /&gt;

               
                  The adapter can
                  assign
                  new
                  data to the views contained in the view
                  hierarchy of the
                  &lt;code class=&quot;code&quot;&gt;convertView&lt;/code&gt;. This avoids inflating an XML file and creating new Java objects.
                  
               &lt;br /&gt;

               
                  In case Android cannot reuse a row, the Android system passes
                  &lt;code class=&quot;code&quot;&gt;null&lt;/code&gt;
                  to the
                  &lt;code class=&quot;code&quot;&gt;convertView&lt;/code&gt;
                  parameter. Therefore the adapter implementation needs to check for
                  this.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterperformance_holder&quot;&gt;&lt;/a&gt;8.4.&amp;nbsp;View holder pattern
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
A
                  &lt;em class=&quot;wordasword&quot;&gt;ViewHolder&lt;/em&gt;
                  implementation
                  allows to avoid the
                  &lt;code class=&quot;code&quot;&gt;findViewById()&lt;/code&gt;
                  method in an adapter.
                  
               &lt;br /&gt;

               
                  A
                  &lt;code class=&quot;code&quot;&gt;ViewHolder&lt;/code&gt;
                  class is typically a static inner class in your adapter which holds references
                  to
                  the relevant views.
                  in your layout. This reference is assigned to
                  the
                  row view as a tag via the
                  &lt;code class=&quot;code&quot;&gt;setTag()&lt;/code&gt;
                  method.
                  
               &lt;br /&gt;

               
                  If we receive a
                  &lt;code class=&quot;code&quot;&gt;convertView&lt;/code&gt;
                  object, we can get the instance of the
                  &lt;code class=&quot;code&quot;&gt;ViewHolder&lt;/code&gt;
                  via the
                  &lt;code class=&quot;code&quot;&gt;getTag()&lt;/code&gt;
                  method and assign the new attributes to the
                  views
                  via the
                  &lt;code class=&quot;code&quot;&gt;ViewHolder&lt;/code&gt;
                  reference.
                  
               &lt;br /&gt;

               
                  While this sounds complex this is approximately 15 % faster then
                  using the
                  &lt;code class=&quot;code&quot;&gt;findViewById()&lt;/code&gt;
                  method.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;adapterperformance_example&quot;&gt;&lt;/a&gt;8.5.&amp;nbsp;Example
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following code shows a performance optimized adapter
                  implementation which reuses existing views and implements the holder
                  pattern.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.Activity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.LayoutInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ViewGroup;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ImageView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.TextView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyPerformanceArrayAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt; {
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; Activity context;
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; String[] names;

  &lt;span class=&quot;hl-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; ViewHolder {
    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; TextView text;
    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; ImageView image;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; MyPerformanceArrayAdapter(Activity context, String[] names) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;(context, R.layout.rowlayout, names);
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.context = context;
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.names = names;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, View convertView, ViewGroup parent) {
    View rowView = convertView;
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// reuse views&lt;/em&gt;
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (rowView == null) {
      LayoutInflater inflater = context.getLayoutInflater();
      rowView = inflater.inflate(R.layout.rowlayout, null);
      &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// configure view holder&lt;/em&gt;
      ViewHolder viewHolder = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ViewHolder();
      viewHolder.text = (TextView) rowView.findViewById(R.id.TextView01);
      viewHolder.image = (ImageView) rowView
          .findViewById(R.id.ImageView01);
      rowView.setTag(viewHolder);
    }

    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// fill data&lt;/em&gt;
    ViewHolder holder = (ViewHolder) rowView.getTag();
    String s = names[position];
    holder.text.setText(s);
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;) || s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;)
        || s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;)) {
      holder.image.setImageResource(R.drawable.no);
    } &lt;span class=&quot;hl-keyword&quot;&gt;else&lt;/span&gt; {
      holder.image.setImageResource(R.drawable.ok);
    }

    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; rowView;
  }
} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;ad-inBetween02&quot;&gt;
             
            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_selection&quot;&gt;&lt;/a&gt;9.&amp;nbsp;Storing the selection of a view
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
By default a
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
               has no selection mode active. You can activate
               it via the
               &lt;code class=&quot;code&quot;&gt;setChoiceMode()&lt;/code&gt;
               method call. Pass
               &lt;code class=&quot;code&quot;&gt;ListView.CHOICE_MODE_MULTIPLE&lt;/code&gt;
               for multiple selections or
               &lt;code class=&quot;code&quot;&gt;ListView.CHOICE_MODE_SINGLE&lt;/code&gt;
               for single selections
               to this method.
               
            &lt;br /&gt;

            
               To get the selected items of a
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;,
               use the
               &lt;code class=&quot;code&quot;&gt;getCheckedItemPosition()&lt;/code&gt;
               for a single selection
               method or
               &lt;code class=&quot;code&quot;&gt;listView.getCheckedItemPositions()&lt;/code&gt;
               for multiple selections.
               . If you have stable ID, you could
               also use the
               &lt;code class=&quot;code&quot;&gt;getCheckedItemIds()&lt;/code&gt;
               method to get the selected IDs.
               
            &lt;br /&gt;

            
               Android already provides a default layout for this: the
               &lt;code class=&quot;code&quot;&gt;android.R.layout.simple_list_item_multiple_choice&lt;/code&gt;
               layout which contains a configured
               &lt;code class=&quot;code&quot;&gt;CheckedTextView&lt;/code&gt;
               view.
               
            &lt;br /&gt;

            
               The following activities demonstrate how to use these selection
               modes. If you use these modes, the
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
               stores the selected values. It is not persisted in your data model.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.listview.selection.multi;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.Menu;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.MenuItem;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; com.vogella.android.listview.selection.R;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MainActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;a&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;b&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;c&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;d&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;e&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;f&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;g&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;h&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;i&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;j&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;k&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;l&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;m&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;n&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;o&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;p&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;q&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;r&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;s&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;t&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;u&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;w&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;x&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;y&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;z&quot;&lt;/span&gt; };
    
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_multiple_choice, values);
    setListAdapter(adapter);
    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.main, menu);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onOptionsItemSelected(MenuItem item) {
    Toast.makeText(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        String.valueOf(getListView().getCheckedItemCount()),
        Toast.LENGTH_LONG).show();
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }
} &lt;/pre&gt;
&lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.listview.selection.single;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.Menu;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.MenuItem;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;


&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MainActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;a&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;b&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;c&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;d&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;e&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;f&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;g&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;h&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;i&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;j&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;k&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;l&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;m&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;n&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;o&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;p&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;q&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;r&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;s&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;t&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;u&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;w&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;x&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;y&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;z&quot;&lt;/span&gt; };
    
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_single_choice, values);
    setListAdapter(adapter);
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.main, menu);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onOptionsItemSelected(MenuItem item) {
    Toast.makeText(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        String.valueOf(getListView().getCheckedItemCount()),
        Toast.LENGTH_LONG).show();
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }
} &lt;/pre&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_actionbar&quot;&gt;&lt;/a&gt;10.&amp;nbsp;Contextual action mode for ListViews
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following assumes that you already familiar with the concept of
               the
               &lt;em class=&quot;wordasword&quot;&gt;ActionBar&lt;/em&gt;
               and contextual action mode in general. This part will explain how to use
               contextual action mode for a
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
               selection.
               
            &lt;br /&gt;

            
               To assign a contextual action mode to a long click on an individual
               item, use the method
               &lt;code class=&quot;code&quot;&gt;setOnItemLongClickListener()&lt;/code&gt;
               on
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;. This methods includes information about the selected item. In this
               method you can start the &lt;code class=&quot;code&quot;&gt;ActionMode&lt;/code&gt;.
               
            &lt;br /&gt;

            
               The following examples demonstrate that. It assumes that you
               have a menu XML file defined called &lt;code class=&quot;filename&quot;&gt;rowselection.xml&lt;/code&gt; and that this
               menu contains one entry with the &lt;em class=&quot;parameter&quot;&gt;&lt;code&gt;@+id/menuitem1_show&lt;/code&gt;&lt;/em&gt; ID.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ActionMode;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.Menu;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.MenuInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.MenuItem;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.AdapterView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.AdapterView.OnItemLongClickListener;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivityActionbar &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity 
    &lt;span class=&quot;hl-keyword&quot;&gt;implements&lt;/span&gt; ActionMode.Callback {

  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; Object mActionMode;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; selectedItem = -&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;;

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, 
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;, 
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt;, 
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;, 
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;, 
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };

    MySimpleArrayAdapter adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; MySimpleArrayAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, values);
    setListAdapter(adapter);

    getListView().setOnItemLongClickListener(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; OnItemLongClickListener() {

      &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
      &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onItemLongClick(AdapterView&amp;lt;?&amp;gt; parent, View view, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {

        &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (mActionMode != null) {
          &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; false;
        }
        selectedItem = position;

        &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Start the CAB using the ActionMode.Callback defined above&lt;/em&gt;
        mActionMode = MyListActivityActionbar.&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.startActionMode(MyListActivityActionbar.&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;);
        view.setSelected(true);
        &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
      }
    });
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; show() {
    Toast.makeText(MyListActivityActionbar.&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, String.valueOf(selectedItem), Toast.LENGTH_LONG).show();
  }

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Called when the action mode is created; startActionMode() was called&lt;/em&gt;
  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onCreateActionMode(ActionMode mode, Menu menu) {
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Inflate a menu resource providing context menu items&lt;/em&gt;
    MenuInflater inflater = mode.getMenuInflater();
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Assumes that you have &quot;contexual.xml&quot; menu resources&lt;/em&gt;
    inflater.inflate(R.menu.rowselection, menu);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Called each time the action mode is shown. Always called after&lt;/em&gt;
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// onCreateActionMode, but&lt;/em&gt;
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// may be called multiple times if the mode is invalidated.&lt;/em&gt;
  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onPrepareActionMode(ActionMode mode, Menu menu) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; false; &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Return false if nothing is done&lt;/em&gt;
  }

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Called when the user selects a contextual menu item&lt;/em&gt;
  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onActionItemClicked(ActionMode mode, MenuItem item) {
    &lt;span class=&quot;hl-keyword&quot;&gt;switch&lt;/span&gt; (item.getItemId()) {
    &lt;span class=&quot;hl-keyword&quot;&gt;case&lt;/span&gt; R.id.menuitem1_show:
      show();
      &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Action picked, so close the CAB&lt;/em&gt;
      mode.finish();
      &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
    &lt;span class=&quot;hl-keyword&quot;&gt;default&lt;/span&gt;:
      &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; false;
    }
  }

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Called when the user exits the action mode&lt;/em&gt;
  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onDestroyActionMode(ActionMode mode) {
    mActionMode = null;
    selectedItem = -&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;;
  }

} &lt;/pre&gt;
&lt;br /&gt;

            
               If you start your application and long press on an item in the
               list,
               you get your contextual action bar. 
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;

            &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Using the contextual ActionBar on ListView&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xlistview_contextual10.png.pagespeed.ic.8T1wsGMXAi.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_undoaction&quot;&gt;&lt;/a&gt;11.&amp;nbsp;Implementing undo for an action
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_undoaction1&quot;&gt;&lt;/a&gt;11.1.&amp;nbsp;When should you offer an undo action?
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
It is good practice to allow the user to undo critical actions.
                  Such a critical action is, for example, the deletion of list items.
                  
               &lt;br /&gt;

               
                  A proven
                  pattern to handle this undo option is to offer
                  a
                  selection
                  at the end of the
                  screen. This selection vanishes after a
                  predefined
                  time or once
                  the user continues to interact with the
                  application.
                  
               &lt;br /&gt;

               
                  For example, the
                  Gmail application implements such a
                  behavior.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Undo button&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xundobutton02.png.pagespeed.ic.seQU5MSPPd.jpg&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listview_undoaction2&quot;&gt;&lt;/a&gt;11.2.&amp;nbsp;Example
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following description contains an example for implementing
                  an undo action. It uses an animation to phase out the
                  undo button
                  automatically out after a while.
                  
               &lt;br /&gt;

               
                  For this example create a new project called
                  &lt;em class=&quot;wordasword&quot;&gt;com.vogella.android.userinterface.undo&lt;/em&gt;
                  based on the
                  &lt;em class=&quot;wordasword&quot;&gt;BlankTemplate&lt;/em&gt;
                  template.
                  
               &lt;br /&gt;

               
                  Create the following layout for your
                  &lt;em class=&quot;wordasword&quot;&gt;activity&lt;/em&gt;. It uses a
                  &lt;code class=&quot;code&quot;&gt;FrameLayout&lt;/code&gt;
                  to show two different parts of the user interface. The button bar is
                  initially hidden. The button uses a drawable. Either add such a
                  drawable
                  to your project or remove the reference.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;FrameLayout&lt;/span&gt; &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:tools&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;RelativeLayout&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;tools:context&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;

        &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;ListView&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/listview&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;
        &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/ListView&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/RelativeLayout&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/undobar&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:visibility&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;gone&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_gravity&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;bottom|center_horizontal&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_margin&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;20dp&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:alpha&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;100&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:background&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;#808080&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:dividerPadding&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;11dp&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:padding&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;4dp&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;

        &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/undobar_message&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:text&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;Deleted&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textAppearance&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;?android:attr/textAppearanceMedium&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textColor&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;#fff&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt;

        &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;Button&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/undobar_button&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_marginLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;30dp&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:onClick&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;onClick&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:background&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;#808080&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:drawableLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@drawable/ic_undobar_undo&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:text&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;Undo&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textAppearance&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;?android:attr/textAppearanceMedium&quot;&lt;/span&gt;
            &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textColor&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;#fff&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;

&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/FrameLayout&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  Change your
                  &lt;em class=&quot;wordasword&quot;&gt;activity&lt;/em&gt;
                  so that it is similar to the following code. The Android project
                  wizard in Eclipse already generated an &lt;code class=&quot;code&quot;&gt;ActionBar&lt;/code&gt; entry. This entry is
                  used in the following code. If in doubt, create your own &lt;code class=&quot;code&quot;&gt;ActionBar&lt;/code&gt;
                  entry.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.userinterface.undo;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.Activity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.Menu;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.MenuItem;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; com.vogella.android.actionbar.undo.R;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MainActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; Activity {

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; View viewContainer;

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ListView l = (ListView) findViewById(R.id.listview);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows&quot;&lt;/span&gt; };
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;, values);
    viewContainer = findViewById(R.id.undobar);
    l.setAdapter(adapter);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onCreateOptionsMenu(Menu menu) {
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Inflate the menu; this adds items to the action bar if it is present.&lt;/em&gt;
    getMenuInflater().inflate(R.menu.activity_main, menu);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onOptionsItemSelected(MenuItem item) {
    showUndo(viewContainer);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onClick(View view) {
    Toast.makeText(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Deletion undone&quot;&lt;/span&gt;, Toast.LENGTH_LONG).show();
    viewContainer.setVisibility(View.GONE);
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; showUndo(&lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; View viewContainer) {
    viewContainer.setVisibility(View.VISIBLE);
    viewContainer.setAlpha(&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);
    viewContainer.animate().alpha(&lt;span class=&quot;hl-number&quot;&gt;0.4f&lt;/span&gt;).setDuration(&lt;span class=&quot;hl-number&quot;&gt;5000&lt;/span&gt;)
        .withEndAction(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; Runnable() {

          &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
          &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; run() {
            viewContainer.setVisibility(View.GONE);
          }
        });

  }
} &lt;/pre&gt;
&lt;br /&gt;

               
                  If you select the entry in the
                  &lt;em class=&quot;wordasword&quot;&gt;ActionBar&lt;/em&gt;,
                  the button bar becomes visible for 5 seconds.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Undo button&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xundobutton10.png.pagespeed.ic.smlx0edmY6.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listsactivity_performance&quot;&gt;&lt;/a&gt;12.&amp;nbsp;Performance Optimization
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The following will implement a performance optimized version of
               the adapter from the previous example.
               
            &lt;br /&gt;

            
               Create the following
               &lt;code class=&quot;code&quot;&gt;MyPerformanceArrayAdapter&lt;/code&gt;
               class.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.Activity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.LayoutInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ViewGroup;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ImageView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.TextView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyPerformanceArrayAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt; {
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; Activity context;
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; String[] names;

  &lt;span class=&quot;hl-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; ViewHolder {
    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; TextView text;
    &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; ImageView image;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; MyPerformanceArrayAdapter(Activity context, String[] names) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;(context, R.layout.rowlayout, names);
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.context = context;
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.names = names;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, View convertView, ViewGroup parent) {
    View rowView = convertView;
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// reuse views&lt;/em&gt;
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (rowView == null) {
      LayoutInflater inflater = context.getLayoutInflater();
      rowView = inflater.inflate(R.layout.rowlayout, null);
      &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// configure view holder&lt;/em&gt;
      ViewHolder viewHolder = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ViewHolder();
      viewHolder.text = (TextView) rowView.findViewById(R.id.TextView01);
      viewHolder.image = (ImageView) rowView
          .findViewById(R.id.ImageView01);
      rowView.setTag(viewHolder);
    }

    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// fill data&lt;/em&gt;
    ViewHolder holder = (ViewHolder) rowView.getTag();
    String s = names[position];
    holder.text.setText(s);
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;) || s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;)
        || s.startsWith(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;)) {
      holder.image.setImageResource(R.drawable.no);
    } &lt;span class=&quot;hl-keyword&quot;&gt;else&lt;/span&gt; {
      holder.image.setImageResource(R.drawable.ok);
    }

    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; rowView;
  }
} &lt;/pre&gt;
&lt;br /&gt;

            
               Use your new adapter in your
               &lt;em class=&quot;wordasword&quot;&gt;activity&lt;/em&gt;. If you run the application it should look the same but it will be
               much faster, especially for large datasets.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    String[] values = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WindowsMobile&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Blackberry&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;WebOS&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Max OS X&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;OS/2&quot;&lt;/span&gt; };
    setListAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; MyPerformanceArrayAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, values));
  }

} &lt;/pre&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;tutorial_twolistitems&quot;&gt;&lt;/a&gt;13.&amp;nbsp;Tutorial: How to display two items in a ListView
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
You can use the
               &lt;code class=&quot;code&quot;&gt;SimpleAdapter&lt;/code&gt;
               class to show the data of two elements. This class expects a Array of
               Strings (&lt;code class=&quot;code&quot;&gt;from&lt;/code&gt;
               data) in which the fields of the input data are defined. It also
               requires a Array of ints which defines the IDs of the widgets in the
               layout for the row to which these fields are mapped.
               
            &lt;br /&gt;

            The actual data is then a list of Maps. The Map defines for each
               field in the from data a value.
               
            &lt;br /&gt;

             The following shows an example which reuses an predefined layout
               from Android for the row.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.ArrayList;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.HashMap;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.Map;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.SimpleAdapter;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyTwoListItemsActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    ArrayList&amp;lt;Map&amp;lt;String, String&amp;gt;&amp;gt; list = buildData();
    String[] from = { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;name&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;purpose&quot;&lt;/span&gt; };
    &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt;[] to = { android.R.id.text1, android.R.id.text2 };

    SimpleAdapter adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; SimpleAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, list,
        android.R.layout.simple_list_item_&lt;span class=&quot;hl-number&quot;&gt;2&lt;/span&gt;, from, to);
    setListAdapter(adapter);
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; ArrayList&amp;lt;Map&amp;lt;String, String&amp;gt;&amp;gt; buildData() {
    ArrayList&amp;lt;Map&amp;lt;String, String&amp;gt;&amp;gt; list = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayList&amp;lt;Map&amp;lt;String, String&amp;gt;&amp;gt;();
    list.add(putData(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Mobile&quot;&lt;/span&gt;));
    list.add(putData(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;));
    list.add(putData(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;));
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; list;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; HashMap&amp;lt;String, String&amp;gt; putData(String name, String purpose) {
    HashMap&amp;lt;String, String&amp;gt; item = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; HashMap&amp;lt;String, String&amp;gt;();
    item.put(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;name&quot;&lt;/span&gt;, name);
    item.put(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;purpose&quot;&lt;/span&gt;, purpose);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; item;
  }
  
} &lt;/pre&gt;
&lt;br /&gt;

         &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listviewselection&quot;&gt;&lt;/a&gt;14.&amp;nbsp;Selecting multiple items in the ListView
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listviewselection_data&quot;&gt;&lt;/a&gt;14.1.&amp;nbsp;Interaction between the model and Listview
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Frequently you need to select items in your
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;. As the row of the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  are getting recycled you cannot store the selection on the
                  &lt;code class=&quot;code&quot;&gt;View&lt;/code&gt;
                  level.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;ListView with Interaction and full model&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xinteractive10.png.pagespeed.ic.V0cVgp99SN.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

               Selection is just one possible example but you can imange other
                  interaction between your row and model.
                  
               &lt;br /&gt;

               To persist the selection you have to update your data model with
                  the selected state.
                  
               &lt;br /&gt;

               
                  To update the data model in your
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  you define your own
                  &lt;code class=&quot;code&quot;&gt;Adapter&lt;/code&gt;
                  class. In this adapter class you attach a listener to the
                  &lt;code class=&quot;code&quot;&gt;View&lt;/code&gt;
                  which is responsible for selecting the model element. If selected you
                  update the state in the model which you can add as a tag to the View
                  to have access to it.
                  
               &lt;br /&gt;

               
                  The following example demonstrates how to use standard Java
                  object
                  and
                  how to interact from the
                  &lt;code class=&quot;code&quot;&gt;Views&lt;/code&gt;
                  with the model.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;listadvanced_interactive&quot;&gt;&lt;/a&gt;14.2.&amp;nbsp;Tutorial: Domain Model and Rows interaction
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Continue to use the
                  &lt;code class=&quot;code&quot;&gt;de.vogella.android.listactivity&lt;/code&gt;
                  project.
                  
               &lt;br /&gt;

               
                  
                  Create the following
                  &lt;code class=&quot;code&quot;&gt;Model&lt;/code&gt;
                  which hold the name and the information if this element is
                  currently
                  selected.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; Model {

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; String name;
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; selected;

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; Model(String name) {
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.name = name;
    selected = false;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; String getName() {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; name;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; setName(String name) {
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.name = name;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; isSelected() {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; selected;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; setSelected(&lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; selected) {
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.selected = selected;
  }

} &lt;/pre&gt;
&lt;br /&gt;

               
                  Create the following new layout file called
                  &lt;code class=&quot;filename&quot;&gt;rowbuttonlayout.xml&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;RelativeLayout xmlns:android=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    android:layout_width=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    android:layout_height=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt; &amp;gt;

    &amp;lt;TextView
        android:id=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/label&quot;&lt;/span&gt;
        android:layout_width=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        android:layout_height=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        android:text=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/label&quot;&lt;/span&gt;
        android:textSize=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;30px&quot;&lt;/span&gt; &amp;gt;
    &amp;lt;/TextView&amp;gt;

    &amp;lt;CheckBox
        android:id=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/check&quot;&lt;/span&gt;
        android:layout_width=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        android:layout_height=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        android:layout_alignParentRight=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        android:layout_marginLeft=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;4px&quot;&lt;/span&gt;
        android:layout_marginRight=&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;10px&quot;&lt;/span&gt; &amp;gt;
    &amp;lt;/CheckBox&amp;gt;

&amp;lt;/RelativeLayout&amp;gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  Create the following
                  &lt;code class=&quot;code&quot;&gt;Adapter&lt;/code&gt;. This adapter adds a listener
                  on the
                  &lt;code class=&quot;code&quot;&gt;Checkbox&lt;/code&gt;
                  view
                  . If the checkbox
                  is selected the underlying data of
                  the model is
                  changed.
                  &lt;code class=&quot;code&quot;&gt;Checkbox&lt;/code&gt;
                  gets the corresponding model element
                  assigned via the
                  &lt;code class=&quot;code&quot;&gt;getTag()&lt;/code&gt;
                  method.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.Activity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.LayoutInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ViewGroup;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.CheckBox;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.CompoundButton;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.TextView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; InteractiveArrayAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ArrayAdapter&amp;lt;Model&amp;gt; {

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; List&amp;lt;Model&amp;gt; list;
  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; Activity context;

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; InteractiveArrayAdapter(Activity context, List&amp;lt;Model&amp;gt; list) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;(context, R.layout.rowbuttonlayout, list);
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.context = context;
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.list = list;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; ViewHolder {
    &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; TextView text;
    &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; CheckBox checkbox;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, View convertView, ViewGroup parent) {
    View view = null;
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (convertView == null) {
      LayoutInflater inflator = context.getLayoutInflater();
      view = inflator.inflate(R.layout.rowbuttonlayout, null);
      &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; ViewHolder viewHolder = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ViewHolder();
      viewHolder.text = (TextView) view.findViewById(R.id.label);
      viewHolder.checkbox = (CheckBox) view.findViewById(R.id.check);
      viewHolder.checkbox
          .setOnCheckedChangeListener(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; CompoundButton.OnCheckedChangeListener() {

            &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
            &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCheckedChanged(CompoundButton buttonView,
                &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; isChecked) {
              Model element = (Model) viewHolder.checkbox
                  .getTag();
              element.setSelected(buttonView.isChecked());

            }
          });
      view.setTag(viewHolder);
      viewHolder.checkbox.setTag(list.get(position));
    } &lt;span class=&quot;hl-keyword&quot;&gt;else&lt;/span&gt; {
      view = convertView;
      ((ViewHolder) view.getTag()).checkbox.setTag(list.get(position));
    }
    ViewHolder holder = (ViewHolder) view.getTag();
    holder.text.setText(list.get(position).getName());
    holder.checkbox.setChecked(list.get(position).isSelected());
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; view;
  }
} &lt;/pre&gt;
&lt;br /&gt;

               
                  Finally change your
                  &lt;em class=&quot;wordasword&quot;&gt;activity&lt;/em&gt;
                  to the following.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.ArrayList;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyList &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {

  &lt;div class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;
/** Called when the activity is first created. */&lt;/div&gt;
&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// create an array of Strings, that will be put to our ListActivity&lt;/em&gt;
    ArrayAdapter&amp;lt;Model&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; InteractiveArrayAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        getModel());
    setListAdapter(adapter);
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; List&amp;lt;Model&amp;gt; getModel() {
    List&amp;lt;Model&amp;gt; list = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayList&amp;lt;Model&amp;gt;();
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Suse&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Eclipse&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;));
    list.add(get(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;));
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Initially select one of the items&lt;/em&gt;
    list.get(&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;).setSelected(true);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; list;
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; Model get(String s) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; Model(s);
  }

} &lt;/pre&gt;
&lt;br /&gt;

                If you start your app you should be able to flag items. These
                  changes will be reflected in your model.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;expandablelistview&quot;&gt;&lt;/a&gt;15.&amp;nbsp;Implementing an expandable ListView
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;expandablelistview_concept&quot;&gt;&lt;/a&gt;15.1.&amp;nbsp;ExpandableListView
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The
                  &lt;code class=&quot;code&quot;&gt;ExpandableListView&lt;/code&gt;
                  is similar to
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;  
                  but allow you to define groups and details for this group.
                  &lt;code class=&quot;code&quot;&gt;ExpandableListView&lt;/code&gt;
                  expects
                  and adapter of type
                  &lt;code class=&quot;code&quot;&gt;BaseExpandableListAdapter&lt;/code&gt;.
                  
               &lt;br /&gt;

               In this case you have to define two layouts, one for the group
                  and another one for the details row.
                  
               &lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;expandablelistview_example&quot;&gt;&lt;/a&gt;15.2.&amp;nbsp;ExpandableListView example
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
In the following example you create an expandable listview
                  similar to the following screenshot.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;

               &lt;div class=&quot;mediaobject&quot;&gt;
&lt;img alt=&quot;Screenshot of ExpandableListView&quot; src=&quot;http://www.vogella.com/tutorials/AndroidListView/images/xexpandablelistview10.png.pagespeed.ic.Y7rekQg67g.png&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;

               
                  Create a project called
                  &lt;em class=&quot;wordasword&quot;&gt;com.vogella.android.listview.expandable&lt;/em&gt;
                  with the activity called
                  &lt;code class=&quot;code&quot;&gt;MainActivity&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  Create or adjust the following layout files. First
                  &lt;code class=&quot;filename&quot;&gt;layout/activity_main.xml&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt; &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:tools&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/LinearLayout1&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingBottom&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@dimen/activity_vertical_margin&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@dimen/activity_horizontal_margin&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingRight&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@dimen/activity_horizontal_margin&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingTop&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@dimen/activity_vertical_margin&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;tools:context&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;ExpandableListView&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/listView&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;
    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/ExpandableListView&amp;gt;&lt;/span&gt;

&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  Afterwards create
                  &lt;code class=&quot;filename&quot;&gt;layout/listrow_group.xml&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;CheckedTextView&lt;/span&gt; &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:tools&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/textView1&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;?android:attr/listPreferredItemHeight&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_marginLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;8dp&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:drawableRight&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:gravity&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;left&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;32dp&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingTop&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;8dp&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:text&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;Test&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textSize&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;14sp&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textAlignment&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;textEnd&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textStyle&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  The last required layout is
                  &lt;code class=&quot;filename&quot;&gt;layout/listrow_details.xml&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt; &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;xmlns:tools&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;40dp&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:clickable&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;true&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:orientation&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:paddingLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;40dp&quot;&lt;/span&gt;
    &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;tools:context&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@+id/textView1&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:drawableLeft&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:drawablePadding&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;5dp&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:gravity&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;center_vertical&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:text&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@string/hello_world&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textSize&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;14sp&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:textStyle&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; &amp;gt;&lt;/span&gt;
    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/TextView&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;View&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;1dp&quot;&lt;/span&gt;
        &lt;span class=&quot;hl-attribute&quot; style=&quot;color: #7f0055;&quot;&gt;android:background&lt;/span&gt;=&lt;span class=&quot;hl-value&quot; style=&quot;color: blue;&quot;&gt;&quot;@android:color/black&quot;&lt;/span&gt;&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt; /&amp;gt;&lt;/span&gt;

&lt;span class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;br /&gt;

               
                  Create the following class which hold your domain model for the
                  &lt;code class=&quot;code&quot;&gt;ExpandableListView&lt;/code&gt;.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.listview.expandable;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.ArrayList;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; Group {

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; String string;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; List&amp;lt;String&amp;gt; children = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayList&amp;lt;String&amp;gt;();

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; Group(String string) {
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.string = string;
  }

} &lt;/pre&gt;
&lt;br /&gt;

               Finally create the adapter as described by the following listing
                  and change the activity to the code
                  provided below.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.listview.expandable;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.Activity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.util.SparseArray;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.LayoutInflater;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View.OnClickListener;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.ViewGroup;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.BaseExpandableListAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.CheckedTextView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.TextView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyExpandableListAdapter &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; BaseExpandableListAdapter {

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; SparseArray&amp;lt;Group&amp;gt; groups;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; LayoutInflater inflater;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; Activity activity;

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; MyExpandableListAdapter(Activity act, SparseArray&amp;lt;Group&amp;gt; groups) {
    activity = act;
    &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.groups = groups;
    inflater = act.getLayoutInflater();
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; Object getChild(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; childPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; groups.get(groupPosition).children.get(childPosition);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; getChildId(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; childPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getChildView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition, &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; childPosition,
      &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; isLastChild, View convertView, ViewGroup parent) {
    &lt;span class=&quot;hl-keyword&quot;&gt;final&lt;/span&gt; String children = (String) getChild(groupPosition, childPosition);
    TextView text = null;
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (convertView == null) {
      convertView = inflater.inflate(R.layout.listrow_details, null);
    }
    text = (TextView) convertView.findViewById(R.id.textView1);
    text.setText(children);
    convertView.setOnClickListener(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; OnClickListener() {
      &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
      &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onClick(View v) {
        Toast.makeText(activity, children,
            Toast.LENGTH_SHORT).show();
      }
    });
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; convertView;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; getChildrenCount(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; groups.get(groupPosition).children.size();
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; Object getGroup(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; groups.get(groupPosition);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; getGroupCount() {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; groups.size();
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onGroupCollapsed(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onGroupCollapsed(groupPosition);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onGroupExpanded(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onGroupExpanded(groupPosition);
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; getGroupId(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; View getGroupView(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition, &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; isExpanded,
      View convertView, ViewGroup parent) {
    &lt;span class=&quot;hl-keyword&quot;&gt;if&lt;/span&gt; (convertView == null) {
      convertView = inflater.inflate(R.layout.listrow_group, null);
    }
    Group group = (Group) getGroup(groupPosition);
    ((CheckedTextView) convertView).setText(group.string);
    ((CheckedTextView) convertView).setChecked(isExpanded);
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; convertView;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; hasStableIds() {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; false;
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; isChildSelectable(&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; groupPosition, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; childPosition) {
    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; false;
  }
} &lt;/pre&gt;
&lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; com.vogella.android.listview.expandable;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; java.util.ArrayList;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.Activity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.util.SparseArray;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.Menu;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ExpandableListView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MainActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; Activity {
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// more efficient than HashMap for mapping integers to objects&lt;/em&gt;
  SparseArray&amp;lt;Group&amp;gt; groups = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; SparseArray&amp;lt;Group&amp;gt;();

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    createData();
    ExpandableListView listView = (ExpandableListView) findViewById(R.id.listView);
    MyExpandableListAdapter adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; MyExpandableListAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        groups);
    listView.setAdapter(adapter);
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; createData() {
    &lt;span class=&quot;hl-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; j = &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;; j &amp;lt; &lt;span class=&quot;hl-number&quot;&gt;5&lt;/span&gt;; j++) {
      Group group = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; Group(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Test &quot;&lt;/span&gt; + j);
      &lt;span class=&quot;hl-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; &lt;span class=&quot;hl-number&quot;&gt;5&lt;/span&gt;; i++) {
        group.children.add(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Sub Item&quot;&lt;/span&gt; + i);
      }
      groups.append(j, group);
    }
  }

} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;miscellaneous&quot;&gt;&lt;/a&gt;16.&amp;nbsp;Tutorial: Miscellaneous
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;miscellaneous_longclick&quot;&gt;&lt;/a&gt;16.1.&amp;nbsp;Adding a longclick listener to the list items
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
You can also add a
                  &lt;code class=&quot;code&quot;&gt;LongItemClickListener&lt;/code&gt;
                  to the
                  &lt;code class=&quot;code&quot;&gt;View&lt;/code&gt;. For this receive the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  via the
                  &lt;code class=&quot;code&quot;&gt;getListVIew()&lt;/code&gt;
                  method
                  and set the
                  &lt;code class=&quot;code&quot;&gt;LongItemClickListener&lt;/code&gt;
                  via the
                  setOnItemLongClickListener() method.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.AdapterView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.AdapterView.OnItemLongClickListener;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.Toast;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyList &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {

  &lt;div class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;
/** Called when the activity is first created. */&lt;/div&gt;
&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// create an array of Strings, that will be put to our ListActivity&lt;/em&gt;
    String[] names = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Eclipse&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Suse&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt; };
    ArrayAdapter&amp;lt;String&amp;gt; adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; MyPerformanceArrayAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, names);
    setListAdapter(adapter);
    ListView list = getListView();
    list.setOnItemLongClickListener(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; OnItemLongClickListener() {

      &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
      &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;boolean&lt;/span&gt; onItemLongClick(AdapterView&amp;lt;?&amp;gt; parent, View view,
          &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
        Toast.makeText(MyList.&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
            &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Item in position &quot;&lt;/span&gt; + position + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot; clicked&quot;&lt;/span&gt;,
            Toast.LENGTH_LONG).show();
        &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Return true to consume the click event. In this case the&lt;/em&gt;
        &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// onListItemClick listener is not called anymore.&lt;/em&gt;
        &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; true;
      }
    });
  }

  &lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onListItemClick(ListView l, View v, &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt; position, &lt;span class=&quot;hl-keyword&quot;&gt;long&lt;/span&gt; id) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onListItemClick(l, v, position, id);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Get the item that was clicked&lt;/em&gt;
    Object o = &lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;.getListAdapter().getItem(position);
    String keyword = o.toString();
    Toast.makeText(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;You selected: &quot;&lt;/span&gt; + keyword, Toast.LENGTH_SHORT)
        .show();

  }

} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
               &lt;div class=&quot;titlepage&quot;&gt;
                  &lt;div&gt;
                     &lt;div&gt;
                        &lt;h3 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;miscellaneous_headerfooter&quot;&gt;&lt;/a&gt;16.2.&amp;nbsp;Header and Footer
                        &lt;/h3&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
You can of course put arbitrary
                  &lt;code class=&quot;code&quot;&gt;Views&lt;/code&gt;
                  elements around your ListView.
                  For
                  example you can define a layout with
                  two
                  &lt;code class=&quot;code&quot;&gt;TextViews&lt;/code&gt;
                  and a
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  between them.
                  In this case the two TextViews will
                  always be
                  visible
                  above the List
                  (header) and the other will be
                  visible below
                  the
                  ListView. If you want
                  to display a list header or list footer
                  only at
                  the
                  see
                  the
                  beginning or end of
                  the list you can use the
                  &lt;code class=&quot;code&quot;&gt;addHeaderView()&lt;/code&gt;
                  method
                  or
                  &lt;code class=&quot;code&quot;&gt;addFooterView()&lt;/code&gt;
                  method on the
                  &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;
                  class.
                  
               &lt;br /&gt;

               
                  
               &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.view.View;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ArrayAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListView;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyList &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {

  &lt;div class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;
/** Called when the activity is first created. */&lt;/div&gt;
&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle icicle) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(icicle);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// create an array of Strings, that will be put to our ListActivity&lt;/em&gt;
    String[] names = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Eclipse&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Suse&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Linux&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Windows7&quot;&lt;/span&gt;,
        &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Eclipse&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Suse&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Ubuntu&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Solaris&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Android&quot;&lt;/span&gt;, &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;iPhone&quot;&lt;/span&gt; };
    View header = getLayoutInflater().inflate(R.layout.header, null);
    View footer = getLayoutInflater().inflate(R.layout.footer, null);
    ListView listView = getListView();
    listView.addHeaderView(header);
    listView.addFooterView(footer);
    setListAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; ArrayAdapter&amp;lt;String&amp;gt;(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;,
        android.R.layout.simple_list_item_single_choice,
        android.R.id.text1, names));

  }
} &lt;/pre&gt;
&lt;br /&gt;

            &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
            &lt;div class=&quot;titlepage&quot;&gt;
               &lt;div&gt;
                  &lt;div&gt;
                     &lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;cursor&quot;&gt;&lt;/a&gt;17.&amp;nbsp;SimpleCursorAdapter
                     &lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
In case you work with a content provider or directly with the database
               you can use the
               &lt;code class=&quot;code&quot;&gt;SimpleCursorAdapter&lt;/code&gt;
               to define the data for your
               &lt;code class=&quot;code&quot;&gt;ListView&lt;/code&gt;. The following will demonstrates how to access the Contacts
               ContentProvider.
               
            &lt;br /&gt;

            
               Create a new Android project called
               &quot;de.vogella.android.listactivity.cursor&quot;
               with the
               &lt;em class=&quot;wordasword&quot;&gt;activity&lt;/em&gt;
               called
               &lt;em class=&quot;wordasword&quot;&gt;MyListActivity&lt;/em&gt;. Change
               &lt;code class=&quot;code&quot;&gt;MyListActivity&lt;/code&gt;
               to the following.
               
            &lt;br /&gt;

            
               
            &lt;br /&gt;
&lt;pre class=&quot;programlisting&quot;&gt;&lt;span class=&quot;hl-keyword&quot;&gt;package&lt;/span&gt; de.vogella.android.listactivity.cursor;

&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.app.ListActivity;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.database.Cursor;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.net.Uri;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.os.Bundle;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.provider.ContactsContract;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.ListAdapter;
&lt;span class=&quot;hl-keyword&quot;&gt;import&lt;/span&gt; android.widget.SimpleCursorAdapter;

&lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;class&lt;/span&gt; MyListActivity &lt;span class=&quot;hl-keyword&quot;&gt;extends&lt;/span&gt; ListActivity {
  &lt;div class=&quot;hl-tag&quot; style=&quot;color: #008800;&quot;&gt;
/** Called when the activity is first created. */&lt;/div&gt;
&lt;em&gt;&lt;span class=&quot;hl-annotation&quot; style=&quot;color: grey;&quot;&gt;@Override&lt;/span&gt;&lt;/em&gt;
  &lt;span class=&quot;hl-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    &lt;span class=&quot;hl-keyword&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    Cursor mCursor = getContacts();
    startManagingCursor(mCursor);
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// now create a new list adapter bound to the cursor.&lt;/em&gt;
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// SimpleListAdapter is designed for binding to a Cursor.&lt;/em&gt;
    ListAdapter adapter = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; SimpleCursorAdapter(&lt;span class=&quot;hl-keyword&quot;&gt;this&lt;/span&gt;, &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Context.&lt;/em&gt;
        android.R.layout.two_line_list_item, &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Specify the row template&lt;/em&gt;
                            &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// to use (here, two&lt;/em&gt;
                            &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// columns bound to the&lt;/em&gt;
                            &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// two retrieved cursor&lt;/em&gt;
                            &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// rows).&lt;/em&gt;
        mCursor, &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Pass in the cursor to bind to.&lt;/em&gt;
        &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Array of cursor columns to bind to.&lt;/em&gt;
        &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { ContactsContract.Contacts._ID,
            ContactsContract.Contacts.DISPLAY_NAME },
        &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Parallel array of which template objects to bind to those&lt;/em&gt;
        &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// columns.&lt;/em&gt;
        &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot;&gt;int&lt;/span&gt;[] { android.R.id.text1, android.R.id.text2 });

    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Bind to our new adapter.&lt;/em&gt;
    setListAdapter(adapter);
  }

  &lt;span class=&quot;hl-keyword&quot;&gt;private&lt;/span&gt; Cursor getContacts() {
    &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Run query&lt;/em&gt;
    Uri uri = ContactsContract.Contacts.CONTENT_URI;
    String[] projection = &lt;span class=&quot;hl-keyword&quot;&gt;new&lt;/span&gt; String[] { ContactsContract.Contacts._ID,
        ContactsContract.Contacts.DISPLAY_NAME };
    String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot; = &#39;&quot;&lt;/span&gt;
        + (&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;1&quot;&lt;/span&gt;) + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;;
    String[] selectionArgs = null;
    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME
        + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot; COLLATE LOCALIZED ASC&quot;&lt;/span&gt;;

    &lt;span class=&quot;hl-keyword&quot;&gt;return&lt;/span&gt; managedQuery(uri, projection, selection, selectionArgs,
        sortOrder);
  }

} &lt;/pre&gt;
&lt;br /&gt;

             Make sure you give your application the permission to read the
               contacts. (Uses Permissions &quot;android.permission.READ_CONTACTS&quot; in
               AndroidManifest.xml)
               
            &lt;br /&gt;

         &lt;/div&gt;
&lt;h2 class=&quot;title&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;actionbar_libraries&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/1317219565426958150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/using-lists-in-android-listview-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/1317219565426958150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/1317219565426958150'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/using-lists-in-android-listview-tutorial.html' title='Using lists in Android (ListView) - Tutorial'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-4815822315469526872</id><published>2015-06-21T20:32:00.001+05:30</published><updated>2015-06-21T20:33:21.708+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="AngularJS"/><category scheme="http://www.blogger.com/atom/ns#" term="Restful"/><category scheme="http://www.blogger.com/atom/ns#" term="Webservices"/><title type='text'>AngularJS - REST Services</title><content type='html'>&lt;h2 class=&quot;ng-scope&quot; id=&quot;dependencies&quot;&gt;
&lt;img alt=&quot;Link to Angular JS Homepage&quot; class=&quot;logo&quot; height=&quot;82&quot; src=&quot;https://docs.angularjs.org/img/angularjs-for-header-only.svg&quot; width=&quot;320&quot; /&gt; &lt;/h2&gt;
&lt;h2 class=&quot;ng-scope&quot; id=&quot;dependencies&quot;&gt;
Dependencies&lt;/h2&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
The RESTful functionality is provided by Angular in the &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;ngResource&lt;/span&gt;&lt;/code&gt; module, which is distributed
separately from the core Angular framework.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
We are using &lt;a href=&quot;http://bower.io/&quot;&gt;Bower&lt;/a&gt; to install client side dependencies.  This step updates the
&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;bower&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;json&lt;/span&gt;&lt;/code&gt; configuration file to include the new dependency:&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;angular-seed&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;A starter project for AngularJS&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;version&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;0.0.0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;homepage&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;https://github.com/angular/angular-seed&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;license&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;MIT&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;private&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;dependencies&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;~1.3.0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;angular-mocks&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;~1.3.0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;bootstrap&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;~3.1.1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;angular-route&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;~1.3.0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;angular-resource&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;~1.3.0&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
The new dependency &lt;code&gt;&lt;span class=&quot;str&quot;&gt;&quot;angular-resource&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;~1.3.0&quot;&lt;/span&gt;&lt;/code&gt; tells bower to install a version of the
angular-resource component that is compatible with version 1.3.x.  We must ask bower to download
and install this dependency. We can do this by running:&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;npm install&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;alert alert-warning ng-scope&quot;&gt;
  &lt;strong&gt;Warning:&lt;/strong&gt; If a new version of Angular has been released since you last ran &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;npm install&lt;/span&gt;&lt;/code&gt;, then you may have a
  problem with the &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;bower install&lt;/span&gt;&lt;/code&gt; due to a conflict between the versions of angular.js that need to
  be installed.  If you get this then simply delete your &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bower_components&lt;/span&gt;&lt;/code&gt; folder before running
  &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;npm install&lt;/span&gt;&lt;/code&gt;.
&lt;/div&gt;
&lt;div class=&quot;alert alert-info ng-scope&quot;&gt;
  &lt;strong&gt;Note:&lt;/strong&gt; If you have bower installed globally then you can run &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;bower install&lt;/span&gt;&lt;/code&gt; but for this project we have
  preconfigured &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;npm install&lt;/span&gt;&lt;/code&gt; to run bower for us.
&lt;/div&gt;
&lt;h2 class=&quot;ng-scope&quot; id=&quot;template&quot;&gt;
Template&lt;/h2&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
Our custom resource service will be defined in &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt; so we need to include this file
in our layout template. Additionally, we also need to load the &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;angular&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;resource&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt; file, which
contains the &lt;a href=&quot;https://docs.angularjs.org/api/ngResource&quot;&gt;ngResource&lt;/a&gt; module:&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
&lt;strong&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;html&lt;/span&gt;&lt;/code&gt;.&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code class=&quot;lang-html&quot;&gt;&lt;span class=&quot;pln&quot;&gt;...
  &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;bower_components/angular-resource/angular-resource.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;js/services.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 class=&quot;ng-scope&quot; id=&quot;service&quot;&gt;
Service&lt;/h2&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
We create our own service to provide access to the phone data on the server:&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
&lt;strong&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt;.&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code class=&quot;lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; phonecatServices &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; angular&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatServices&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;ngResource&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

phonecatServices&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;factory&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Phone&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;$resource&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$resource&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $resource&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phones/:phoneId.json&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;GET&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; params&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phoneId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phones&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; isArray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
We used the module API to register a custom service using a factory function. We passed in the name
of the service - &#39;Phone&#39; - and the factory function. The factory function is similar to a
controller&#39;s constructor in that both can declare dependencies to be injected via function
arguments. The Phone service declared a dependency on the &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;$resource&lt;/span&gt;&lt;/code&gt; service.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
The &lt;a href=&quot;https://docs.angularjs.org/api/ngResource/service/$resource&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;$resource&lt;/span&gt;&lt;/code&gt;&lt;/a&gt; service makes it easy to create a
&lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_State_Transfer&quot;&gt;RESTful&lt;/a&gt; client with just a few lines of code. This client can then be used in our
application, instead of the lower-level &lt;a href=&quot;https://docs.angularjs.org/api/ng/service/$http&quot;&gt;$http&lt;/a&gt; service.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
&lt;strong&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt;.&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code class=&quot;lang-js&quot;&gt;&lt;span class=&quot;pun&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
angular&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatApp&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;ngRoute&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatControllers&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatFilters&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatServices&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
We need to add the &#39;phonecatServices&#39; module dependency to &#39;phonecatApp&#39; module&#39;s requires array.&lt;/div&gt;
&lt;h2 class=&quot;ng-scope&quot; id=&quot;controller&quot;&gt;
Controller&lt;/h2&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
We simplified our sub-controllers (&lt;code&gt;&lt;span class=&quot;typ&quot;&gt;PhoneListCtrl&lt;/span&gt;&lt;/code&gt; and &lt;code&gt;&lt;span class=&quot;typ&quot;&gt;PhoneDetailCtrl&lt;/span&gt;&lt;/code&gt;) by factoring out the
lower-level &lt;a href=&quot;https://docs.angularjs.org/api/ng/service/$http&quot;&gt;$http&lt;/a&gt; service, replacing it with a new service called
&lt;code&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt;&lt;/code&gt;. Angular&#39;s &lt;a href=&quot;https://docs.angularjs.org/api/ngResource/service/$resource&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;$resource&lt;/span&gt;&lt;/code&gt;&lt;/a&gt; service is easier to
use than &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;$http&lt;/span&gt;&lt;/code&gt; for interacting with data sources exposed as RESTful resources. It is also easier
now to understand what the code in our controllers is doing.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
&lt;strong&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;controllers&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt;.&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code class=&quot;lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; phonecatControllers &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; angular&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatControllers&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

phonecatControllers&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;controller&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneListCtrl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;$scope&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Phone&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phones &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderProp &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;age&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

phonecatControllers&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;controller&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneDetailCtrl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;$scope&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;$routeParams&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Phone&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $routeParams&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phone &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phoneId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $routeParams&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phoneId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mainImageUrl &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

  $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setImage &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;imageUrl&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mainImageUrl &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; imageUrl&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
Notice how in &lt;code&gt;&lt;span class=&quot;typ&quot;&gt;PhoneListCtrl&lt;/span&gt;&lt;/code&gt; we replaced:&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;$http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phones/phones.json&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  $scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phones &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
with:&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;$scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phones &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
This is a simple statement that we want to query for all phones.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
An important thing to notice in the code above is that we don&#39;t pass any callback functions when
invoking methods of our Phone service. Although it looks as if the result were returned
synchronously, that is not the case at all. What is returned synchronously is a &quot;future&quot; — an
object, which will be filled with data when the XHR response returns. Because of the data-binding
in Angular, we can use this future and bind it to our template. Then, when the data arrives, the
view will automatically update.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
Sometimes, relying on the future object and data-binding alone is not sufficient to do everything
we require, so in these cases, we can add a callback to process the server response. The
&lt;code&gt;&lt;span class=&quot;typ&quot;&gt;PhoneDetailCtrl&lt;/span&gt;&lt;/code&gt; controller illustrates this by setting the &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;mainImageUrl&lt;/span&gt;&lt;/code&gt; in a callback.&lt;/div&gt;
&lt;h2 class=&quot;ng-scope&quot; id=&quot;test&quot;&gt;
Test&lt;/h2&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
Because we&#39;re now using the &lt;a href=&quot;https://docs.angularjs.org/api/ngResource&quot;&gt;ngResource&lt;/a&gt; module, it&#39;s necessary to
update the Karma config file with angular-resource so the new tests will pass.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
&lt;strong&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;karma&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt;:&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code class=&quot;lang-js&quot;&gt;&lt;span class=&quot;pln&quot;&gt;files &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;app/bower_components/angular/angular.js&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;app/bower_components/angular-route/angular-route.js&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;app/bower_components/angular-resource/angular-resource.js&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;app/bower_components/angular-mocks/angular-mocks.js&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;app/js/**/*.js&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;test/unit/**/*.js&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
We have modified our unit tests to verify that our new service is issuing HTTP requests and
processing them as expected. The tests also check that our controllers are interacting with the
service correctly.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
The &lt;a href=&quot;https://docs.angularjs.org/api/ngResource/service/$resource&quot;&gt;$resource&lt;/a&gt; service augments the response object
with methods for updating and deleting the resource. If we were to use the standard &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;toEqual&lt;/span&gt;&lt;/code&gt;
matcher, our tests would fail because the test values would not match the responses exactly. To
solve the problem, we use a newly-defined &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;toEqualData&lt;/span&gt;&lt;/code&gt; &lt;a href=&quot;http://jasmine.github.io/1.3/introduction.html#section-Matchers&quot;&gt;Jasmine matcher&lt;/a&gt;. When
the &lt;code&gt;&lt;span class=&quot;pln&quot;&gt;toEqualData&lt;/span&gt;&lt;/code&gt; matcher compares two objects, it takes only object properties into account and
ignores methods.&lt;/div&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
&lt;strong&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;controllersSpec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;/code&gt;:&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;&lt;code class=&quot;lang-js&quot;&gt;&lt;span class=&quot;pln&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneCat controllers&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

  beforeEach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addMatchers&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      toEqualData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;expected&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; angular&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;equals&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;actual&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; expected&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

  beforeEach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatApp&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  beforeEach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonecatServices&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;


  describe&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneListCtrl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ctrl&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $httpBackend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

    beforeEach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;inject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;_$httpBackend_&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $rootScope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $controller&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $httpBackend &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _$httpBackend_&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $httpBackend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;expectGET&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phones/phones.json&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
          respond&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;([{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Nexus S&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Motorola DROID&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

      scope &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $rootScope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$new&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      ctrl &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $controller&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneListCtrl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;


    it&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;should create &quot;phones&quot; model with 2 phones fetched from xhr&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      expect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toEqualData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;([]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $httpBackend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;flush&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

      expect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toEqualData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Nexus S&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Motorola DROID&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;


    it&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;should set the default value of orderProp model&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      expect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderProp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toBe&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;age&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;


  describe&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneDetailCtrl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $httpBackend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ctrl&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        xyzPhoneData &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phone xyz&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            images&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;image/url1.png&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;image/url2.png&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;


    beforeEach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;inject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;_$httpBackend_&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $rootScope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $routeParams&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $controller&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $httpBackend &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _$httpBackend_&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $httpBackend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;expectGET&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phones/xyz.json&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;respond&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;xyzPhoneData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

      $routeParams&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phoneId &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;xyz&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      scope &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $rootScope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$new&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      ctrl &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $controller&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;PhoneDetailCtrl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;


    it&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;should fetch phone detail&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      expect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toEqualData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $httpBackend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;flush&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

      expect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toEqualData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;xyzPhoneData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;ng-scope&quot;&gt;
You should now see the following output in the Karma tab:&lt;/div&gt;
&lt;pre class=&quot;ng-scope&quot;&gt;Chrome 22.0: Executed 5 of 5 SUCCESS (0.038 secs / 0.01 secs)&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/4815822315469526872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/angularjs-rest-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/4815822315469526872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/4815822315469526872'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/angularjs-rest-services.html' title='AngularJS - REST Services'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-6984820146161262960</id><published>2015-06-18T22:37:00.001+05:30</published><updated>2015-06-21T20:33:32.706+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Restful"/><category scheme="http://www.blogger.com/atom/ns#" term="Springs"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Securing REST Services with Spring Security and OAuth2 </title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://cdn2.hubspot.net/hub/408015/file-2669306584-jpg/blog-files/590x230xspring-oauth2-wso2-yenlo.png,q273d98.pagespeed.ic.n79hqyhrfs.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://cdn2.hubspot.net/hub/408015/file-2669306584-jpg/blog-files/590x230xspring-oauth2-wso2-yenlo.png,q273d98.pagespeed.ic.n79hqyhrfs.jpg&quot; height=&quot;77&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
This post will walk through setting up an OAuth2 provider service for 
protecting access to REST resources. The code is available in github. 
You can fork the code and start writing services that will be protected 
by OAuth access. This is a separate module but builds on services 
covered in a previous &lt;a href=&quot;http://porterhead.blogspot.co.uk/2013/01/writing-rest-services-in-java-part-1.html&quot; target=&quot;_blank&quot;&gt;series&lt;/a&gt; that includes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
* &lt;a href=&quot;http://porterhead.blogspot.co.uk/2013/01/writing-rest-services-in-java-part-2.html&quot;&gt;User Registration and Login &lt;/a&gt;&lt;br /&gt;
* &lt;a href=&quot;http://porterhead.blogspot.co.uk/2013/01/writing-rest-services-in-java-part-3.html&quot;&gt;Email Verification&lt;/a&gt; &lt;br /&gt;
* &lt;a href=&quot;http://porterhead.blogspot.co.uk/2013/01/writing-rest-services-in-java-part-5.html&quot;&gt;Lost Password&lt;/a&gt; &lt;br /&gt;
* &lt;a href=&quot;http://porterhead.blogspot.co.uk/2013/05/writing-rest-services-in-java-part-8.html&quot;&gt;JSR 303 Validation&lt;/a&gt; &lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
It would be useful but not required to be familiar with some of the technologies covered such as:&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;code2&quot;&gt;
* OAuth2 Protocol &lt;br /&gt;
* Spring Security &lt;br /&gt;
* Spring Integration &lt;br /&gt;
* Spring Data &lt;br /&gt;
* Jersey/JAX-RS &lt;br /&gt;
* Gradle / Groovy &lt;br /&gt;
* MongoDB &lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;
Resource Owner Password Flow&lt;/h4&gt;
&lt;div&gt;
Subsequent posts will deal with the other types of authorization flow, 
such as using third party providers (Facebook, Google, etc). The intent 
of this post is a walk through of the Resource Owner Password flow. This
 is a typical use case if you are the system of record for user 
credentials and trust client applications. It is simply the exchange of 
the user&#39;s username and password for an access token. This token can 
then be used on subsequent requests to authorize access to resources. It
 is also important to support token expiration and by extension token 
refresh.
&lt;br /&gt;&lt;br /&gt;
Let&#39;s test out the code and then I&#39;ll walk through the application and explain how it is built&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;h4&gt;
Building the project&lt;/h4&gt;
&lt;div&gt;
&lt;br /&gt;
Check out the source code&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; git clone&amp;nbsp; git@github.com:iainporter/oauth2-provider.git
&lt;br /&gt;
&lt;br /&gt;
&amp;gt; cd oauth2-provider

&lt;br /&gt;&lt;br /&gt;
&amp;gt; ./gradlew clean build integrationTest&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Running the Web Application&lt;/h4&gt;
&lt;div&gt;
&lt;br /&gt;
The application uses MongoDB as the persistence store. Before running 
the application ensure that mongod is running on port 27017. If you 
don&#39;t have mongo installed get it &lt;a href=&quot;http://www.mongodb.org/&quot;&gt;here&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;
Once mongoDB is installed and running fire up the web application using the following command&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; ./gradlew tomcatRun
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
To try it out you can open a browser window and navigate to &lt;a href=&quot;http://localhost:8080/oauth2-provider/index.html&quot;&gt;http://localhost:8080/oauth2-provider/index.html&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;h4&gt;
Testing with Curl&lt;/h4&gt;
&lt;br /&gt;
To create a user:&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; curl -v -X POST \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;  -H &quot;Content-Type: application/json&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;  -H &quot;Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;  -d &#39;{&quot;user&quot;:{&quot;emailAddress&quot;:&quot;user@example.com&quot;}, &quot;password&quot;:&quot;password&quot;}&#39; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;  &#39;http://localhost:8080/oauth2-provider/v1.0/users&#39;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
The result:&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
{&quot;apiUser&quot;:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;  {&quot;emailAddress&quot;:&quot;user@example.com&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   &quot;firstName&quot;:null,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   &quot;lastName&quot;:null,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   &quot;age&quot;:null,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   &quot;id&quot;:&quot;8a34d009-3558-4c8c-a8da-1ad2b2a393c7&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   &quot;name&quot;:&quot;user@example.com&quot;},&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   &quot;oauth2AccessToken&quot;:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   {&quot;access_token&quot;:&quot;7e0e4708-7837-4a7e-9f87-81c6429b02ac&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;    &quot;token_type&quot;:&quot;bearer&quot;, &lt;br /&gt;
&amp;nbsp;&amp;nbsp;    &quot;refresh_token&quot;:&quot;d0f248ab-e30f-4a85-860c-bd1e388a39b5&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;    &quot;expires_in&quot;:5183999,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;    &quot;scope&quot;:&quot;read write&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;   }&lt;br /&gt;
}
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;div&gt;
Requesting an access token: &lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; curl -v -X POST \&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -H &quot;Content-Type: application/json&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -H &quot;Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;http://localhost:8080/oauth2-provider/oauth/token?grant_type=password&amp;amp;username=user@example.com&amp;amp;password=password&#39;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
The result:&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;code2&quot;&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&quot;access_token&quot;:&quot;a838780e-35ef-4bd5-92c0-07a45aa74948&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&quot;token_type&quot;:&quot;bearer&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&quot;refresh_token&quot;:&quot;ab06022f-247c-450a-a11e-2ffab116e3dc&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&quot;expires_in&quot;:5183999&lt;br /&gt;
}
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
Refreshing a token: &lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; curl -v -X POST \&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -H &quot;Content-Type: application/json&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -H &quot;Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 
&#39;http://localhost:8080/oauth2-provider/oauth/token?grant_type=refresh_token&amp;amp;refresh_token=ab06022f-247c-450a-a11e-2ffab116e3dc&#39;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
The result:&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;code2&quot;&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &quot;access_token&quot;:&quot;4835cd11-8bb7-4b76-b857-55c6e7f36fc4&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &quot;token_type&quot;:&quot;bearer&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &quot;refresh_token&quot;:&quot;ab06022f-247c-450a-a11e-2ffab116e3dc&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &quot;expires_in&quot;:5183999&lt;br /&gt;
}
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
That&#39;s all that is needed to support registration of Users and managing 
tokens on their behalf. The source code also contains everything needed 
to support lost password and email verification. See previous &lt;a href=&quot;http://porterhead.blogspot.co.uk/2013/01/writing-rest-services-in-java-part-1.html&quot; target=&quot;_blank&quot;&gt;posts&lt;/a&gt; for how to set it up.&lt;br /&gt;&lt;br /&gt;
 In a typical deployment the authorization server and the resource 
server(s) would be separate, but for the purposes of this tutorial they 
are managed within the same application.&lt;br /&gt;
Let&#39;s delve into the details:&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;h4&gt;
Web Context&lt;/h4&gt;
&lt;br /&gt;
There are two servlets. &lt;br /&gt;&lt;br /&gt;
A Jersey servlet as the default to handle all resource calls:&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-mapping&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;jersey-servlet&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;/*&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-mapping&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
A Spring servlet to handle all oauth calls:&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-mapping&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;spring&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;/oauth/*&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;servlet-mapping&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
Wire in spring security by defining a filter:&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;springSecurityFilterChain&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-class&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-class&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;init-param&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;param-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;contextAttribute&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;param-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;param-value&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;param-value&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;init-param&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
and then map it to the root context so all calls are filtered:&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-mapping&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;springSecurityFilterChain&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;/*&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;url-pattern&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;filter-mapping&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;h4&gt;
Configuring OAuth flows to support&lt;/h4&gt;
&lt;br /&gt;

&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:authorization-server&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;client-details-service-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;client-details-service&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;token-services-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenServices&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:refresh-token&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:password&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:authorization-server&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
In this scenario only password flow and refresh token are being supported. The default token endpoint is /oauth/token.
&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Protecting the token endpoint&lt;/h4&gt;
&lt;br /&gt;
It is a good idea to protect access to token requests to only those 
client applications that you know about. Using Spring security we can 
set up basic authentication on calls to the token endpoint:
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;http&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;pattern&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;/oauth/token&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;create-session&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;stateless&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;authentication-manager-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;clientAuthenticationManager&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;xmlns&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;http://www.springframework.org/schema/security&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;anonymous&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;enabled&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;http-basic&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;entry-point-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;clientAuthenticationEntryPoint&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;access-denied-handler&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;oauthAccessDeniedHandler&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
Next we configure the authentication manager and client details service&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;clientCredentialsTokenEndpointFilter&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;property&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;name&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;authenticationManager&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;clientAuthenticationManager&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;authentication-manager&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;clientAuthenticationManager&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;xmlns&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;http://www.springframework.org/schema/security&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;authentication-provider&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;user-service-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;client-details-user-service&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;authentication-manager&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;client-details-user-service&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;constructor-arg&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;client-details-service&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Depending on how many clients we expect to access the service will 
determine what type of client details service we implement. A simple 
file-based service might be sufficient. If you wanted to go a lot 
further with client sign up and managing API keys then you would have to
 involve a persistence tier for the client details service. Configuring 
with the default Spring file-based service is trivial:
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:client-details-service&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;client-details-service&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comments&quot;&gt;&amp;lt;!--&amp;nbsp;Allow&amp;nbsp;access&amp;nbsp;to&amp;nbsp;test&amp;nbsp;clients&amp;nbsp;--&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:client&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;client-id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;353b302c44574f565045687e534e7d6a&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;secret&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;286924697e615a672a646a493545646c&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorized-grant-types&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;password,refresh_token&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorities&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;ROLE_TEST&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;access-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.access.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;refresh-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.refresh.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comments&quot;&gt;&amp;lt;!--&amp;nbsp;Web&amp;nbsp;Application&amp;nbsp;clients&amp;nbsp;--&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:client&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;client-id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;7b5a38705d7b3562655925406a652e32&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;secret&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;655f523128212d6e70634446224c2a48&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorized-grant-types&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;password,refresh_token&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorities&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;ROLE_WEB&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;access-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.access.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;refresh-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.refresh.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comments&quot;&gt;&amp;lt;!--&amp;nbsp;iOS&amp;nbsp;clients&amp;nbsp;--&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:client&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;client-id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;5e572e694e4d61763b567059273a4d3d&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;secret&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;316457735c4055642744596b302e2151&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorized-grant-types&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;password,refresh_token&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorities&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;ROLE_IOS&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;access-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.access.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;refresh-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.refresh.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comments&quot;&gt;&amp;lt;!--&amp;nbsp;Android&amp;nbsp;clients&amp;nbsp;--&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:client&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;client-id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;302a7d556175264c7e5b326827497349&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;secret&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;4770414c283a20347c7b553650425773&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorized-grant-types&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;password,refresh_token&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;authorities&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;ROLE_ANDROID&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;access-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.access.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;refresh-token-validity&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;${oauth.token.refresh.expiresInSeconds}&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:client-details-service&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Accessing the oauth endpoint now requires a basic authentication header 
with the client id and secret concatenated with a &quot;:&quot; separator and 
base64 encoded. &lt;br /&gt;
e.g. -H &quot;Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=&quot;
&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Configuring User Authentication Services&lt;/h4&gt;
&lt;br /&gt;
&lt;div&gt;
The Resource Owner Password flow requires an authentication manager for managing users.
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;passwordEncoder&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.crypto.password.StandardPasswordEncoder&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sec:authentication-manager&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;alias&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;userAuthenticationManager&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sec:authentication-provider&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;user-service-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;userService&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sec:password-encoder&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;passwordEncoder&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sec:authentication-provider&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sec:authentication-manager&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
The password encoder is used to encrypt the password on authentication. 
The user service also uses the same encoder to encrypt passwords before 
persisting them.&lt;br /&gt;
The user service must implement UserDetailsService and retrieve the user by username.&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-j&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;annotation&quot;&gt;@Override&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;nbsp;UserDetails&amp;nbsp;loadUserByUsername(String&amp;nbsp;username)&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;throws&lt;/span&gt;&lt;span&gt;&amp;nbsp;UsernameNotFoundException&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;notNull(username,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;&quot;Mandatory&amp;nbsp;argument&amp;nbsp;&#39;username&#39;&amp;nbsp;missing.&quot;&lt;/span&gt;&lt;span&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;User&amp;nbsp;user&amp;nbsp;=&amp;nbsp;userRepository.findByEmailAddress(username.toLowerCase());&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt;&amp;nbsp;(user&amp;nbsp;==&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;&lt;span&gt;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;throw&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;nbsp;AuthenticationException();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;nbsp;user;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Configuring Token Services&lt;/h4&gt;
&lt;br /&gt;
&lt;div&gt;
The final piece of configuration is to manage storage and retrieval of access tokens.
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenServices&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.oauth2.provider.token.DefaultTokenServices&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;property&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;name&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenStore&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenStore&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;property&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;name&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;supportRefreshToken&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;value&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;property&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;name&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;clientDetailsService&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;client-details-service&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
 Spring has a handy in-memory implementation that is useful when testing:
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenStore&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.oauth2.provider.token.InMemoryTokenStore&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
For this tutorial I have chosen MongoDB as the persistence technology, 
but it would be easy to wire in an alternative such as MySql or Redis It
 is a matter of implementing 
org.springframework.security.oauth2.provider.token.TokenStore
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenStore&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;com.porterhead.oauth2.mongodb.OAuth2RepositoryTokenStore&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;constructor-arg&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;OAuth2AccessTokenRepository&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;constructor-arg&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;OAuth2RefreshTokenRepository&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Protecting access to resources&lt;/h4&gt;
&lt;br /&gt;
&lt;div&gt;
First we need to configure a spring resource server filter. This will 
check that there is a valid access token in the request header.
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;oauth:resource-server&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;resourceServerFilter&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;token-services-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;tokenServices&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Spring security has some useful classes for fine-grain control of roles 
and permissions.  I prefer to use JSR-250 annotations. Luckily it is 
easy to wire this in. First we need to enable JSR-250 annotations with 
the following configuration: 
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sec:global-method-security&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;jsr250-annotations&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;enabled&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;access-decision-manager-ref&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;accessDecisionManager&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Configure an access manager that uses the Jsr250Voter
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;accessDecisionManager&quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.access.vote.UnanimousBased&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;property&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;name&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;decisionVoters&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;org.springframework.security.access.annotation.Jsr250Voter&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;bean&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Now we can protect REST resource methods with JSR-250 annotations such as @RolesAllowed
&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Trying it out&lt;/h4&gt;
&lt;br /&gt;
Typically the glue between the OAuth server and the application is a 
user identifier. When a client gets an access token for a user the next 
step is to typically load data related to that user. This will usually 
involve building a url with the userId as part of the path&lt;br /&gt;
i.e. /v1.0/users/{id}/someresource 
&lt;br /&gt;
A useful service to provide is a way to get user information based on 
the access token. The application can identify the user that owns the 
token and return information on that user to the client.
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://porterhead.blogspot.in/2014/05/securing-rest-services-with-spring.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-j&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;annotation&quot;&gt;@Path&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;/v1.0/me&quot;&lt;/span&gt;&lt;span&gt;)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;annotation&quot;&gt;@Component&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;annotation&quot;&gt;@Produces&lt;/span&gt;&lt;span&gt;({MediaType.APPLICATION_JSON})&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;annotation&quot;&gt;@Consumes&lt;/span&gt;&lt;span&gt;({MediaType.APPLICATION_JSON})&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span&gt;&amp;nbsp;MeResource&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;extends&lt;/span&gt;&lt;span&gt;&amp;nbsp;BaseResource&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;annotation&quot;&gt;@RolesAllowed&lt;/span&gt;&lt;span&gt;({&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;ROLE_USER&quot;&lt;/span&gt;&lt;span&gt;})&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;annotation&quot;&gt;@GET&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;nbsp;ApiUser&amp;nbsp;getUser(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;final&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;annotation&quot;&gt;@Context&lt;/span&gt;&lt;span&gt;&amp;nbsp;SecurityContext&amp;nbsp;securityContext)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;User&amp;nbsp;requestingUser&amp;nbsp;=&amp;nbsp;loadUserFromSecurityContext(securityContext);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt;(requestingUser&amp;nbsp;==&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;&lt;span&gt;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;throw&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;nbsp;UserNotFoundException();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;nbsp;ApiUser(requestingUser);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;&lt;span&gt;&amp;nbsp;User&amp;nbsp;loadUserFromSecurityContext(SecurityContext&amp;nbsp;securityContext)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OAuth2Authentication&amp;nbsp;requestingUser&amp;nbsp;=&amp;nbsp;(OAuth2Authentication)&amp;nbsp;securityContext.getUserPrincipal();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Object&amp;nbsp;principal&amp;nbsp;=&amp;nbsp;requestingUser.getUserAuthentication().getPrincipal();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;User&amp;nbsp;user&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;&lt;span&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt;(principal&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;instanceof&lt;/span&gt;&lt;span&gt;&amp;nbsp;User)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;user&amp;nbsp;=&amp;nbsp;(User)principal;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;user&amp;nbsp;=&amp;nbsp;userRepository.findByEmailAddress((String)principal);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;nbsp;user;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span&gt;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
To test this out start up the application:
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; ./gradlew tomcatRun
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
Execute the following curl statement, substituting the access token that was returned from the login curl above&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;code2&quot;&gt;
&amp;gt; curl -v -X GET \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;-H &quot;Content-Type: application/json&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;-H &quot;Authorization: Bearer [your token here]&quot; \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&#39;http://localhost:8080/oauth2-provider/v1.0/me&#39;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/6984820146161262960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/securing-rest-services-with-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/6984820146161262960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/6984820146161262960'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/securing-rest-services-with-spring.html' title='Securing REST Services with Spring Security and OAuth2 '/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-726387212549849671</id><published>2015-06-18T22:30:00.001+05:30</published><updated>2015-06-18T22:39:46.218+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Using OAuth 2.0 to Access Google APIs</title><content type='html'>&lt;section&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://oauth.net/images/oauth-2-sm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://oauth.net/images/oauth-2-sm.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Google APIs use the &lt;a href=&quot;http://tools.ietf.org/html/rfc6749&quot;&gt;OAuth 2.0
protocol&lt;/a&gt; for authentication and authorization. Google supports common OAuth 2.0
scenarios such as those for web server, installed, and client-side applications.&lt;br /&gt;



To begin, obtain OAuth 2.0 client credentials from the &lt;a href=&quot;https://console.developers.google.com/&quot; target=&quot;_blank&quot;&gt;Google Developers Console&lt;/a&gt;. Then your client application
requests an access token from the Google
Authorization Server, extracts a token from the response, and sends the token to the
Google API that you want to access. For an interactive demonstration of using
OAuth 2.0 with Google (including the option to use your own client credentials),
experiment with the &lt;a href=&quot;https://developers.google.com/oauthplayground/&quot;&gt;OAuth 2.0 Playground&lt;/a&gt;.&lt;br /&gt;



This page gives an overview of the OAuth 2.0 authorization scenarios that Google supports,
and provides links to more detailed content. For details about using OAuth 2.0 for
authentication, see &lt;a href=&quot;https://developers.google.com/identity/protocols/OpenIDConnect&quot;&gt;OpenID Connect&lt;/a&gt;.
&lt;br /&gt;


&lt;aside class=&quot;note&quot;&gt;&lt;b&gt;Note:&lt;/b&gt;
Given the security implications of getting the implementation correct, we strongly encourage you to use OAuth 2.0 libraries when
interacting with Google&#39;s OAuth 2.0 endpoints. It is a best practice to use well-debugged code
provided by others, and it will help you protect yourself and your users. For more information,
see &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2#libraries&quot;&gt;Client libraries&lt;/a&gt;.
&lt;/aside&gt;
&lt;/section&gt;

&lt;section&gt;
&lt;h2&gt;
Contents&lt;/h2&gt;
&lt;/section&gt;

&lt;section&gt;
&lt;h2 id=&quot;basicsteps&quot;&gt;
Basic steps&lt;/h2&gt;
All applications follow a basic pattern when accessing a Google API using OAuth 2.0. At a high level, you follow four steps:
        &lt;br /&gt;
&lt;h4&gt;
1. Obtain OAuth 2.0 credentials from the Google Developers Console.&lt;/h4&gt;
Visit the
&lt;a href=&quot;https://console.developers.google.com/&quot; target=&quot;_blank&quot;&gt;Google Developers Console&lt;/a&gt;
            to obtain OAuth 2.0 credentials such as a client ID
and client secret that are known to both Google and your application. The set of values varies
based on what type of application you are building. For example, a JavaScript application does not require a secret, but
            a web server application does.
        &lt;br /&gt;

        &lt;h4&gt;
2. Obtain an access token from the Google Authorization Server.&lt;/h4&gt;
Before your application can access private data using a Google
 API, it must obtain an access token that grants access to that API.
          A single access token can grant varying degrees of access to 
multiple APIs. A variable parameter
          called &lt;code&gt;scope&lt;/code&gt; controls the set of resources and operations that an access token
          permits. During the access-token request, your application sends one or more values in
the &lt;code&gt;scope&lt;/code&gt; parameter.
        &lt;br /&gt;

        
           There are several ways to make this request, and they vary 
based on the type of application you are building. For example, a 
JavaScript application
           might request an access token using a browser redirect to 
Google, while an application installed on a device that has no browser 
uses web service requests.
        &lt;br /&gt;

        
           Some requests require an authentication step where the user logs in with their Google
account. After logging in, the user is asked
           whether they are willing to grant the permissions that your application is requesting.
           This process is called &lt;dfn&gt;user consent&lt;/dfn&gt;.
        &lt;br /&gt;

        
           If the user grants the permission, the Google Authorization Server
sends your application an access token (or an authorization code that your application can use to obtain an access token).
           If the user does not grant the permission, the server returns an error.
        &lt;br /&gt;

 




It is generally a best practice to request scopes incrementally, at the 
time access is required, rather than up front. For example, an app that 
wants to support purchases should not request Google Wallet access until
 the user presses the “buy” button; see &lt;a href=&quot;https://developers.google.com/accounts/docs/OAuth2WebServer#incrementalAuth&quot;&gt;Incremental authorization&lt;/a&gt;.



 &lt;br /&gt;

        &lt;h4&gt;
3. Send the access token to an API.&lt;/h4&gt;
After an application obtains an access token, it sends the token to a Google
API in an HTTP authorization header. It is possible to send tokens as URI query-string parameters,
but we don&#39;t recommend it, because URI parameters can end up in log files that are not completely
secure. Also, it is good REST practice
to avoid creating unnecessary URI parameter names.&lt;br /&gt;

 Access tokens are valid only for the set of
          operations and resources described in the &lt;code&gt;scope&lt;/code&gt; 
of the token request. For example, if an access token is issued for the 
Google+ API, it does not grant access
          to the Google Contacts API. You can, however, send that access
 token to the Google+ API multiple times for similar operations.

        &lt;br /&gt;

        &lt;h4&gt;
4. Refresh the access token, if necessary.&lt;/h4&gt;
Access tokens have limited lifetimes. If your application 
needs access to a Google API beyond the lifetime of a single access 
token,
            it can obtain a refresh token. A
refresh token allows your application to obtain new access tokens.
        &lt;br /&gt;

        &lt;aside class=&quot;note&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;
          Save refresh tokens in secure long-term storage and continue to use them as long as they
remain valid. Limits apply to the number of refresh tokens that are issued per client-user
combination, and per user across all clients, and these limits are different. If your application
requests enough refresh tokens to go over one of the limits, older refresh tokens stop working.
&lt;/aside&gt;
&lt;/section&gt;

&lt;section&gt;
  &lt;h2 id=&quot;scenarios&quot;&gt;
Scenarios&lt;/h2&gt;
&lt;h3 id=&quot;webserver&quot;&gt;
Web server applications&lt;/h3&gt;
The Google OAuth 2.0 endpoint supports web server applications that use languages and frameworks
such as PHP, Java, Python, Ruby, and ASP.NET.&lt;br /&gt;


The authorization sequence begins when your application redirects
a browser to a Google URL; the URL includes query parameters that indicate the type of access
being requested. Google handles the user authentication, session selection, and user consent.
The result is an authorization code, which the application can exchange for
an access token and a refresh token.
&lt;br /&gt;



The application should store the refresh token for
future use and use the access token to access a Google API. Once the access token expires, the
application uses the refresh token to obtain a new one.
&lt;br /&gt;


&lt;figure id=&quot;fig1&quot;&gt;
&lt;img alt=&quot;Your application sends a token request to the Google Authorization Server, receives an authorization code,
exchanges the code for a token, and uses the token to call a Google API endpoint.&quot; height=&quot;377px&quot; src=&quot;https://developers.google.com/accounts/images/webflow.png&quot; width=&quot;364px&quot; /&gt;
&lt;/figure&gt;


For details, see &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2WebServer&quot;&gt;Using OAuth 2.0 for Web Server Applications&lt;/a&gt;.
&lt;br /&gt;


&lt;h3 id=&quot;installed&quot;&gt;
Installed applications&lt;/h3&gt;
The Google OAuth 2.0 endpoint supports applications that are installed on devices such as computers,
mobile devices, and tablets. When you create a client ID through the
&lt;a href=&quot;https://console.developers.google.com/&quot; target=&quot;_blank&quot;&gt;Google Developers Console&lt;/a&gt;, specify that this is an Installed application,
then select Android, Chrome, iOS, or &quot;Other&quot; as the
application type.&lt;br /&gt;


The process results in a client ID and, in some cases, a client secret,
which you embed in the source code of your application. (In this context, the client secret
is obviously not treated as a secret.)
&lt;br /&gt;

The authorization sequence begins when your application redirects
a browser to a Google URL; the URL includes query parameters that indicate the type of access
being requested. Google handles the user authentication, session selection, and user consent.
The result is an authorization code, which the application can exchange for
an access token and a refresh token.
&lt;br /&gt;



The application should store the refresh token for
future use and use the access token to access a Google API. Once the access token expires, the
application uses the refresh token to obtain a new one.
&lt;br /&gt;

&lt;figure id=&quot;fig1&quot;&gt;
&lt;img alt=&quot;Your application sends a token request to the Google Authorization Server, receives an authorization code,
exchanges the code for a token, and uses the token to call a Google API endpoint.&quot; height=&quot;377px&quot; src=&quot;https://developers.google.com/accounts/images/webflow.png&quot; width=&quot;364px&quot; /&gt;
&lt;/figure&gt;

For details, see &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2InstalledApp&quot;&gt;Using OAuth 2.0 for Installed Applications&lt;/a&gt;.
&lt;br /&gt;


&lt;h3 id=&quot;clientside&quot;&gt;
Client-side (JavaScript) applications&lt;/h3&gt;
The Google OAuth 2.0 endpoint supports JavaScript applications that run in a browser.
&lt;br /&gt;


The authorization sequence begins when your application redirects a browser to a Google URL; the URL
includes query parameters that indicate the type of access
being requested. Google handles the user authentication, session selection, and user consent.
&lt;br /&gt;

The result is an access token, which the client should validate before including it in a Google
API request. When the token expires, the application repeats the process.
&lt;br /&gt;


&lt;figure id=&quot;fig2&quot;&gt;
&lt;img alt=&quot;Your JS application sends a token request to the Google Authorization Server, receives a token,
validates the token, and uses the token to call a Google API endpoint.&quot; height=&quot;377px&quot; src=&quot;https://developers.google.com/accounts/images/tokenflow.png&quot; width=&quot;364px&quot; /&gt;
&lt;/figure&gt;


For details, see &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2UserAgent&quot;&gt;Using OAuth 2.0 for Client-side Applications&lt;/a&gt;.
&lt;br /&gt;


&lt;h3 id=&quot;device&quot;&gt;
Applications on limited-input devices&lt;/h3&gt;
The Google OAuth 2.0 endpoint supports applications that run on limited-input devices
such as game consoles, video cameras, and printers. &lt;br /&gt;

The authorization sequence begins with the application making
a web service request to a Google URL for an authorization code. The response contains several parameters, including a URL and
a code that the application shows to the user.
&lt;br /&gt;



The user obtains the URL and code from the device, then switches to a separate device or computer with
richer input capabilities. The user launches a browser, navigates to the specified URL, logs in, and enters the code.
&lt;br /&gt;


Meanwhile, the application polls a Google URL at a specified 
interval. After the user approves access,
the response from the Google server contains an access token and refresh
 token. The application should store the refresh token for
future use and use the access token to access a Google API. Once the 
access token expires, the
application uses the refresh token to obtain a new one.
&lt;br /&gt;


&lt;figure id=&quot;fig3&quot;&gt;
&lt;img alt=&quot;The user logs in on a separate device that has a browser.&quot; height=&quot;423px&quot; src=&quot;https://developers.google.com/accounts/images/deviceflow.png&quot; width=&quot;451px&quot; /&gt;
&lt;/figure&gt;

For details, see &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2ForDevices&quot;&gt;Using OAuth 2.0 for Devices&lt;/a&gt;.&lt;br /&gt;


&lt;h3 id=&quot;serviceaccount&quot;&gt;
Service accounts&lt;/h3&gt;
Google APIs such as the Prediction API and Google Cloud Storage can act on behalf of your application
without accessing user information. In these situations your application needs to
prove its own identity to the API, but no user consent is necessary. Similarly, in enterprise scenarios,
your application can request delegated access to some resources.
&lt;br /&gt;



  For these types of server-to-server interactions you need a &lt;b&gt;service account&lt;/b&gt;, which is an account that belongs to your
  application instead of to an individual end-user. Your application calls Google APIs on behalf of
  the service account, and user consent is not required. (In non-service-account scenarios, your
  application calls Google APIs on behalf of end-users, and user consent is sometimes required.)
&lt;br /&gt;


&lt;aside class=&quot;note&quot;&gt;
&lt;b&gt;Note:&lt;/b&gt; These service-account scenarios require applications to create and cryptographically sign JSON Web Tokens (JWTs).
We strongly encourage you to use a library to perform these tasks. If you write this code without using
a library that abstracts token creation and signing, you might make errors that would have a severe impact
on the security of your application. For a list of libraries that support this scenario, see the
&lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2ServiceAccount&quot;&gt;service-account documentation&lt;/a&gt;.
&lt;/aside&gt;


  A service account&#39;s credentials, which you obtain from the Google Developers Console,
  include a generated email address that is unique, a client ID, and at least one public/private key pair.
  You use the client ID and one private key to create a signed JWT and construct an access-token request
in the appropriate format. Your
application then sends the token request to the Google OAuth 2.0 Authorization Server, which returns an
access token. The application uses the token to access a Google API. When the token
expires, the application repeats the process.
&lt;br /&gt;


&lt;figure id=&quot;fig4&quot;&gt;
&lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2ServiceAccount&quot;&gt;&lt;img alt=&quot;Your server application uses a JWT to request a token from the Google Authorization Server,
then uses the token to call a Google API endpoint. No end-user is involved.&quot; height=&quot;302px&quot; src=&quot;https://developers.google.com/accounts/images/serviceaccount.png&quot; width=&quot;325px&quot; /&gt;&lt;/a&gt;
&lt;/figure&gt;


For details, see the &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2ServiceAccount&quot;&gt;service-account documentation&lt;/a&gt;.
&lt;br /&gt;

&lt;/section&gt;

  &lt;section&gt;
    &lt;h2 id=&quot;expiration&quot;&gt;
Token expiration&lt;/h2&gt;
You should write your code to anticipate the possibility that a granted token might no
      longer work. A token might stop working for one of these reasons:&lt;br /&gt;

    &lt;ul&gt;
&lt;li&gt;The user has revoked access.&lt;/li&gt;
&lt;li&gt;The token has not been used for six months.&lt;/li&gt;
&lt;li&gt;The user account has exceeded a certain number of token requests.&lt;/li&gt;
&lt;/ul&gt;
There is currently a 25-token limit per Google user account. If a user account has
      25 valid tokens, the next authentication request succeeds, but quietly invalidates the
        oldest outstanding token without any user-visible warning.&lt;br /&gt;

    If you need to authorize
      multiple programs, machines, or devices, one workaround is to limit the number of
      clients that you authorize per user account to 15 or 20. If you are a
      &lt;a href=&quot;https://support.google.com/a/&quot;&gt;Google Apps admin&lt;/a&gt;, you
      can create additional admin users and use them to authorize some of the clients.&lt;br /&gt;

  &lt;/section&gt;
&lt;section&gt;
&lt;h2 id=&quot;libraries&quot;&gt;
Client libraries&lt;/h2&gt;
The following client libraries integrate with popular frameworks, which makes implementing
OAuth 2.0 simpler. More features will be added to the libraries over time.&lt;br /&gt;

  &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/api-client-library/java/google-api-java-client/oauth2&quot;&gt;Google API Client Library for Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/api-client-library/python/guide/aaa_oauth&quot;&gt;Google API Client Library for Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth&quot;&gt;Google API Client Library for .NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/api-client-library/ruby/guide/aaa_oauth&quot;&gt;Google API Client Library for Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/api-client-library/php/guide/aaa_oauth2_web&quot;&gt;Google API Client Library for PHP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/api-client-library/javascript/features/authentication&quot;&gt;Google API Client Library for JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://code.google.com/p/gtm-oauth2/&quot;&gt;Google Toolbox for Mac OAuth 2.0 Controllers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;

  
  

  
        


        
      
  

          </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/726387212549849671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/using-oauth-20-to-access-google-apis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/726387212549849671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/726387212549849671'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/using-oauth-20-to-access-google-apis.html' title='Using OAuth 2.0 to Access Google APIs'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-1001443444587980091</id><published>2015-06-18T21:59:00.001+05:30</published><updated>2015-06-18T22:39:46.120+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Documentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Android :   Building a Flexible UI</title><content type='html'>&lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;When designing your application to support a wide range of screen sizes, you can reuse your
fragments in different layout configurations to optimize the user experience based on the available
screen space.&lt;br /&gt;


For example, on a handset device it might be appropriate to display just one fragment at a time
for a single-pane user interface.  Conversely, you may want to set fragments side-by-side on a
tablet which has a wider screen size to display more information to the user.&lt;br /&gt;


&lt;img alt=&quot;&quot; src=&quot;http://developer.android.com/images/training/basics/fragments-screen-mock.png&quot; /&gt;
&lt;div class=&quot;img-caption&quot;&gt;
&lt;strong&gt;Figure 1.&lt;/strong&gt; Two fragments, displayed in different
configurations for the same activity on different screen sizes. On a large screen, both fragments
fit side by side, but on a handset device, only one fragment fits at a time so the fragments must
replace each other as the user navigates.&lt;/div&gt;
The &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentManager.html&quot;&gt;FragmentManager&lt;/a&gt;&lt;/code&gt; class provides methods that allow you to add,
remove, and replace fragments to an activity at runtime in order to create a dynamic experience.&lt;br /&gt;




&lt;h2 id=&quot;AddAtRuntime&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Add a Fragment to an Activity at Runtime&lt;/h2&gt;
&lt;hr /&gt;
 

Rather than defining the fragments for an activity in the layout file—as shown in the
&lt;a href=&quot;http://developer.android.com/training/basics/fragments/creating.html&quot;&gt;previous lesson&lt;/a&gt; with the &lt;code&gt;&amp;lt;fragment&amp;gt;&lt;/code&gt; element—you can add
a fragment to the activity during the activity runtime. This is necessary
if you plan to change fragments during the life of the activity.&lt;br /&gt;


To perform a transaction such as add or 
remove a fragment, you must use the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentManager.html&quot;&gt;FragmentManager&lt;/a&gt;&lt;/code&gt; to create a
&lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html&quot;&gt;FragmentTransaction&lt;/a&gt;&lt;/code&gt;, which provides APIs to add, remove, replace,
and perform other fragment transactions.&lt;br /&gt;


If your activity allows the fragments to be removed and replaced, you should add the
initial fragment(s) to the activity during the activity&#39;s
&lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Activity.html#onCreate%28android.os.Bundle%29&quot;&gt;onCreate()&lt;/a&gt;&lt;/code&gt; method.&lt;br /&gt;


An important rule when dealing with fragments—especially when adding fragments at
runtime—is that your activity layout must include a container &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/view/View.html&quot;&gt;View&lt;/a&gt;&lt;/code&gt;
in which you can insert the fragment.&lt;br /&gt;


The following layout is an alternative to the layout shown in the &lt;a href=&quot;http://developer.android.com/training/basics/fragments/creating.html&quot;&gt;previous lesson&lt;/a&gt; that shows only one fragment at a time. In order to replace
one fragment with another, the activity&#39;s layout
includes an empty &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/widget/FrameLayout.html&quot;&gt;FrameLayout&lt;/a&gt;&lt;/code&gt; that acts as the fragment container.&lt;br /&gt;


Notice that the filename is the same as the layout file in the previous lesson, but the layout
directory does &lt;em&gt;not&lt;/em&gt; have the &lt;code&gt;large&lt;/code&gt; qualifier, so this layout is used when the
device screen is smaller than &lt;em&gt;large&lt;/em&gt; because the screen does not fit both fragments at
the same time.&lt;br /&gt;


&lt;code&gt;res/layout/news_articles.xml:&lt;/code&gt;&lt;br /&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;FrameLayout&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@+id/fragment_container&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
Inside your activity, call &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html#getSupportFragmentManager%28%29&quot;&gt;getSupportFragmentManager()&lt;/a&gt;&lt;/code&gt; to get a &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentManager.html&quot;&gt;FragmentManager&lt;/a&gt;&lt;/code&gt; using the Support Library APIs. Then call &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentManager.html#beginTransaction%28%29&quot;&gt;beginTransaction()&lt;/a&gt;&lt;/code&gt; to create a &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html&quot;&gt;FragmentTransaction&lt;/a&gt;&lt;/code&gt; and call &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#add%28android.support.v4.app.Fragment,%20java.lang.String%29&quot;&gt;add()&lt;/a&gt;&lt;/code&gt; to add a fragment.&lt;br /&gt;


You can perform multiple fragment transaction for the activity using the same &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html&quot;&gt;FragmentTransaction&lt;/a&gt;&lt;/code&gt;. When you&#39;re ready to make the changes, you must call
&lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#commit%28%29&quot;&gt;commit()&lt;/a&gt;&lt;/code&gt;.&lt;br /&gt;


For example, here&#39;s how to add a fragment to the previous layout:&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;support&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;v4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;FragmentActivity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MainActivity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;FragmentActivity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;news_articles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Check that the activity is using the layout version with&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// the fragment_container FrameLayout&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;findViewById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fragment_container&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// However, if we&#39;re being restored from a previous state,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// then we don&#39;t need to do anything and should return or else&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// we could end up with overlapping fragments.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;savedInstanceState &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Create a new Fragment to be placed in the activity layout&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;HeadlinesFragment&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firstFragment &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;HeadlinesFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// In case this activity was started with special instructions from an&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Intent, pass the Intent&#39;s extras to the fragment as arguments&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; firstFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setArguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getIntent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getExtras&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Add the fragment to the &#39;fragment_container&#39; FrameLayout&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getSupportFragmentManager&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;beginTransaction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fragment_container&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firstFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
Because the fragment has been added to the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/widget/FrameLayout.html&quot;&gt;FrameLayout&lt;/a&gt;&lt;/code&gt; container at
runtime—instead of defining it in the activity&#39;s layout with a &lt;code&gt;&amp;lt;fragment&amp;gt;&lt;/code&gt;
element—the activity can remove the fragment and replace it with a different one.&lt;br /&gt;




&lt;h2 id=&quot;Replace&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Replace One Fragment with Another&lt;/h2&gt;
&lt;hr /&gt;

The procedure to replace a fragment is similar to adding one, but requires the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#replace%28int,%20android.support.v4.app.Fragment%29&quot;&gt;replace()&lt;/a&gt;&lt;/code&gt; method instead of &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#add%28android.support.v4.app.Fragment,%20java.lang.String%29&quot;&gt;add()&lt;/a&gt;&lt;/code&gt;.&lt;br /&gt;


Keep in mind that when you perform fragment transactions, such as replace or remove one, it&#39;s
often appropriate to allow the user to navigate backward and &quot;undo&quot; the change. To allow the user
to navigate backward through the fragment transactions, you must call &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#addToBackStack%28java.lang.String%29&quot;&gt;addToBackStack()&lt;/a&gt;&lt;/code&gt; before you commit the
&lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html&quot;&gt;FragmentTransaction&lt;/a&gt;&lt;/code&gt;.&lt;br /&gt;


&lt;div class=&quot;note&quot;&gt;
&lt;strong&gt;Note:&lt;/strong&gt; When you remove or replace a fragment and add the transaction
to the back stack, the fragment that is removed is stopped (not destroyed). If the user navigates
back to restore the fragment, it restarts. If you &lt;em&gt;do not&lt;/em&gt; add the transaction to the back
stack, then the fragment is destroyed when removed or replaced.&lt;/div&gt;
Example of replacing one fragment with another:&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;com&quot;&gt;// Create fragment and give it an argument specifying the article it should show&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ArticleFragment&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newFragment &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ArticleFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; args &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
args&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;putInt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ArticleFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ARG_POSITION&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; position&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
newFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setArguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;FragmentTransaction&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; transaction &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; getSupportFragmentManager&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;beginTransaction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Replace whatever is in the fragment_container view with this fragment,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// and add the transaction to the back stack so the user can navigate back&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
transaction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fragment_container&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newFragment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
transaction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addToBackStack&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Commit the transaction&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
transaction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;
The &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#addToBackStack%28java.lang.String%29&quot;&gt;addToBackStack()&lt;/a&gt;&lt;/code&gt; method
takes an optional string parameter that specifies a unique name for the transaction. The name isn&#39;t
needed unless you plan to perform advanced fragment operations using the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v4/app/FragmentManager.BackStackEntry.html&quot;&gt;FragmentManager.BackStackEntry&lt;/a&gt;&lt;/code&gt; APIs.</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/1001443444587980091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/android-building-flexible-ui.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/1001443444587980091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/1001443444587980091'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/android-building-flexible-ui.html' title='Android :   Building a Flexible UI'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-5674435640881483866</id><published>2015-06-18T21:55:00.002+05:30</published><updated>2015-06-18T22:39:46.175+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Documentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Adding Action Buttons</title><content type='html'>&lt;br /&gt;
The action bar allows you to add buttons for the most important action
items relating to the app&#39;s current
context. Those that appear directly in the action bar with an icon and/or text are known
as &lt;em&gt;action buttons&lt;/em&gt;. Actions that can&#39;t fit in the action bar or aren&#39;t
important enough are hidden in the action overflow.&lt;br /&gt;



&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-MbLERsZx4RtoomyAY7BkH-06yac8MqBBiE0QEZKezITQHZ-cEFoRl2E4TqPt-A6Ls6sjyuacg_5iIQkIb2I4mS6GZ2P3tCpsdL5yxHXoP0JPjFA7KPBL1AAoRx5QMrIwT29_6RolKyg/s1600/actionbar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-MbLERsZx4RtoomyAY7BkH-06yac8MqBBiE0QEZKezITQHZ-cEFoRl2E4TqPt-A6Ls6sjyuacg_5iIQkIb2I4mS6GZ2P3tCpsdL5yxHXoP0JPjFA7KPBL1AAoRx5QMrIwT29_6RolKyg/s320/actionbar.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;img-caption&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;img-caption&quot;&gt;
&lt;strong&gt;Figure 1.&lt;/strong&gt; An action bar with an action button
for Search and the action overflow, which reveals additional actions.


&lt;/div&gt;
&lt;h2 id=&quot;XML&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Specify the Actions in XML&lt;/h2&gt;
&lt;hr /&gt;

All action buttons and other items available in the action overflow are defined
in an XML &lt;a href=&quot;http://developer.android.com/guide/topics/resources/menu-resource.html&quot;&gt;menu resource&lt;/a&gt;. To add
actions to the action bar, create a new XML file in your project&#39;s
&lt;code&gt;res/menu/&lt;/code&gt; directory.&lt;br /&gt;


Add an &lt;code&gt;&amp;lt;item&amp;gt;&lt;/code&gt; element for each item you want to include in the action bar.
For example:&lt;br /&gt;


&lt;div class=&quot;code-caption&quot;&gt;
res/menu/main_activity_actions.xml&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;menu&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!-- Search, should appear as action button --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;item&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@+id/action_search&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:icon&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@drawable/ic_action_search&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@string/action_search&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:showAsAction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;ifRoom&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!-- Settings, should always be in the overflow --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;item&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@+id/action_settings&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@string/action_settings&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:showAsAction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;never&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/menu&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;sidebox&quot;&gt;
&lt;h3&gt;
Download action bar icons&lt;/h3&gt;
To best match the Android &lt;a href=&quot;http://developer.android.com/design/style/iconography.html#action-bar&quot;&gt;iconography&lt;/a&gt; guidelines, you should
use icons provided in the
&lt;a href=&quot;http://developer.android.com/design/downloads/index.html#action-bar-icon-pack&quot;&gt;Action Bar Icon Pack&lt;/a&gt;.&lt;br /&gt;

&lt;/div&gt;
This declares that the Search action should appear as an action button when room
is available in the action bar, but the
Settings action should always appear in the overflow. (By default, all actions appear in the
overflow, but it&#39;s good practice to explicitly declare your design intentions for each action.)

&lt;br /&gt;
The &lt;code&gt;icon&lt;/code&gt; attribute requires a resource ID for an
image. The name that follows &lt;code&gt;@drawable/&lt;/code&gt; must be the name of a bitmap image you&#39;ve
saved in your project&#39;s &lt;code&gt;res/drawable/&lt;/code&gt; directory. For example,
&lt;code&gt;&quot;@drawable/ic_action_search&quot;&lt;/code&gt; refers to &lt;code&gt;ic_action_search.png&lt;/code&gt;.
Likewise, the &lt;code&gt;title&lt;/code&gt; attribute uses a string resource that&#39;s defined by an XML
file in your project&#39;s &lt;code&gt;res/values/&lt;/code&gt; directory, as discussed in &lt;a href=&quot;http://developer.android.com/training/basics/firstapp/building-ui.html#Strings&quot;&gt;Building a Simple User
Interface&lt;/a&gt;.

&lt;br /&gt;
&lt;div class=&quot;note&quot;&gt;
&lt;strong&gt;Note:&lt;/strong&gt; When creating icons and other bitmap images for your app,
it&#39;s important that you provide multiple versions that are each optimized for a different screen
density. This is discussed more in the lesson about &lt;a href=&quot;http://developer.android.com/training/basics/supporting-devices/screens.html&quot;&gt;Supporting Different Screens&lt;/a&gt;.

&lt;/div&gt;
&lt;strong&gt;If your app is using the Support Library&lt;/strong&gt; for compatibility on versions
as low as Android 2.1, the &lt;code&gt;showAsAction&lt;/code&gt; attribute is not available from
the &lt;code&gt;android:&lt;/code&gt; namespace. Instead this attribute is provided by the Support Library
and you must define your own XML namespace and use that namespace as the attribute prefix.
(A custom XML namespace should be based on your app name, but it can be any
name you want and is only accessible within the scope of the file in which you declare it.)
For example:&lt;br /&gt;


&lt;div class=&quot;code-caption&quot;&gt;
res/menu/main_activity_actions.xml&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;menu&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;atn&quot;&gt;xmlns:yourapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;http://schemas.android.com/apk/res-auto&quot;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!-- Search, should appear as action button --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;item&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@+id/action_search&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:icon&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@drawable/ic_action_search&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@string/action_search&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;atn&quot;&gt;yourapp:showAsAction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;ifRoom&quot;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;pln&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/menu&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2 id=&quot;AddActions&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Add the Actions to the Action Bar&lt;/h2&gt;
&lt;hr /&gt;

To place the menu items into the action bar, implement the
&lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu%28android.view.Menu%29&quot;&gt;onCreateOptionsMenu()&lt;/a&gt;&lt;/code&gt; callback
method in your activity to inflate the menu resource into the given &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/view/Menu.html&quot;&gt;Menu&lt;/a&gt;&lt;/code&gt;
object. For example:&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;lit&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onCreateOptionsMenu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Menu&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Inflate the menu items for use in the action bar&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MenuInflater&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; inflater &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; getMenuInflater&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; inflater&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;inflate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;main_activity_actions&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onCreateOptionsMenu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2 id=&quot;Respond&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Respond to Action Buttons&lt;/h2&gt;
&lt;hr /&gt;

When the user presses one of the action buttons or another item in the action overflow,
the system calls your activity&#39;s &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected%28android.view.MenuItem%29&quot;&gt;onOptionsItemSelected()&lt;/a&gt;&lt;/code&gt; callback method. In your implementation of this method,
call &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/view/MenuItem.html#getItemId%28%29&quot;&gt;getItemId()&lt;/a&gt;&lt;/code&gt; on the given &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/view/MenuItem.html&quot;&gt;MenuItem&lt;/a&gt;&lt;/code&gt; to
determine which item was pressed—the returned ID matches the value you declared in the
corresponding &lt;code&gt;&amp;lt;item&amp;gt;&lt;/code&gt; element&#39;s &lt;code&gt;android:id&lt;/code&gt; attribute.&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;lit&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onOptionsItemSelected&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MenuItem&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Handle presses on the action bar items&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getItemId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;action_search&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openSearch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;action_settings&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openSettings&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onOptionsItemSelected&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2 id=&quot;UpNav&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Add Up Button for Low-level Activities&lt;/h2&gt;
&lt;hr /&gt;

&lt;div class=&quot;figure&quot; style=&quot;width: 240px;&quot;&gt;
  &lt;img alt=&quot;&quot; src=&quot;http://developer.android.com/images/ui/actionbar-up.png&quot; width=&quot;240&quot; /&gt;
  &lt;div class=&quot;img-caption&quot;&gt;
&lt;strong&gt;Figure 4.&lt;/strong&gt; The &lt;em&gt;Up&lt;/em&gt; button in Gmail.&lt;/div&gt;
&lt;/div&gt;
All screens in your app that are not the main entrance to your app
(activities that are not the &quot;home&quot; screen) should
offer the user a way to navigate to the logical parent screen in the app&#39;s hierarchy by pressing
the &lt;em&gt;Up&lt;/em&gt; button in the action bar.&lt;br /&gt;


When running on Android 4.1 (API level 16) or higher, or when using &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html&quot;&gt;ActionBarActivity&lt;/a&gt;&lt;/code&gt; from the Support Library, performing &lt;em&gt;Up&lt;/em&gt;
navigation simply requires that you declare the parent activity in the manifest file and enable
the &lt;em&gt;Up&lt;/em&gt; button for the action bar.&lt;br /&gt;


For example, here&#39;s how you can declare an activity&#39;s parent in the manifest:&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;application&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; ...
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!-- The main/home activity (it has no parent activity) --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;activity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;com.example.myfirstapp.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/activity&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!-- A child of the main activity --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;activity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;com.example.myfirstapp.DisplayMessageActivity&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:label&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@string/title_activity_display_message&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:parentActivityName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;com.example.myfirstapp.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!-- Parent activity meta-data to support 4.0 and lower --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;meta-data&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;android.support.PARENT_ACTIVITY&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;com.example.myfirstapp.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/activity&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/application&amp;gt;&lt;/span&gt;&lt;/pre&gt;
Then enable the app icon as the &lt;em&gt;Up&lt;/em&gt; button by calling
&lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/ActionBar.html#setDisplayHomeAsUpEnabled%28boolean%29&quot;&gt;setDisplayHomeAsUpEnabled()&lt;/a&gt;&lt;/code&gt;:&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;lit&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; setContentView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;activity_displaymessage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; getSupportActionBar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setDisplayHomeAsUpEnabled&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// If your minSdkVersion is 11 or higher, instead use:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// getActionBar().setDisplayHomeAsUpEnabled(true);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
Because the system now knows &lt;code&gt;MainActivity&lt;/code&gt; is the parent activity for
&lt;code&gt;DisplayMessageActivity&lt;/code&gt;, when the user presses the
&lt;em&gt;Up&lt;/em&gt; button, the system navigates to
the parent activity as appropriate—you &lt;strong&gt;do not&lt;/strong&gt; need to handle the
&lt;em&gt;Up&lt;/em&gt; button&#39;s event</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/5674435640881483866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/adding-action-buttons.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/5674435640881483866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/5674435640881483866'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/adding-action-buttons.html' title='Adding Action Buttons'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-MbLERsZx4RtoomyAY7BkH-06yac8MqBBiE0QEZKezITQHZ-cEFoRl2E4TqPt-A6Ls6sjyuacg_5iIQkIb2I4mS6GZ2P3tCpsdL5yxHXoP0JPjFA7KPBL1AAoRx5QMrIwT29_6RolKyg/s72-c/actionbar.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-5874728563858288763</id><published>2015-06-18T21:52:00.002+05:30</published><updated>2015-06-18T22:39:46.186+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Documentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Setting Up the Action Bar</title><content type='html'>&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;In its most basic form, the action bar displays the title for the activity
and the app icon on the left. Even in this simple form, the action bar
is useful for all activities to inform
users about where they are and to maintain a consistent identity for your app.&lt;br /&gt;
&lt;br /&gt;



&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6vSHrpaxI2qFHHEvxBEXOisq5YBMPJrh7RItvB0v8dYx0br-tOZwujqoPKpj7Q0Hv2pLe0pgmaIk4Q-xlt0AtdCwJmeX0BeJbuBahnd09PczSvG5amZQpYVhUmUJQ2tvqGgU3phUDwAg/s1600/actionbar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6vSHrpaxI2qFHHEvxBEXOisq5YBMPJrh7RItvB0v8dYx0br-tOZwujqoPKpj7Q0Hv2pLe0pgmaIk4Q-xlt0AtdCwJmeX0BeJbuBahnd09PczSvG5amZQpYVhUmUJQ2tvqGgU3phUDwAg/s320/actionbar.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;img-caption&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;img-caption&quot;&gt;
&lt;strong&gt;Figure 1.&lt;/strong&gt; An action bar with the app icon and
activity title.

&lt;/div&gt;
Setting up a basic action bar requires that your app use an activity theme that enables
the action bar. How to request such a theme depends on which version of Android is the
lowest supported by your app. So this
lesson is divided into two sections depending on which Android
version is your lowest supported.&lt;br /&gt;



&lt;h2 id=&quot;ApiLevel11&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Support Android 3.0 and Above Only&lt;/h2&gt;
&lt;hr /&gt;

Beginning with Android 3.0 (API level 11), the action bar is included in all
activities that use the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/R.style.html#Theme_Holo&quot;&gt;Theme.Holo&lt;/a&gt;&lt;/code&gt; theme (or one of its
descendants), which is the default theme when either the &lt;a href=&quot;http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target&quot;&gt;&lt;code&gt;targetSdkVersion&lt;/code&gt;&lt;/a&gt; or
&lt;a href=&quot;http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min&quot;&gt;&lt;code&gt;minSdkVersion&lt;/code&gt;&lt;/a&gt;
attribute is set to &lt;code&gt;&quot;11&quot;&lt;/code&gt; or greater.&lt;br /&gt;


So to add the action bar to your activities, simply set either attribute to
&lt;code&gt;11&lt;/code&gt; or higher. For example:&lt;br /&gt;


&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;manifest&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;uses-sdk&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:minSdkVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;11&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;note&quot;&gt;
&lt;strong&gt;Note:&lt;/strong&gt; If you&#39;ve created a custom theme, be sure it uses one
of the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/R.style.html#Theme_Holo&quot;&gt;Theme.Holo&lt;/a&gt;&lt;/code&gt; themes as its parent. For details,
see &lt;a href=&quot;http://developer.android.com/training/basics/actionbar/styling.html&quot;&gt;Styling the Action Bar&lt;/a&gt;.&lt;/div&gt;
Now the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/R.style.html#Theme_Holo&quot;&gt;Theme.Holo&lt;/a&gt;&lt;/code&gt; theme is applied to your app and
all activities show the action bar. That&#39;s it.&lt;br /&gt;




&lt;h2 id=&quot;ApiLevel7&quot; style=&quot;margin-bottom: 0px;&quot;&gt;
Support Android 2.1 and Above&lt;/h2&gt;
&lt;hr /&gt;

Adding the action bar when running on versions older than Android 3.0 (down to Android 2.1)
requires that you include the Android Support Library in your application.&lt;br /&gt;


To get started, read the &lt;a href=&quot;http://developer.android.com/tools/support-library/setup.html&quot;&gt;Support Library Setup&lt;/a&gt; document and set up the &lt;strong&gt;v7 appcompat&lt;/strong&gt;
library (once you&#39;ve downloaded the library package, follow the instructions for &lt;a href=&quot;http://developer.android.com/tools/support-library/setup.html#libs-with-res&quot;&gt;Adding libraries with
resources&lt;/a&gt;).&lt;br /&gt;


Once you have the Support Library integrated with your app project:&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;Update your activity so that it extends &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html&quot;&gt;ActionBarActivity&lt;/a&gt;&lt;/code&gt;.
  For example:
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MainActivity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ActionBarActivity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;In your manifest file, update either the &lt;a href=&quot;http://developer.android.com/guide/topics/manifest/application-element.html&quot;&gt;&lt;code&gt;&amp;lt;application&amp;gt;&lt;/code&gt;&lt;/a&gt; element or individual
  &lt;a href=&quot;http://developer.android.com/guide/topics/manifest/application-element.html&quot;&gt;&lt;code&gt;&amp;lt;activity&amp;gt;&lt;/code&gt;&lt;/a&gt;
  elements to use one of the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v7/appcompat/R.style.html#Theme_AppCompat&quot;&gt;Theme.AppCompat&lt;/a&gt;&lt;/code&gt; themes. For example:
  &lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;activity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:theme&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@style/Theme.AppCompat.Light&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;note&quot;&gt;
&lt;strong&gt;Note:&lt;/strong&gt; If you&#39;ve created a custom theme, be sure it uses one
of the &lt;code&gt;&lt;a href=&quot;http://developer.android.com/reference/android/support/v7/appcompat/R.style.html#Theme_AppCompat&quot;&gt;Theme.AppCompat&lt;/a&gt;&lt;/code&gt; themes as
its parent. For details, see &lt;a href=&quot;http://developer.android.com/training/basics/actionbar/styling.html&quot;&gt;Styling
the Action Bar&lt;/a&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
Now your activity includes the action bar when running on Android 2.1 (API level 7) or higher.
&lt;br /&gt;


Remember to properly set your app&#39;s API level support in the manifest:&lt;br /&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;manifest&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;uses-sdk&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:minSdkVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;7&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:targetSdkVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;18&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/5874728563858288763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/06/setting-up-action-bar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/5874728563858288763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/5874728563858288763'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/06/setting-up-action-bar.html' title='Setting Up the Action Bar'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6vSHrpaxI2qFHHEvxBEXOisq5YBMPJrh7RItvB0v8dYx0br-tOZwujqoPKpj7Q0Hv2pLe0pgmaIk4Q-xlt0AtdCwJmeX0BeJbuBahnd09PczSvG5amZQpYVhUmUJQ2tvqGgU3phUDwAg/s72-c/actionbar.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-1167166165131026642</id><published>2015-02-22T17:16:00.002+05:30</published><updated>2015-06-18T22:39:46.129+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Documentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Android: How to display image in text view </title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;While designing we may get a situation where we may have to display a image near text. For example&lt;/span&gt;&lt;a href=&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAAAGJ6VFh0UmF3IHByb2ZpbGUgdHlwZSBBUFAxAAB4nFXIsQ2AMAwAwd5TeIR3HBwyDkIBRUKAsn9BAQ1XnuztbKOveo9r60cTVVVVz5JrrmkBZl4GbhgJKF8t/ExEDQ8rHgYgD0i2FMl6UPBzAAAWSUlEQVR4nO2deXicVb3HP+e8yyxZJmnSpElb2nSBAqXYBcoiFAq0pVBRUNwARWW/VwHBe+URL95HEB4VRQVUEH2Qiw9cNhFKKVJW4bYClqUU6N50T5pkZpLMzLud+8c7k0z2TjLZKN/neZt03vP+fr/z+53fcpZ5A5/gE3yCTzBqIIZbgFyggAVvJ2tKU+6CzQkvXGd7tLpQqMFEQxNjg3LntHGh1b+YJHaPqo5lYcTKrYDjVsWW1rneSQ0uc0IwrVWJqmbDDLlK+i1EVmMAIQh4DiHPaQlArSPYUipZXW6w5vVTIs+M2M5mYUTJqID5L8cv39PqnrvfY56j6aUpqYHngcpcqk86CAFC+pfUCHkO0nUaSqRYG9LloxtOL7prRHU8C8MulwJOeiV24oYWdW2Ly9nNgaCJ64Dn+gbIF4QEKUEahO0kpVI9V2SIP64/LfKXYVdCFoZVlovfbp3/5C77jrhivqUb4NoH5gEDhRAgdUwhKHKtDROC4o63T43cOfiM+8awGOS01fEj1jW6v9+jBU/Ey3jDEBiiO0gNjABjrcTWalP8aO1pxX8azlE6pLwVMHlF06/rXC5vNQwdxx5K9r1DauhSY6xrP7+rLnK6uGh4xBgyg5z5anTe6ph6sMEMTcdODp9H9AXdpMSxvEpTu/LD04t+N9Tsh8QgR6+KfWNj0runRdMlrjMULAcGIZGaznjPfmT7ksgXhjKMDCovBVQ9E723wQh807JTI9creoIZotxKvP/0me5x80VZfChYDppBFDDlmehjW4zg57ASg8Vm8KGblDn23vrDvjVOTP3fQWc3KAZRwIQV0Zd26sGTR7UxMtB0xrhu00kV2sl/nVf47mCyyrtBFDB1RdOTm/XQso+FMTLQdMa4TuP+D0vGiGsGj03eDTLx2aYHa7XQlz9WxshANyh3nF11och4cergsJD5JDZ7VeyaWhn8eBoDwLGp143qymT0zcFikTeDfPqV5tM/SKrbcVL5Ijky4VjsM4NzDlvRdP9gkM+LQRTwbtx5ICHl6Ctt+4NUkk3CuHDac9Gv5Jt0XgwydUXsoagRrMRz80FuFEDhKJcGi/vyPfwGbJCzX2s+bZfH+R/7UNUZnkeDYQSqVzQ9mU+yAzKIAl6LOXcltYMkVHWGY1MvjGXHrYqeny+SAzLISatiFzfo4UNHxfrUoEBhK48tFj/OF8V+G0QBHybVjQddqOoMz2WvEZ4++4X4Zfkg12+DzH0hdkGjbtQcPIm8F9hJtiW97+YjaPfbIPtS6honn3veoxmeS5NmTD/xxdjFAyXVL4Oo2m+KvdKc023u8ABX+ZeX/n9nuFlt2q4M8R6eoZfPe3qmJ+dVnfh7tB8lyqVNtmjKY1vCu7TnFgeGfq1l1TwXvWML5rexO+UPR3HTlABVpkAIaHXgnZjLfXWOz0lAlYTrJwUo1DoJIuDmzSnmFWpMDEl+sdOG7DYe3DLZ5N6dNpvdLM0oOL1Q8qlijZ/ttNuG2BQNrp8c4MdbU+zMNoyCqabg+kkm6dNd1KUULzQ4PB91QReg4AulGqeV60ifNTsTHq80urwYdcHoXm3CCOJN/lFQTP9JvxNrzh6igJitFnXrHQ7822FBIqZgX1IhgWtnBNm/qJjJugAPKjTBNTOCNNqKFpcOl6UEZYbg1tlhcDoqvcYQfP/IEJdMMPwR28ZT8e2pAWaXaOClP3fhygkmlx8a5HuTAh1pATUBwWXTg+xOKhosxaSw5LETi1g+twAsBZ5icYXO4mqTvUmPFkcxb4zO458u5JXjCjryz9aNUszadsPNueo0G3quD5z9T2umVdc6raczU66Cp3bbPFDn+MN+XYInji3g8WMLmP1yHA9BCviPDSnQRMfThxJ+V+dwFzA7ovGvhOffV7C0zHeXhZUGbEy1e4+A48cafOa1Zp8egKM4rybAV9e08Iujw3zno2QHGT0Fza7ivzanfI/wFKxLYC8r4dLxBr/fZeMp+CjucuPGFJjS75ijWLOgiHUnF3HkqhgEOo1nz2GP4y5TcF1/l9Fz9pCWVmtB3AjqvU0EDQlI4SstKPlTrcWhRRpIX+8iw1lL/8z8LgBH8U6jy0VVRtaIV5xTbfKDdQlmjdHbQ4aCOWGJrsPrTW6b8aYXSQo0eHC7hZSwKKJ1if+CLP5p711d53Bimd6WjzSR7ofE5xmSHLu6hSOKNT4z1ugm73gkoebct+KH56rXDHI2yHsJdyHqAErdzBDxFIeGJU2W19ZRBe0JP3NlOifhmV0WZ1QZ7Ynag5nlOvdts2iyFReUpBWs4MxynXX73XZ+ruKHUwI8tcMCDVbutLhkcqDHMNMGBZVBwZ6MV/YER/HcHpuLDjG70lSKuBE0dkXVor4V1D1yNkgh6nC83svduK0g6UHSY0pAcNOsMPdsTLV1VACXjze4ukrn6iqd68YbHBNKu48U3LXL5vCIRjidYCeFJUFgd8rjjX02iyrT3uMqzqgyeHa35Y/yNJZOMPnlVgtMyUO1FosmGNAp5XkKSCpIKUh4/GiqybQijf/YanUsJjpDwOZmjwlh2X3VpVy225zctya7R045RAER6DF/AFgu3Da7gP+0FeUBQYku+Nn7CW7anAJDtIWsM6sMNOEr0ZDQYCn+2eqBhB3NHvsdxefHaNy/z+GqySav7LVBCv66y+aHs0LwdgIEzCjVufrdRFu4+lypTqsH70RdCEqebHJxXfhcpc7jTb5nu0CRLnjjjGI0AVMLNbbFXY5ZFeu1tM3A9lRbuuoCz8MU6qgc1NoBuSX1n0LMCBukWntsYmhw+/sJHtnncOuMINUhyQ8/SkLaAzJl5DlrWujQK020+6sO/9hts3icwf27HBZUGtyzxU/ATze63B2UYAqmBfyEvLbV8z3EUXxposkzO1LtHqNgxS6Lb00yeby+FXSBBFpdxZdWN6MhWLOwiOveSfBGq+fL0UdELg9I9qd6sJzy2K+oacuVOSIngxxzSnwB0d6HkAAabUWtA199N4FaVsKCMTovtXod2mAIehxmmuCxnTY3fyoEIsGMEp179/hV1O6Ux6aYy5UVOpMKJC/tyYpFLpwx3sBy4LMTAm0acTxFsSHajJR2Jjam/ET06w+S3D0nzJTnY72HK/wHTxyr87sNqe4DvlI0Bwr0FrVpDGJqQx/UuiCnHFLsisW4fS+XiPQkEAUPb7O49aiQX99nI52UuycAjzU6VAQkp1fo7Gh123OAgJf22Zw2zuCEcp1Hd1m+YdMJ3vVg3IooFSujVDzrX9VPR/GE4JKxenvllqaFLvjBphQTCiQXjtU7zPg7iKcAS3HFOIMJYcnN21I9DyjP5Sv/qjqlT0V1g5wMsiOpAojePURmTS0wBBesSzC/TOf8inZlZMreaimoFv41UYoOLt5iK9bud7hzdpjnd2UlbU3wh1qLxeNNZpTqPJxZBXAU104L8MT2dFLWRftlCp7anuKSqQFIT49ENjNdcOPaVu6cX9BhEqkLX84JEhaGJfccEeTXxxZw/qvxno0BoDx2t7j9Suw5hayok/09sm4goN5SJDzamtme4uq3WrhldpiHX4jjAg22YvPC4g6kTCm4dHULy+PpElbCX3fa3HR0iCf3OO1DR8CamEfU8Xiv0W0fxrrgsFKN699PdFWWJvifWosHP10EGtieL2cbJNy23eKcCSa/PCLI1e8niTkwa4zOptOLEcIvVtY3OBz19xjrk6qP0CbYkepc1x0Ycso75X+P/6ze07/b6x6Ipfyhle17mcVEU7S5frcwRUeJXOWHqs6fg1+uZiZs2byNbtqCH4psBYG0DHZans6ya6QTu+pSKrfd60trRoCAa/08tSRyXR8tuyAnDynEE/V9NTJEe37ICJ7pSCY+Zys4OyV1zitSQKAbHl6aT+eAm1FwhmYml2V+N7Jk0AVdVoiznxfd8FZZV15PtLUjJ4OMD0qxtaW3NWj4RoVOuS5YG3dZ2dw+6zWBb1XqFGiCFxod3kj6dK6rNjrk2TbBBLzU5LK608y5TMBFVQYCeLDOZk8npWbzWdXo8Gaaz0lhyfERrfM6Ywd+j9Q5NCvFBZUGQsAT9Q6bMg8oONwULCvTcRTcvsfu2VMUlOiSvT1rqkfkZJCgwWtIeU2PdbrlcfvcAiISlu+yWflGS5vHTNIFv5lXgADu+DDJGxuSIOCns8M98rv9gwSrN1lZyyLw3RqT7x8ZAmDC+gTXbsqaWSuYbLTz+fn6BG9utkApLhhvcOn0YK/92/1/zey1FD+f48sUW9PMpjq3bfJ09lid24727935bIyU21NKVVSZyEE3yA3Haq89v6o3XxUkHUXEFFidhr2Dv5oSkmB1Uzmvi7psbXHb8rEp4Y0mt2OHbcUXa9rjyOdrAlz7Qcfy01XtfOy20CVY0+gyba9F0oWqkGR2qd/15/bYOEphSvgo4VGURcvO7oLwC5QMet/wEJQHxJZem/SAnAyyUIR3Gc/EsIXI+dhPX3nwke0pbtqY6nn2rmB8gWRKWJIp4iYGJTMjkveSvRd/SPhDncMf9tjgKa6aaPKbuX7XF73V6mte+PwWF/d34TwLmkawwHu5P4/mlJoEUK2xDdH3YyrzT/pKdJcosmDI9Mw9e/7QoVJT3DTVBODFvTZr9vsl0A1Tum5AdYtMRWZIglkla4Uh0p93rZ5chT/wFOCpPheM2+B5/G1mwdsH2LoDct6gintqE0JO6qtdqSFYXKpRoAs8FEWa6NX648OSs8ZoBKTfbq+teKWlY0JfVOUb5KW9NiWGYH6ZzsIqA94bnNP2hxZqLHMVhvBDcE3BAYxfIShzk6399bOcDTLd4JXVrrawa5HeEadUGpxSaRww3a/VBPhaVn74IOZy+IvxtqJgWanGIelw9chehxJdcM3hUBmQXFiu8+eG/B9H+sHMUO4PCUmx8Lbs7yfPnA1iSfVKwLJJtS3RdY96S7GlxW1bYpfA0SVaj6G+ttVjb8pDCoEu4M0Gp8Om01cn+sZ6P+ryftpztrS41BRofPkQkz/vbe060RsgPmp2iTsKgUApRakpmdKXl0hJk/I29ZdnzgZ569SS50uWN+1OSVnV7QQijVV7bL64pr3sRYeWMyOEe1gDundTkv/+KGvZPLO1CuDCskP8cDUzoqE+W9Lh2cXVJojWA9rLyAU3rG3l0TrHn6C6iksmmvz+mILeHxIaUzTn9f5+oyfn+aYAioV6Hdn7OrUp8UesKSAgmGJKhOh5BAc10d7ebF8qx4PzKnTC6f9uSXhsS/rX1oTX1omrxht0HiB+YdF/KxUZwj/IYPo/Cw5g+AZdm6Suv9Vfnjl7CMDx4wvvqN2nzoUDfDXGAejEEKBrgkrZLlid528kXZbOLeviLjOXR9tPe6Q8tp9TwsSg5KLJAe7caXdgZUgwNEFFurkGbM811eSy0yQkQc9teG9B0cohS+oAD80yXn5hRdO+OikrOu+vy6yI0xlZC7Zd8J0ZIa48LNR2z5Rw90dJ/n1DiuMrfDGf3m5BgWyfq+iSZ2otLp0eZG6ZzrSQxFaqTYbONEMSxIpoB76dZRE93etjquN3UFKIWj+QTNavJTIBVGjch2Z0udFoKZIexBw6LOx5+MvuKQ9aXNW2IZFQEHMUCVfhegoncylIOoqLyjVMKai3FA/sttstDiAFf9xh02j7c4TzK3WaPWiyFfHuaKYfS7j+YnFKdT04YqfPbCU9SGVtIyD8FYDMc916jtQo1ljZH51m67Zf2KaaSmYuFzvjknCHOK2gWChiqtNEK92kUEBzpjMKQkJ1EUIBBoJYul0x+L93J3H682LR3ibcwyaaBsSVT6BIQLw7mulVeaHSyyOd7vX4HIAZRh33VLEoPLffr+EYUJ04dWXTXZtE4IouZ3wPRkiNiXgf1i6JzBgQmYE8vHFRyZXFVsqhl+rpoIGmM0bnqYGSGZBBBFAVlD9BNwcqx+iGEBRaKefQiLhnwKQGSkABFcujm+s0WYN7kH6bStOZoNzVtUsixw1UoQPeiBTA0kr9CwE0DtrQpRnMiGi/ykfv86bBmpVNd2+Rocs/tu856QlSUoZXX7+kZGw+lJm3rfrNi0quGGcnVh90+UQzGKfLvL2YOa8xRgFly6NNDZqMHBT5REgKlYrGt0RKxFX5IZnXwywCOKZUX1jiuCnkIJ2TGUkwTMbr6rf5MgYM0iv+Tnk5dtbqVvlUIvO+9o8jhKRUeYmGpSXhfCpxUIbxiycXP10TdM4PKdf72HqKZlBtiFvyPaIHtU6d+0L8sxuSPB4T8LF644PUKPPc2vqlJYfkW4GDOnzfPLXoiZPL9BMKXLcR/cD310c6pG4yMywuG4zRPCQzub/FVfnXX42+vt8ITRv18xTdpMazX9iyJLJwMMgP2dRaAVOebfzjdhH4uuu5ozOESUmRq+IPLXXGLx2kN10PWcYVwJbFpRfPNp2LSjy3ATM4+pZajDCzwuLGwTIGDKGHZEMBE5+N/rHJVRc066aOYw2HGLnBMCl3rZX1S0oWDyabYalJBbBjceTiM8aFZo3zrL8begB0Y+R6jNSI2Nb+unkvfWawWY0IDdzWqqp/9XL091GX05rNYBDXHjk5RgjC0mBe0Dnh5QXFrw86u8FmkAu+90Fr9WPb7WtbPXHeLjM8Gcdq/+Ngw/SSTWkGmaqsWzecUfz9oeA3ogySjYvXW3Oe25a4ohm10HE5pNkM6ngO/qLlEBnHDDLRTj22/czIeUOlqBFrkAwUsGStdeSO+uTSuKvO2o2+wBZi8P+im25SalvrG84qOWIolTTiDdIZ6iio+Vn0zztccYEjoa8X4fQLmk6Z6wzK0khfGHUrf+Jd2Lo4cuGxBZwVcr14X2eMc4amEXbd1j+fFJk7HKN11Bkkg9cWFC8/ryo4J+R5+SuXpUbY9ZoPK5DzlhaJuvwQzVGE4WCaLzwwJ7jxkIC8v8uR1v5AapS5rrewQl/wrwVF6wdOsJ9iDBfjfKFUen8xB7oJpunortf0xWpj7lPzCvr9VYJ8YNQbpGpcaEfQc+x+hy3doMh1Y4srAnPvml2wNr/S9UOc4RZgoKitT5W5CKNfUxMjQLmT+rCuuWSGWJp30fqFUW8QaXuzWnSTnA98myFqnOSaLWeWzB9Jtf+oD1m1Fp/Pad1LSNBNJjup325eEpk/eJL1DyNpcOQM9RQE9bhKHehal6YTdhzv0JC8Zu3C4l8NvoS5Y9SGLAVM0KJ/S0kNnAPwECPAGMfauHxp6oTjROWwzDEOBKPWIKe9Gj2jPi7Oxu3ji6dSQ9dNJnvJezecGblkpIeEUWkQBYyJqvtTmux5LUsIv4qyEluPCYlvPnNiZNVINwaMUoNMWN74p0YzOA4r2c1dAbpOgesyzrPu3ri09MrRYIgMRl2VNWdV06X1euBr3RpD05FSo9q1X9225G5z06LiUWUMGGVVlroFgkdHkykpAh3ODGsaaAEqnMRH003v+n8sLM3r3xYcSoyakKWAMZ9qWp/S9QBOOpFrOiaCiOesnx5qvfEfp5c8OqpGWDcYNQaZtCJ6X2OgcAZWAnSTgBCUuKnV44PabW+eEnlcMMrcfbRDqdvl1JWxB0uXN70zaWXs4QeVKhtumT7BJ/gEn+Agx/8DRD/LyrT0azEAAAAASUVORK5CYII=&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;a href=&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAAAGJ6VFh0UmF3IHByb2ZpbGUgdHlwZSBBUFAxAAB4nFXIsQ2AMAwAwd5TeIR3HBwyDkIBRUKAsn9BAQ1XnuztbKOveo9r60cTVVVVz5JrrmkBZl4GbhgJKF8t/ExEDQ8rHgYgD0i2FMl6UPBzAAAWSUlEQVR4nO2deXicVb3HP+e8yyxZJmnSpElb2nSBAqXYBcoiFAq0pVBRUNwARWW/VwHBe+URL95HEB4VRQVUEH2Qiw9cNhFKKVJW4bYClqUU6N50T5pkZpLMzLud+8c7k0z2TjLZKN/neZt03vP+fr/z+53fcpZ5A5/gE3yCTzBqIIZbgFyggAVvJ2tKU+6CzQkvXGd7tLpQqMFEQxNjg3LntHGh1b+YJHaPqo5lYcTKrYDjVsWW1rneSQ0uc0IwrVWJqmbDDLlK+i1EVmMAIQh4DiHPaQlArSPYUipZXW6w5vVTIs+M2M5mYUTJqID5L8cv39PqnrvfY56j6aUpqYHngcpcqk86CAFC+pfUCHkO0nUaSqRYG9LloxtOL7prRHU8C8MulwJOeiV24oYWdW2Ly9nNgaCJ64Dn+gbIF4QEKUEahO0kpVI9V2SIP64/LfKXYVdCFoZVlovfbp3/5C77jrhivqUb4NoH5gEDhRAgdUwhKHKtDROC4o63T43cOfiM+8awGOS01fEj1jW6v9+jBU/Ey3jDEBiiO0gNjABjrcTWalP8aO1pxX8azlE6pLwVMHlF06/rXC5vNQwdxx5K9r1DauhSY6xrP7+rLnK6uGh4xBgyg5z5anTe6ph6sMEMTcdODp9H9AXdpMSxvEpTu/LD04t+N9Tsh8QgR6+KfWNj0runRdMlrjMULAcGIZGaznjPfmT7ksgXhjKMDCovBVQ9E723wQh807JTI9creoIZotxKvP/0me5x80VZfChYDppBFDDlmehjW4zg57ASg8Vm8KGblDn23vrDvjVOTP3fQWc3KAZRwIQV0Zd26sGTR7UxMtB0xrhu00kV2sl/nVf47mCyyrtBFDB1RdOTm/XQso+FMTLQdMa4TuP+D0vGiGsGj03eDTLx2aYHa7XQlz9WxshANyh3nF11och4cergsJD5JDZ7VeyaWhn8eBoDwLGp143qymT0zcFikTeDfPqV5tM/SKrbcVL5Ijky4VjsM4NzDlvRdP9gkM+LQRTwbtx5ICHl6Ctt+4NUkk3CuHDac9Gv5Jt0XgwydUXsoagRrMRz80FuFEDhKJcGi/vyPfwGbJCzX2s+bZfH+R/7UNUZnkeDYQSqVzQ9mU+yAzKIAl6LOXcltYMkVHWGY1MvjGXHrYqeny+SAzLISatiFzfo4UNHxfrUoEBhK48tFj/OF8V+G0QBHybVjQddqOoMz2WvEZ4++4X4Zfkg12+DzH0hdkGjbtQcPIm8F9hJtiW97+YjaPfbIPtS6honn3veoxmeS5NmTD/xxdjFAyXVL4Oo2m+KvdKc023u8ABX+ZeX/n9nuFlt2q4M8R6eoZfPe3qmJ+dVnfh7tB8lyqVNtmjKY1vCu7TnFgeGfq1l1TwXvWML5rexO+UPR3HTlABVpkAIaHXgnZjLfXWOz0lAlYTrJwUo1DoJIuDmzSnmFWpMDEl+sdOG7DYe3DLZ5N6dNpvdLM0oOL1Q8qlijZ/ttNuG2BQNrp8c4MdbU+zMNoyCqabg+kkm6dNd1KUULzQ4PB91QReg4AulGqeV60ifNTsTHq80urwYdcHoXm3CCOJN/lFQTP9JvxNrzh6igJitFnXrHQ7822FBIqZgX1IhgWtnBNm/qJjJugAPKjTBNTOCNNqKFpcOl6UEZYbg1tlhcDoqvcYQfP/IEJdMMPwR28ZT8e2pAWaXaOClP3fhygkmlx8a5HuTAh1pATUBwWXTg+xOKhosxaSw5LETi1g+twAsBZ5icYXO4mqTvUmPFkcxb4zO458u5JXjCjryz9aNUszadsPNueo0G3quD5z9T2umVdc6raczU66Cp3bbPFDn+MN+XYInji3g8WMLmP1yHA9BCviPDSnQRMfThxJ+V+dwFzA7ovGvhOffV7C0zHeXhZUGbEy1e4+A48cafOa1Zp8egKM4rybAV9e08Iujw3zno2QHGT0Fza7ivzanfI/wFKxLYC8r4dLxBr/fZeMp+CjucuPGFJjS75ijWLOgiHUnF3HkqhgEOo1nz2GP4y5TcF1/l9Fz9pCWVmtB3AjqvU0EDQlI4SstKPlTrcWhRRpIX+8iw1lL/8z8LgBH8U6jy0VVRtaIV5xTbfKDdQlmjdHbQ4aCOWGJrsPrTW6b8aYXSQo0eHC7hZSwKKJ1if+CLP5p711d53Bimd6WjzSR7ofE5xmSHLu6hSOKNT4z1ugm73gkoebct+KH56rXDHI2yHsJdyHqAErdzBDxFIeGJU2W19ZRBe0JP3NlOifhmV0WZ1QZ7Ynag5nlOvdts2iyFReUpBWs4MxynXX73XZ+ruKHUwI8tcMCDVbutLhkcqDHMNMGBZVBwZ6MV/YER/HcHpuLDjG70lSKuBE0dkXVor4V1D1yNkgh6nC83svduK0g6UHSY0pAcNOsMPdsTLV1VACXjze4ukrn6iqd68YbHBNKu48U3LXL5vCIRjidYCeFJUFgd8rjjX02iyrT3uMqzqgyeHa35Y/yNJZOMPnlVgtMyUO1FosmGNAp5XkKSCpIKUh4/GiqybQijf/YanUsJjpDwOZmjwlh2X3VpVy225zctya7R045RAER6DF/AFgu3Da7gP+0FeUBQYku+Nn7CW7anAJDtIWsM6sMNOEr0ZDQYCn+2eqBhB3NHvsdxefHaNy/z+GqySav7LVBCv66y+aHs0LwdgIEzCjVufrdRFu4+lypTqsH70RdCEqebHJxXfhcpc7jTb5nu0CRLnjjjGI0AVMLNbbFXY5ZFeu1tM3A9lRbuuoCz8MU6qgc1NoBuSX1n0LMCBukWntsYmhw+/sJHtnncOuMINUhyQ8/SkLaAzJl5DlrWujQK020+6sO/9hts3icwf27HBZUGtyzxU/ATze63B2UYAqmBfyEvLbV8z3EUXxposkzO1LtHqNgxS6Lb00yeby+FXSBBFpdxZdWN6MhWLOwiOveSfBGq+fL0UdELg9I9qd6sJzy2K+oacuVOSIngxxzSnwB0d6HkAAabUWtA199N4FaVsKCMTovtXod2mAIehxmmuCxnTY3fyoEIsGMEp179/hV1O6Ux6aYy5UVOpMKJC/tyYpFLpwx3sBy4LMTAm0acTxFsSHajJR2Jjam/ET06w+S3D0nzJTnY72HK/wHTxyr87sNqe4DvlI0Bwr0FrVpDGJqQx/UuiCnHFLsisW4fS+XiPQkEAUPb7O49aiQX99nI52UuycAjzU6VAQkp1fo7Gh123OAgJf22Zw2zuCEcp1Hd1m+YdMJ3vVg3IooFSujVDzrX9VPR/GE4JKxenvllqaFLvjBphQTCiQXjtU7zPg7iKcAS3HFOIMJYcnN21I9DyjP5Sv/qjqlT0V1g5wMsiOpAojePURmTS0wBBesSzC/TOf8inZlZMreaimoFv41UYoOLt5iK9bud7hzdpjnd2UlbU3wh1qLxeNNZpTqPJxZBXAU104L8MT2dFLWRftlCp7anuKSqQFIT49ENjNdcOPaVu6cX9BhEqkLX84JEhaGJfccEeTXxxZw/qvxno0BoDx2t7j9Suw5hayok/09sm4goN5SJDzamtme4uq3WrhldpiHX4jjAg22YvPC4g6kTCm4dHULy+PpElbCX3fa3HR0iCf3OO1DR8CamEfU8Xiv0W0fxrrgsFKN699PdFWWJvifWosHP10EGtieL2cbJNy23eKcCSa/PCLI1e8niTkwa4zOptOLEcIvVtY3OBz19xjrk6qP0CbYkepc1x0Ycso75X+P/6ze07/b6x6Ipfyhle17mcVEU7S5frcwRUeJXOWHqs6fg1+uZiZs2byNbtqCH4psBYG0DHZans6ya6QTu+pSKrfd60trRoCAa/08tSRyXR8tuyAnDynEE/V9NTJEe37ICJ7pSCY+Zys4OyV1zitSQKAbHl6aT+eAm1FwhmYml2V+N7Jk0AVdVoiznxfd8FZZV15PtLUjJ4OMD0qxtaW3NWj4RoVOuS5YG3dZ2dw+6zWBb1XqFGiCFxod3kj6dK6rNjrk2TbBBLzU5LK608y5TMBFVQYCeLDOZk8npWbzWdXo8Gaaz0lhyfERrfM6Ywd+j9Q5NCvFBZUGQsAT9Q6bMg8oONwULCvTcRTcvsfu2VMUlOiSvT1rqkfkZJCgwWtIeU2PdbrlcfvcAiISlu+yWflGS5vHTNIFv5lXgADu+DDJGxuSIOCns8M98rv9gwSrN1lZyyLw3RqT7x8ZAmDC+gTXbsqaWSuYbLTz+fn6BG9utkApLhhvcOn0YK/92/1/zey1FD+f48sUW9PMpjq3bfJ09lid24727935bIyU21NKVVSZyEE3yA3Haq89v6o3XxUkHUXEFFidhr2Dv5oSkmB1Uzmvi7psbXHb8rEp4Y0mt2OHbcUXa9rjyOdrAlz7Qcfy01XtfOy20CVY0+gyba9F0oWqkGR2qd/15/bYOEphSvgo4VGURcvO7oLwC5QMet/wEJQHxJZem/SAnAyyUIR3Gc/EsIXI+dhPX3nwke0pbtqY6nn2rmB8gWRKWJIp4iYGJTMjkveSvRd/SPhDncMf9tjgKa6aaPKbuX7XF73V6mte+PwWF/d34TwLmkawwHu5P4/mlJoEUK2xDdH3YyrzT/pKdJcosmDI9Mw9e/7QoVJT3DTVBODFvTZr9vsl0A1Tum5AdYtMRWZIglkla4Uh0p93rZ5chT/wFOCpPheM2+B5/G1mwdsH2LoDct6gintqE0JO6qtdqSFYXKpRoAs8FEWa6NX648OSs8ZoBKTfbq+teKWlY0JfVOUb5KW9NiWGYH6ZzsIqA94bnNP2hxZqLHMVhvBDcE3BAYxfIShzk6399bOcDTLd4JXVrrawa5HeEadUGpxSaRww3a/VBPhaVn74IOZy+IvxtqJgWanGIelw9chehxJdcM3hUBmQXFiu8+eG/B9H+sHMUO4PCUmx8Lbs7yfPnA1iSfVKwLJJtS3RdY96S7GlxW1bYpfA0SVaj6G+ttVjb8pDCoEu4M0Gp8Om01cn+sZ6P+ryftpztrS41BRofPkQkz/vbe060RsgPmp2iTsKgUApRakpmdKXl0hJk/I29ZdnzgZ569SS50uWN+1OSVnV7QQijVV7bL64pr3sRYeWMyOEe1gDundTkv/+KGvZPLO1CuDCskP8cDUzoqE+W9Lh2cXVJojWA9rLyAU3rG3l0TrHn6C6iksmmvz+mILeHxIaUzTn9f5+oyfn+aYAioV6Hdn7OrUp8UesKSAgmGJKhOh5BAc10d7ebF8qx4PzKnTC6f9uSXhsS/rX1oTX1omrxht0HiB+YdF/KxUZwj/IYPo/Cw5g+AZdm6Suv9Vfnjl7CMDx4wvvqN2nzoUDfDXGAejEEKBrgkrZLlid528kXZbOLeviLjOXR9tPe6Q8tp9TwsSg5KLJAe7caXdgZUgwNEFFurkGbM811eSy0yQkQc9teG9B0cohS+oAD80yXn5hRdO+OikrOu+vy6yI0xlZC7Zd8J0ZIa48LNR2z5Rw90dJ/n1DiuMrfDGf3m5BgWyfq+iSZ2otLp0eZG6ZzrSQxFaqTYbONEMSxIpoB76dZRE93etjquN3UFKIWj+QTNavJTIBVGjch2Z0udFoKZIexBw6LOx5+MvuKQ9aXNW2IZFQEHMUCVfhegoncylIOoqLyjVMKai3FA/sttstDiAFf9xh02j7c4TzK3WaPWiyFfHuaKYfS7j+YnFKdT04YqfPbCU9SGVtIyD8FYDMc916jtQo1ljZH51m67Zf2KaaSmYuFzvjknCHOK2gWChiqtNEK92kUEBzpjMKQkJ1EUIBBoJYul0x+L93J3H682LR3ibcwyaaBsSVT6BIQLw7mulVeaHSyyOd7vX4HIAZRh33VLEoPLffr+EYUJ04dWXTXZtE4IouZ3wPRkiNiXgf1i6JzBgQmYE8vHFRyZXFVsqhl+rpoIGmM0bnqYGSGZBBBFAVlD9BNwcqx+iGEBRaKefQiLhnwKQGSkABFcujm+s0WYN7kH6bStOZoNzVtUsixw1UoQPeiBTA0kr9CwE0DtrQpRnMiGi/ykfv86bBmpVNd2+Rocs/tu856QlSUoZXX7+kZGw+lJm3rfrNi0quGGcnVh90+UQzGKfLvL2YOa8xRgFly6NNDZqMHBT5REgKlYrGt0RKxFX5IZnXwywCOKZUX1jiuCnkIJ2TGUkwTMbr6rf5MgYM0iv+Tnk5dtbqVvlUIvO+9o8jhKRUeYmGpSXhfCpxUIbxiycXP10TdM4PKdf72HqKZlBtiFvyPaIHtU6d+0L8sxuSPB4T8LF644PUKPPc2vqlJYfkW4GDOnzfPLXoiZPL9BMKXLcR/cD310c6pG4yMywuG4zRPCQzub/FVfnXX42+vt8ITRv18xTdpMazX9iyJLJwMMgP2dRaAVOebfzjdhH4uuu5ozOESUmRq+IPLXXGLx2kN10PWcYVwJbFpRfPNp2LSjy3ATM4+pZajDCzwuLGwTIGDKGHZEMBE5+N/rHJVRc066aOYw2HGLnBMCl3rZX1S0oWDyabYalJBbBjceTiM8aFZo3zrL8begB0Y+R6jNSI2Nb+unkvfWawWY0IDdzWqqp/9XL091GX05rNYBDXHjk5RgjC0mBe0Dnh5QXFrw86u8FmkAu+90Fr9WPb7WtbPXHeLjM8Gcdq/+Ngw/SSTWkGmaqsWzecUfz9oeA3ogySjYvXW3Oe25a4ohm10HE5pNkM6ngO/qLlEBnHDDLRTj22/czIeUOlqBFrkAwUsGStdeSO+uTSuKvO2o2+wBZi8P+im25SalvrG84qOWIolTTiDdIZ6iio+Vn0zztccYEjoa8X4fQLmk6Z6wzK0khfGHUrf+Jd2Lo4cuGxBZwVcr14X2eMc4amEXbd1j+fFJk7HKN11Bkkg9cWFC8/ryo4J+R5+SuXpUbY9ZoPK5DzlhaJuvwQzVGE4WCaLzwwJ7jxkIC8v8uR1v5AapS5rrewQl/wrwVF6wdOsJ9iDBfjfKFUen8xB7oJpunortf0xWpj7lPzCvr9VYJ8YNQbpGpcaEfQc+x+hy3doMh1Y4srAnPvml2wNr/S9UOc4RZgoKitT5W5CKNfUxMjQLmT+rCuuWSGWJp30fqFUW8QaXuzWnSTnA98myFqnOSaLWeWzB9Jtf+oD1m1Fp/Pad1LSNBNJjup325eEpk/eJL1DyNpcOQM9RQE9bhKHehal6YTdhzv0JC8Zu3C4l8NvoS5Y9SGLAVM0KJ/S0kNnAPwECPAGMfauHxp6oTjROWwzDEOBKPWIKe9Gj2jPi7Oxu3ji6dSQ9dNJnvJezecGblkpIeEUWkQBYyJqvtTmux5LUsIv4qyEluPCYlvPnNiZNVINwaMUoNMWN74p0YzOA4r2c1dAbpOgesyzrPu3ri09MrRYIgMRl2VNWdV06X1euBr3RpD05FSo9q1X9225G5z06LiUWUMGGVVlroFgkdHkykpAh3ODGsaaAEqnMRH003v+n8sLM3r3xYcSoyakKWAMZ9qWp/S9QBOOpFrOiaCiOesnx5qvfEfp5c8OqpGWDcYNQaZtCJ6X2OgcAZWAnSTgBCUuKnV44PabW+eEnlcMMrcfbRDqdvl1JWxB0uXN70zaWXs4QeVKhtumT7BJ/gEn+Agx/8DRD/LyrT0azEAAAAASUVORK5CYII=&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkI9ZsBVyykHxrjT_VOzO_16PUi6bUkYbWpF9yvM8JIhIXH_cTccAuGHGltFgMjblCsTBXKlXzkCCeBCa1d0XO-H-Pnr5ROWqpWd3AG9GHKLtx4KFTL_MCWKbQBT2ae7JxNHz7ae9EKrk/s1600/rewards.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;160&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkI9ZsBVyykHxrjT_VOzO_16PUi6bUkYbWpF9yvM8JIhIXH_cTccAuGHGltFgMjblCsTBXKlXzkCCeBCa1d0XO-H-Pnr5ROWqpWd3AG9GHKLtx4KFTL_MCWKbQBT2ae7JxNHz7ae9EKrk/s320/rewards.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;In Android, to display like this, we may use a &lt;b&gt;Imageview&lt;/b&gt; followed by a &lt;b&gt;Textview&lt;/b&gt;. &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Drawable drawable= activity.getResources().getDrawable(R.drawable.lyb);//load image in drawable&lt;br /&gt;drawable.setBounds(0,0,drawable.getIntrinsicWidth(),calRich.getIntrinsicHeight());//sepecify bounds&lt;br /&gt;textView.setCompoundDrawables(null,null,calRich,null);//right image &lt;br /&gt;textView.setCompoundDrawablePadding(5);// specify padding between image and text&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/1167166165131026642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/02/android-how-to-display-image-in-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/1167166165131026642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/1167166165131026642'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/02/android-how-to-display-image-in-text.html' title='Android: How to display image in text view '/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkI9ZsBVyykHxrjT_VOzO_16PUi6bUkYbWpF9yvM8JIhIXH_cTccAuGHGltFgMjblCsTBXKlXzkCCeBCa1d0XO-H-Pnr5ROWqpWd3AG9GHKLtx4KFTL_MCWKbQBT2ae7JxNHz7ae9EKrk/s72-c/rewards.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-8719468039280326658</id><published>2015-02-22T16:34:00.001+05:30</published><updated>2015-06-18T22:39:46.243+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Documentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Android rectangle with bottom right corner triangle</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;To create rectangle with bottom right corner triangle for drop down background &lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAAAxCAIAAAAUfmNgAAADEElEQVRoge2Zy46bMBSG55VNus3MjksWo2rU96jUvkUXlZqZRWfaSaRRwLdAqqpdYUtdGIzBjrmFBEgtFB3MObZ/zseJSW4YY2maMsZUo9J0hyaGJVx34JzrnpzzPsPqnjdiGs65bhzrP5Vx/mGvTK0RiQob3Ug+/7DCsDhcWW77r6bz0i+gVs/4779/dgTtKAqp+MT5Kd4RGFIcUrQjKMwvhRQrhryUjZD3SJ/cjaJiFj1WhgjPwhmXpxbO6qqU1VKEYlpDMkr2r+EbOcTkENNDQivGr8R0KSGHmB7i3Mh6SNETqz1q7NGJimFtzkRblRr7tP1RQzKKKdyT4UiTbWiSU8aeNmW1OslCLVPadGvy4+aF1ZAcUxjPJbfbl1JuDWqTGZG8/U9yKbdXRvIexrT/sizh51HLGpIcTY1kIakTyQkVuVX79dt22iRYjLZTy1PD961B7fDP7RD37oja8nOrszFFklWjA8mzyG2aVnNrUBsbnttJqm1Sk+F17S7ymiybfhctl5oY/WOb5JbpuTWoHVlNbuWsnhr2UjoJp6rJlvA+w05vn8xapqtHbs9VpSzhAw3btUrN5v12ct+3rZxLatPURrJo9rd5EVyBh7f5e0pqqOW21bC6jyRZti65FZGd771srUKaG/LUUKXMamfx3CKMPn7+VFKrkzCPdyCEkBd4/spXHS5TpYbOLYTQ9V2wAP7KL+X2iNoJk4wxdj0XLICzcIJVUFKrkzDpdyAIoRd4YAGAA4ADxkhyk54mRhRFnu+BBZDHKEhm7b+0jIY6DiYZwDa1OhJTJBki6AUecBSpguSgCcm52rHl1riqKIqyZ1U7GpI8on2y3cAEu77rvHMaqdXZgNPZXWQV2FHo1dSyJiSPP7dFBbaqLeXWoDb/12s4tf1jCSFit2Q/6knGyf7bz+/r12fTkfVLB2E8bp6Ph1Sd15vqaIYQOVHhUzh/WX+9f3+/vFtmx+3y9u62OFWOhw8PNSTzE5E2NMkdhj2qVrTh1A43vvw0qNVJZu2LJzf9yHDZNz6jcV0k/wNCYsgrrLUuvAAAAABJRU5ErkJggg==&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAAAxCAIAAAAUfmNgAAADEElEQVRoge2Zy46bMBSG55VNus3MjksWo2rU96jUvkUXlZqZRWfaSaRRwLdAqqpdYUtdGIzBjrmFBEgtFB3MObZ/zseJSW4YY2maMsZUo9J0hyaGJVx34JzrnpzzPsPqnjdiGs65bhzrP5Vx/mGvTK0RiQob3Ug+/7DCsDhcWW77r6bz0i+gVs/4779/dgTtKAqp+MT5Kd4RGFIcUrQjKMwvhRQrhryUjZD3SJ/cjaJiFj1WhgjPwhmXpxbO6qqU1VKEYlpDMkr2r+EbOcTkENNDQivGr8R0KSGHmB7i3Mh6SNETqz1q7NGJimFtzkRblRr7tP1RQzKKKdyT4UiTbWiSU8aeNmW1OslCLVPadGvy4+aF1ZAcUxjPJbfbl1JuDWqTGZG8/U9yKbdXRvIexrT/sizh51HLGpIcTY1kIakTyQkVuVX79dt22iRYjLZTy1PD961B7fDP7RD37oja8nOrszFFklWjA8mzyG2aVnNrUBsbnttJqm1Sk+F17S7ymiybfhctl5oY/WOb5JbpuTWoHVlNbuWsnhr2UjoJp6rJlvA+w05vn8xapqtHbs9VpSzhAw3btUrN5v12ct+3rZxLatPURrJo9rd5EVyBh7f5e0pqqOW21bC6jyRZti65FZGd771srUKaG/LUUKXMamfx3CKMPn7+VFKrkzCPdyCEkBd4/spXHS5TpYbOLYTQ9V2wAP7KL+X2iNoJk4wxdj0XLICzcIJVUFKrkzDpdyAIoRd4YAGAA4ADxkhyk54mRhRFnu+BBZDHKEhm7b+0jIY6DiYZwDa1OhJTJBki6AUecBSpguSgCcm52rHl1riqKIqyZ1U7GpI8on2y3cAEu77rvHMaqdXZgNPZXWQV2FHo1dSyJiSPP7dFBbaqLeXWoDb/12s4tf1jCSFit2Q/6knGyf7bz+/r12fTkfVLB2E8bp6Ph1Sd15vqaIYQOVHhUzh/WX+9f3+/vFtmx+3y9u62OFWOhw8PNSTzE5E2NMkdhj2qVrTh1A43vvw0qNVJZu2LJzf9yHDZNz6jcV0k/wNCYsgrrLUuvAAAAABJRU5ErkJggg==&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;item&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;shape&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;solid android:color=&quot;#ffffff&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stroke&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:width=&quot;1dp&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:color=&quot;@color/background_gradient_top&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;padding&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:bottom=&quot;1dp&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:left=&quot;1dp&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:right=&quot;1dp&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:top=&quot;1dp&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/shape&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/item&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;item android:bottom=&quot;5dp&quot; android:right=&quot;5dp&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rotate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:fromDegrees=&quot;-45&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:toDegrees=&quot;0&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:pivotX=&quot;150%&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:pivotY=&quot;20%&quot; &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;shape&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:shape=&quot;rectangle&quot; &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;solid android:color=&quot;@color/primary_dark_material_light&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/shape&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rotate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/item&amp;gt;&lt;br /&gt;&amp;lt;/layer-list&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/8719468039280326658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/02/android-rectangle-with-bottom-right.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/8719468039280326658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/8719468039280326658'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/02/android-rectangle-with-bottom-right.html' title='Android rectangle with bottom right corner triangle'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-9136489949318398467</id><published>2015-02-12T21:28:00.003+05:30</published><updated>2015-06-18T22:39:46.248+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cricket"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>India vs Pakistan ICC World Cup 2015 Live match</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;Watch India vs Pakistan ICC World Cup 2015&lt;/span&gt;&lt;/span&gt; &lt;a href=&quot;http://www.starsports.com/cricket/tour/icc-cricket-world-cup-2015-164/index.html&quot;&gt;Live&lt;/a&gt; &lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;match on Starsports&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08kHqyUB-TqGoUcjVBubUEZGyq_TKD-m0_98K7uKLrJzMuJ9hcevMGrbmKMuJkDWOvWkdYxWJz-G4MttC57LumEC42JdXvioTMPSXwb_jzezpsojz5CD-EP0_lWHYB0F54581TRvS9ig/s1600/muchado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08kHqyUB-TqGoUcjVBubUEZGyq_TKD-m0_98K7uKLrJzMuJ9hcevMGrbmKMuJkDWOvWkdYxWJz-G4MttC57LumEC42JdXvioTMPSXwb_jzezpsojz5CD-EP0_lWHYB0F54581TRvS9ig/s320/muchado.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/9136489949318398467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/02/india-vs-pakistan-icc-world-cup-2015.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/9136489949318398467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/9136489949318398467'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/02/india-vs-pakistan-icc-world-cup-2015.html' title='India vs Pakistan ICC World Cup 2015 Live match'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08kHqyUB-TqGoUcjVBubUEZGyq_TKD-m0_98K7uKLrJzMuJ9hcevMGrbmKMuJkDWOvWkdYxWJz-G4MttC57LumEC42JdXvioTMPSXwb_jzezpsojz5CD-EP0_lWHYB0F54581TRvS9ig/s72-c/muchado.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-5935539812460212182</id><published>2015-02-11T10:05:00.005+05:30</published><updated>2015-06-18T22:39:46.193+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Android using font fgcolor in String tag</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=8375270122264838256&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOGoYai4163H3rXX761c5qx33LpFNACt3qBwVLowAFAvxD9QB4fXq2OeGplCscgErd-fFQqOIx8XEgZwP9VXX5FsCTzCkn4ts81m2zKjfrZHdZLjLqBtY_F-o4XhK0WRYEiMHkEv5WQ-k/s1600/34bfc1dc80b35c8797aaddaad9909960.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOGoYai4163H3rXX761c5qx33LpFNACt3qBwVLowAFAvxD9QB4fXq2OeGplCscgErd-fFQqOIx8XEgZwP9VXX5FsCTzCkn4ts81m2zKjfrZHdZLjLqBtY_F-o4XhK0WRYEiMHkEv5WQ-k/s200/34bfc1dc80b35c8797aaddaad9909960.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Font tags can be used inside string tag to specify diffent colors in same string.&lt;/h4&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
the usage as follows.&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;lt;string name=&quot;txt_string&quot;&amp;gt;NORMAL TEXT&amp;lt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;ins style=&quot;background-color: #97f295; display: inline-block; margin-top: -1px; text-decoration: none;&quot;&gt;font color=&quot;red&quot; fgcolor=&quot;#FFFF0000&quot;&amp;gt;COLORED TEXT&amp;lt;/font&amp;gt;&lt;/ins&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/5935539812460212182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2015/02/android-using-font-fgcolor-in-string-tag.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/5935539812460212182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/5935539812460212182'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2015/02/android-using-font-fgcolor-in-string-tag.html' title='Android using font fgcolor in String tag'/><author><name>Nice</name><uri>http://www.blogger.com/profile/10076122355701478362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOGoYai4163H3rXX761c5qx33LpFNACt3qBwVLowAFAvxD9QB4fXq2OeGplCscgErd-fFQqOIx8XEgZwP9VXX5FsCTzCkn4ts81m2zKjfrZHdZLjLqBtY_F-o4XhK0WRYEiMHkEv5WQ-k/s72-c/34bfc1dc80b35c8797aaddaad9909960.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-8186148255028166786</id><published>2013-01-11T13:33:00.000+05:30</published><updated>2015-06-18T22:39:46.235+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Solaris"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>ORA-00600: [4194], [a], [b] : Oracle shutdown immediate</title><content type='html'>One of the servers having 2 single instance databases hosted on 
it,was having some I/O issue.The control files, redo log files and the 
data files for both the database were present on these two mount points.&lt;br /&gt;

&lt;pre&gt;&lt;/pre&gt;
Cause if this I/O issue, both the databases were down.The SysAdmin 
team, dismounted and then mounted back these two disk,and the I/O issue 
was no more.It was time to startup the database.One of the database 
started up successfully.The other one, started throwing ORA-00600: 
[4194], [38], [20] &lt;br /&gt;

&lt;pre&gt;Successfully onlined Undo Tablespace 29.
Sun May 16 01:52:16 2010
SMON: enabling tx recovery
Sun May 16 01:52:16 2010
Database Characterset is WE8ISO8859P1
Sun May 16 01:52:17 2010
Errors in file /disk1/oracle/admin/idcdb/udump/idc_ora_22161.trc:
ORA-00600: internal error code, arguments: [4194], [38], [20], [], [], [], [], []
Doing block recovery for file 66 block 213923
Block recovery from logseq 15340, block 64 to scn 5970802072110
Sun May 16 01:52:20 2010
Recovery of Online Redo Log: Thread 1 Group 4 Seq 15340 Reading mem 0
  Mem# 0: /disk1/oradata/redo/redolog6.log
  Mem# 1: /disk1/oradata/redo/redomlplx/redolog6a.log
Block recovery stopped at EOT rba 15340.66.16
Block recovery completed at rba 15340.66.16, scn 1390.797530529
Doing block recovery for file 66 block 361
Block recovery from logseq 15340, block 64 to scn 5970802071968
Sun May 16 01:52:20 2010
Recovery of Online Redo Log: Thread 1 Group 4 Seq 15340 Reading mem 0
  Mem# 0: /disk1/oradata/redo/redolog6.log
  Mem# 1: /disk1/oradata/redo/redomlplx/redolog6a.log
Block recovery completed at rba 15340.66.16, scn 1390.797530529
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=20, OS id=23281
Sun May 16 01:52:25 2010
Completed: ALTER DATABASE OPEN
&lt;/pre&gt;
After few minutes, the instance was terminated by PMON process&lt;br /&gt;

&lt;pre&gt;Errors in file /disk1/oracle/admin/idcdb/bdump/idc_mmon_21649.trc:
ORA-00600: internal error code, arguments: [4194], [38], [20], [], [], [], [], []
ORA-00600: internal error code, arguments: [4194], [38], [20], [], [], [], [], []
ORA-00600: internal error code, arguments: [4194], [38], [20], [], [], [], [], []
Sun May 16 01:52:31 2010
Errors in file /disk1/oracle/admin/idcdb/bdump/idc_pmon_21599.trc:
ORA-00600: internal error code, arguments: [4194], [9], [5], [], [], [], [], []
Sun May 16 01:52:31 2010
Errors in file /disk1/oracle/admin/idcdb/udump/idc_ora_24006.trc:
ORA-00600: internal error code, arguments: [4194], [54], [39], [], [], [], [], []
Sun May 16 01:52:32 2010
Errors in file /disk1/oracle/admin/idcdb/bdump/idc_pmon_21599.trc:
ORA-00600: internal error code, arguments: [4194], [9], [5], [], [], [], [], []
PMON: terminating instance due to error 472
Sun May 16 01:52:32 2010
DEBUG: Replaying xcb 0x47fb9e970, pmd 0x47fde0728 for failed op 8
Doing block recovery for file 66 block 293914
Block recovery from logseq 15340, block 76 to scn 5970802072130
Sun May 16 01:52:32 2010
Recovery of Online Redo Log: Thread 1 Group 4 Seq 15340 Reading mem 0
  Mem# 0: /disk1/oradata/redo/redolog6.log
  Mem# 1: /disk1/oradata/redo/redomlplx/redolog6a.log
Block recovery completed at rba 15340.78.16, scn 1390.797530691
Sun May 16 01:52:38 2010
Instance terminated by PMON, pid = 21599
&lt;/pre&gt;
As per MOS&lt;br /&gt;

&lt;blockquote&gt;
DESCRIPTION: A mismatch has been detected between Redo records and rollback (Undo) records.&lt;br /&gt;
We are validating the Undo record number relating to the change being 
applied against the maximum undo record number recorded in the undo 
block.&lt;br /&gt;
This error is reported when the validation fails.&lt;br /&gt;

ARGUMENTS:&lt;br /&gt;
  Arg [a] Maximum Undo record number in Undo block&lt;br /&gt;
  Arg [b] Undo record number from Redo block&lt;br /&gt;

FUNCTIONALITY:&lt;br /&gt;
  Kernel Transaction Undo called from Cache layer&lt;br /&gt;

IMPACT:&lt;br /&gt;
 PROCESS FAILURE&lt;br /&gt;
 POSSIBLE ROLLBACK SEGMENT CORRUPTION&lt;br /&gt;

SUGGESTIONS:This error may indicate a rollback segment corruption.&lt;br /&gt;
This may require a recovery from a database backup depending on the situation.&lt;br /&gt;

&lt;/blockquote&gt;
Now, it was time to come in action &lt;img alt=&quot;:)&quot; class=&quot;wp-smiley&quot; src=&quot;http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif?m=1129645325g&quot; /&gt;  . Below is the workaround steps :-&lt;br /&gt;

1. Startup database in mount mode&lt;br /&gt;

&lt;pre&gt; SQL&amp;gt; startup mount
ORACLE instance started.

Total System Global Area 4294967296 bytes
Fixed Size                  2078264 bytes
Variable Size            4160752072 bytes
Database Buffers          117440512 bytes
Redo Buffers               14696448 bytes
Database mounted.
&lt;/pre&gt;
2. Check the values for Undo related parameter&lt;br /&gt;

&lt;pre&gt;SQL&amp;gt; show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1

&lt;/pre&gt;
3. Change the UNDO_MANAGEMENT to &lt;strong&gt;‘MANUAL’&lt;/strong&gt;&lt;br /&gt;

&lt;pre&gt;SQL&amp;gt;
SQL&amp;gt; alter system set undo_management=&#39;MANUAL&#39; scope=spfile;
&lt;/pre&gt;
4. As, the above parameter is a static one, bounce the database&lt;br /&gt;

&lt;pre&gt;SQL&amp;gt; shu immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL&amp;gt; startup
ORACLE instance started.

Total System Global Area 4294967296 bytes
Fixed Size                  2078264 bytes
Variable Size            4160752072 bytes
Database Buffers          117440512 bytes
Redo Buffers               14696448 bytes
Database mounted.
Database opened.
&lt;/pre&gt;
5. In the meantime, keep checking the alert log.Check if there is 
some error after opening the database successfully with undo_management 
set to manual.&lt;br /&gt;

6.If everything seems fine, then go ahead and create a new undo tablespace.&lt;br /&gt;

&lt;pre&gt;SQL&amp;gt; create undo tablespace UNDOTBS datafile &#39;/disk1/oradata/idcdb/undotbs1.dbf&#39; size 1G autoextend on;

Tablespace created.

SQL&amp;gt; show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      MANUAL
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1
SQL&amp;gt;
&lt;/pre&gt;
7.  Set the undo_tablespace to the new Undo Tablespace name and undo_management back to ‘AUTO’&lt;br /&gt;

&lt;pre&gt;SQL&amp;gt; alter system set undo_tablespace=&#39;UNDOTBS&#39; scope=spfile;

System altered.

SQL&amp;gt; alter system set undo_management=&#39;AUTO&#39; scope=spfile;

System altered.
&lt;/pre&gt;
8. Bounce the database &lt;br /&gt;

&lt;pre&gt;SQL&amp;gt; shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&amp;gt; startup
ORACLE instance started.

Total System Global Area 4294967296 bytes
Fixed Size                  2078264 bytes
Variable Size            4160752072 bytes
Database Buffers          117440512 bytes
Redo Buffers               14696448 bytes
Database mounted.
Database opened.
&lt;/pre&gt;
9. Check the Alert log for if any errors and check the undo parameters &lt;br /&gt;

&lt;pre&gt;SQL&amp;gt; show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS
&lt;/pre&gt;
After this the database was open successfully without any error.</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/8186148255028166786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2013/01/ora-00600-4194-b-oracle-shutdown.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/8186148255028166786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/8186148255028166786'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2013/01/ora-00600-4194-b-oracle-shutdown.html' title='ORA-00600: [4194], [a], [b] : Oracle shutdown immediate'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-6907160563962188858</id><published>2012-05-18T15:29:00.001+05:30</published><updated>2015-06-18T22:39:46.210+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Configure Linux to use GUI Logins</title><content type='html'>Follow the instructions provided in the following link&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.idevelopment.info/data/Unix/Linux/LINUX_ConfiguringXDMCPRedHatLinux.shtml&quot; target=&quot;_blank&quot;&gt;http://www.idevelopment.info/data/Unix/Linux/LINUX_ConfiguringXDMCPRedHatLinux.shtml&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/6907160563962188858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2012/05/configure-linux-to-use-gui-logins.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/6907160563962188858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/6907160563962188858'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2012/05/configure-linux-to-use-gui-logins.html' title='Configure Linux to use GUI Logins'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-7294935202022392807</id><published>2012-01-24T18:28:00.001+05:30</published><updated>2015-06-18T22:39:46.222+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Solaris"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Oracle: Changing orcladmin password when expired</title><content type='html'>Problem:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orcladmin &amp;amp; other admin user passwords expired&lt;br /&gt;
&lt;br /&gt;
Solution&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Follow the steps below:&lt;br /&gt;
- Startup the OIDADMIN console (Infrastructure $ORACLE_HOME/bin/oidadmin)&lt;br /&gt;
$ORACLE_HOME refers to the Infrastructure database.&lt;br /&gt;
- Login as &quot;orcladmin&quot; user. If the password has not been modified, then, it is the same as the&lt;br /&gt;
&quot;ias_admin&quot; password specified during installation.&lt;br /&gt;
&lt;br /&gt;
After login, navigate as follows:&lt;br /&gt;
==&amp;gt; Entry Management&lt;br /&gt;
==&amp;gt; cn=OracleContext&lt;br /&gt;
==&amp;gt; dc=com&lt;br /&gt;
==&amp;gt; dc=oracle&lt;br /&gt;
==&amp;gt; dc=acme&lt;br /&gt;
==&amp;gt; cn = users&lt;br /&gt;
==&amp;gt; cn = &amp;lt;orcladmin&amp;gt;&lt;br /&gt;
==&amp;gt; scroll to the bottom of the screen and update &quot;userpassword&quot; field and APPLY.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can able to login with new password.</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/7294935202022392807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2012/01/oracle-changing-orcladmin-when-password.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/7294935202022392807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/7294935202022392807'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2012/01/oracle-changing-orcladmin-when-password.html' title='Oracle: Changing orcladmin password when expired'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-4519746382457275336</id><published>2011-12-29T18:31:00.001+05:30</published><updated>2015-06-18T22:39:46.156+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Useful xls document for Unit Conversion, Age Calculator, Railway Train Chart, Mobile Info, Health, BMI, etc...</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;a href=&quot;https://docs.google.com/open?id=0B84D74aUQO5DOTA4NDkzZjQtZGNkYy00NWRmLTg2NzMtNjcwYzFiNmE3N2Ez&quot;&gt;https://docs.google.com/open?id=0B84D74aUQO5DOTA4NDkzZjQtZGNkYy00NWRmLTg2NzMtNjcwYzFiNmE3N2Ez&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/4519746382457275336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/useful-xls-document-for-unit-conversion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/4519746382457275336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/4519746382457275336'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/useful-xls-document-for-unit-conversion.html' title='Useful xls document for Unit Conversion, Age Calculator, Railway Train Chart, Mobile Info, Health, BMI, etc...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-4296792493261276748</id><published>2011-12-29T16:46:00.001+05:30</published><updated>2015-06-18T22:39:46.150+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Building Enterprise Services with Drools Rule Engine</title><content type='html'>&lt;b style=&quot;color: #6fa8dc;&quot;&gt;Building Enterprise Services with Drools Rule Engine&lt;/b&gt;&amp;nbsp; &lt;a href=&quot;http://onjava.com/pub/a/onjava/2007/01/17/building-enterprise-services-with-drools-rule-engine.html&quot; target=&quot;_blank&quot;&gt;http://onjava.com/pub/a/onjava/2007/01/17/building-enterprise-services-with-drools-rule-engine.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/4296792493261276748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/building-enterprise-services-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/4296792493261276748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/4296792493261276748'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/building-enterprise-services-with.html' title='Building Enterprise Services with Drools Rule Engine'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-738808468558443815</id><published>2011-12-29T15:51:00.000+05:30</published><updated>2015-06-18T22:39:46.227+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Asynchronous Support in Servlet 3.0</title><content type='html'>One of the significant enhancements made in
&lt;a href=&quot;http://jcp.org/en/jsr/detail?id=315&quot; target=&quot;_blank&quot;&gt;JSR 315: Java Servlet 3.0&lt;/a&gt;,
 is support for asynchronous processing.
With this support, a servlet no longer has to wait for a response from a
 resource such as a database before its thread can continue
processing, that is, the thread is not blocked. Previous to Servlet 3.0,
 asynchronous support in the Java EE web container was
provided in a proprietary way — either through APIs built on top of the 
Servlet 2.5 API or through non-Servlet APIs or
implementations.
&lt;br /&gt;



In modern web applications there are times when you need to 
asynchronously handle some part of the request, so that the web 
container
can continue serving other requests in a seamless fashion. One example 
is a chat room application. In this type of application you
want to enable long-lived client connections with a servlet. You don&#39;t 
want a server thread to be blocked for a long period of time
serving a request from a single client. You want the servlet to process a
 request from the client and then free up the server thread
as quickly as possible for other work. In other words, you want the 
request to be processed and a response generated asynchronously.
&lt;br /&gt;



With the upcoming release of the Servlet 3.0 specification, standard asynchronous support has been added to the Servlet API.
This Tech Tip introduces the asynchronous support that has been added to the Servlet API in Java Servlet 3.0 technology.
It also includes a sample application that demonstrates those features.
&lt;br /&gt;


&lt;b&gt;Asynchronous Support Features&lt;/b&gt;&lt;br /&gt;



The primary features of the asynchronous support in Servlet 3.0 are as follows.
&lt;br /&gt;


&lt;b&gt;Annotation Attributes&lt;/b&gt;&lt;br /&gt;



Servlet 3.0 introduces the use of annotations as an alternative to deployment descriptors
for servlet-related configuration in a web application. Two of these annotations are &lt;code&gt;@WebServlet&lt;/code&gt;, which defines a servlet,
and &lt;code&gt;@WebFilter&lt;/code&gt;, which defines a servlet filter. Both of these annotations include an attribute, &lt;code&gt;asyncSupported&lt;/code&gt;.
Setting the &lt;code&gt;asyncSupported&lt;/code&gt; attribute to &lt;code&gt;true&lt;/code&gt;, declares that the servlet or servlet filter supports asynchronous
processing. For example, the following annotation defines a servlet in a web application and declares that the servlet supports
asynchronous processing:
&lt;br /&gt;



&lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

&lt;pre&gt;   @WebServlet(url=&quot;/foo&quot; asyncSupported=true)
&lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;


&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
The &lt;code&gt;asyncSupported&lt;/code&gt; attribute is needed to differentiate 
code written for synchronous processing from that written for use in
an asynchronous context. In fact, for an application to use the 
asynchronous feature, the entire request processing chain must have
the have this attribute set either through the annotation or in its 
deployment descriptor. An IllegalStateException will be thrown
if an application tries to start an asynchronous operation and there is a
 servlet or servlet filter in the request processing chain
that does not support asynchronous processing.
&lt;br /&gt;


&lt;b&gt;Servlet Request Methods&lt;/b&gt;&lt;br /&gt;


The support for asynchronous processing also includes new &lt;code&gt;ServletRequest&lt;/code&gt; methods, such as
&lt;code&gt;startAsync(servletRequest, servletResponse)&lt;/code&gt;, &lt;code&gt;startAsync()&lt;/code&gt;, and &lt;code&gt;getAsyncContext()&lt;/code&gt;. After you set the
&lt;code&gt;asyncSupported&lt;/code&gt; attribute in the request processing chain to support asynchronous processing, you call either the
&lt;code&gt;startAsync(servletRequest, servletResponse)&lt;/code&gt; or &lt;code&gt;startAsync()&lt;/code&gt; method to make an asynchronous request.
Here, for example, is a call that makes an asynchronous request:
&lt;br /&gt;



&lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

&lt;pre&gt;   AsyncContext aCtx = req.startAsync(req, res);
&lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;


&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
The difference between the two &lt;code&gt;startAsync&lt;/code&gt; method signatures is that the &lt;code&gt;startAsync()&lt;/code&gt; method implicitly uses
the original request and response, while the &lt;code&gt;startAsync(servletRequest, servletResponse)&lt;/code&gt;
 method uses the request and response
objects passed in the method call. The request and response passed in 
the call can be wrapped by filters or other servlets earlier in the
request processing chain. Notice that the &lt;code&gt;startAsync&lt;/code&gt; method returns an &lt;code&gt;AsyncContext&lt;/code&gt; object —
see &lt;a href=&quot;http://blogs.oracle.com/enterprisetechtips/entry/asynchronous_support_in_servlet_3#asynclass&quot;&gt;AsyncContext Class&lt;/a&gt; for more details. The &lt;code&gt;AsyncContext&lt;/code&gt;
 object is initialized appropriately
with the request and response objects depending on the method used. You 
must exercise caution when wrapping the response and calling the
no arguments signature of the &lt;code&gt;startAsync()&lt;/code&gt; method. You could lose the data if any of data is written to the wrapped
response and not flushed to the underlying response stream.
&lt;br /&gt;



There are a few more methods in the &lt;code&gt;ServletRequest&lt;/code&gt; class that are part of the support for asynchronous processing.
These include &lt;code&gt;isAsyncSupported()&lt;/code&gt; and &lt;code&gt;isAsyncStarted()&lt;/code&gt; You can use these convenience methods in an application
to determine if asynchronous operations are supported or started on a request.
&lt;br /&gt;


&lt;a href=&quot;&quot; name=&quot;asynclass&quot;&gt;&lt;/a&gt;
&lt;b&gt;AsyncContext Class&lt;/b&gt;&lt;br /&gt;


The &lt;code&gt;AsyncContext&lt;/code&gt; class is a new class in Servlet 3.0 that provides the execution context for an asynchronous operation.
The class provides a variety of methods that you can use to get access to the underlying request and response objects.
For example, you can use the &lt;code&gt;AsyncContext.dispatch()&lt;/code&gt;, &lt;code&gt;AsyncContext.dispatch(path)&lt;/code&gt;,
or &lt;code&gt;AsyncContext.dispatch(servletContext, path)&lt;/code&gt; method to dispatch the request to the container. Using any of the
&lt;code&gt;dispatch&lt;/code&gt; methods, enables the processing to return to the container after the asynchronous operation that was started on the &lt;code&gt;ServletRequest&lt;/code&gt;
 is
completed — for instance,  after waiting for a call to a web service to 
return. These methods dispatch the request back to the container
so you can use frameworks such as JavaServer Pages (JSP) to generate the
 response.&lt;br /&gt;
&lt;br /&gt;



The &lt;code&gt;dispatch()&lt;/code&gt; method, that is, the method with no arguments, forwards the request back to the original URL.
Also, if a call to &lt;code&gt;AsyncContext.dispatch&lt;/code&gt; or &lt;code&gt;RequestDispatcher.forward&lt;/code&gt; occurs after an asynchronous context
has been initialized, the &lt;code&gt;dispatch()&lt;/code&gt; method forwards the request to the path for the &lt;code&gt;AsyncContext&lt;/code&gt;
or &lt;code&gt;RequestDispatcher&lt;/code&gt;-related requests.
&lt;br /&gt;



The &lt;code&gt;dispatch(path)&lt;/code&gt; method forwards the request to the path relative to the context of the request.
&lt;br /&gt;



The &lt;code&gt;dispatch(ServletContext, path)&lt;/code&gt; method forwards the request to the path relative to the specified context.
For example, here is a call that forwards the request back to the container so that the JSP framework can generate the response.
&lt;br /&gt;



&lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

&lt;pre&gt;   ctx.dispatch(&quot;/render.jsp&quot;);
&lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;


&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
Another &lt;code&gt;AsyncContext&lt;/code&gt; method, &lt;code&gt;complete()&lt;/code&gt;, completes the asynchronous operation that was started on the request that
was used to initialize this &lt;code&gt;AsyncContext&lt;/code&gt; object. It closes the response that was used to initialize this &lt;code&gt;AsyncContext&lt;/code&gt;
object. You can call this method, for example, when the response generated by the asynchronous operation is complete.
The container can also implicitly call this method if the application dispatches the request back to the container using the &lt;code&gt;forward&lt;/code&gt;
method with no subsequent &lt;code&gt;startAsync&lt;/code&gt; call on the request.
&lt;br /&gt;


&lt;b&gt;Asynchronous Listener Class&lt;/b&gt;&lt;br /&gt;


Servlet 3.0 also adds a new listener class for asynchronous processing, &lt;code&gt;AsyncListener&lt;/code&gt;.
 You can use this class in an
application to get notified when asynchronous processing is completed, 
if a timeout has occurred, an error has occurred, or a subsequent call
to &lt;code&gt;startAsync&lt;/code&gt; has occurred. The following code snippet creates a new &lt;code&gt;AsyncListener&lt;/code&gt; object and uses it to
get notified when an asynchronous processing operation is completed .
&lt;br /&gt;



&lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

&lt;pre&gt;   AsyncContext ac = req.startAsync();
   req.addAsyncListener(new AsyncListener() {
      public void onComplete(AsyncEvent event) throws IOException {
         ...
      }
   ...
   }
&lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;


&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
Notice that the parameter passed to the &lt;code&gt;onComplete&lt;/code&gt; method is an &lt;code&gt;AsyncEvent&lt;/code&gt; object. The
&lt;code&gt;AsyncEvent&lt;/code&gt; class is another new class provided as part of the Servlet 3.0 support for asynchronous processing.
It represents an event that gets fired when the asynchronous operation initiated on a &lt;code&gt;ServletRequest&lt;/code&gt;
has completed, timed out, or produced an error.
&lt;br /&gt;


&lt;b&gt;A Simple Application That Uses the Asynchronous Support in Servlet 3.0&lt;/b&gt;&lt;br /&gt;



Now that you&#39;ve seen the key features in the Servlet 3.0 support for asynchronous processing, let&#39;s look at a more complete
example. The following shows the code for a simple web application. In the application, a servlet makes an asynchronous request
to a web service, waits for the call to return, and then dispatches the request back to the container to render the result
using JSP. Note that the complete code for servlet is not shown.
&lt;br /&gt;



&lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

&lt;pre&gt;   @WebServlet(&quot;/foo&quot; asyncSupported=true)
   public class MyServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse res) {
            ...
            AsyncContext aCtx = request.startAsync(req, res);
            ScheduledThreadPoolExecutor executor = new ThreadPoolExecutor(10);
            executor.execute(new AsyncWebService(aCtx));
        }
   }

   public class AsyncWebService implements Runnable {
        AsyncContext ctx;
        public AsyncWebService(AsyncContext ctx) {
            this.ctx = ctx;
        }
        public void run() {
            // Invoke web service and save result in request attribute
            // Dispatch the request to render the result to a JSP.
            ctx.dispatch(&quot;/render.jsp&quot;);
   }
}
&lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;


&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b&gt;Sample Application &lt;/b&gt;&lt;br /&gt;



One of the sample applications provided with the &lt;a href=&quot;http://java.sun.com/javaee/downloads/&quot;&gt;Java EE 6 SDK&lt;/a&gt;
is a chat application that uses the asynchronous support in Servlet 3.0.
&lt;br /&gt;



To run the application, do the following:
&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;If you haven&#39;t already done so, download the &lt;a href=&quot;http://java.sun.com/javaee/downloads/&quot;&gt;Java EE 6 SDK&lt;/a&gt;. Also be sure to have an installed version of the
&lt;a href=&quot;http://java.sun.com/javase/downloads/index.jsp&quot;&gt;Java Platform Standard Edition (Java SE) 6 SDK&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Download the sample application,
&lt;a href=&quot;http://blogs.sun.com/enterprisetechtips/resource/async-request-war.war&quot;&gt;async-request-war.war&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Start the GlassFish v3 application server that is packaged with the Java EE 6 SDK by entering the
following command:


&lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

&lt;pre&gt;   &amp;lt;javaee_home&amp;gt;/bin/asadmin start-domain
&lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;


&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
where &lt;code&gt;&amp;lt;javaee_home&amp;gt;&lt;/code&gt; is where you installed the Java EE 6 SDK.
&lt;/li&gt;
&lt;li&gt;Deploy the sample application by copying it to the &lt;code&gt;&amp;lt;javaee_home&amp;gt;/domains/domain1/autodeploy directory.
&lt;/code&gt;&lt;/li&gt;
&lt;code&gt;
&lt;li&gt;Execute the application by opening two browser windows. For simplicity, let&#39;s call them say Browser A and Browser B.
 &lt;ul&gt;
&lt;li&gt;Point both Browser A and Browser B to the URL http://localhost:8080/async_request_war. In response, you should see
  a chat user interface (UI) in each browser window. The UI presents a text area to view chat entries, a text field to
  enter a user ID, and a Login button.&lt;/li&gt;
&lt;li&gt;In Browser A, enter a user name, say &quot;userA&quot;, in the text field and click the Login button. You should see
  the following message appear in the text area:
   
   &lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

   &lt;pre&gt;      System Message:
      userA has joined.
   &lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
   &lt;tbody&gt;
&lt;tr&gt;
   
   
   &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
You should also see a new text area for posting messages to the chat and a button labeled Post Message.
  
  &lt;/li&gt;
&lt;li&gt;
  Login as &quot;userB&quot; in Browser B. You should see the following message appear in both browser windows:
   
 &lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

 &lt;pre&gt;       System Message:
       userB has joined.
 &lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
 
 
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
The text area for posting messages and the Post Message button should appear in Browser B.
  
  Now, you&#39;re ready to chat.
  &lt;br /&gt;

  &lt;/li&gt;
&lt;li&gt;In Browser A, enter &quot;Hello&quot; in the text box and click the Post Message button.
  You should see the following message in both Browser A and Browser B:
    
    &lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

    &lt;pre&gt;       userA:
       Hello
    &lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
    
    
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;In Browser B, enter &quot;Hello&quot; in the text box and click the Post Message button.
  You should see the following message in both Browser A and Browser B:
  
  &lt;div style=&quot;overflow: auto; width: 600px;&quot;&gt;

  &lt;pre&gt;       userB:
       Hello
    &lt;/pre&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
    
    
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/code&gt;&lt;/ol&gt;
&lt;code&gt;


You can view the source code for the application in the &lt;code&gt;&amp;lt;javaee_home&amp;gt;/samples/javaee6/web/servlet/async-request-war/src&lt;/code&gt;
directory.
&lt;br /&gt;



&lt;b&gt;Further Reading&lt;/b&gt;&lt;br /&gt;



For more information, see the following resources:
&lt;br /&gt;


&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://jcp.org/en/jsr/detail?id=315&quot; target=&quot;_blank&quot;&gt;JSR 315: Java Servlet 3.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://java.sun.com/products/servlet/index.jsp&quot;&gt;Java Servlet Technology&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/738808468558443815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/asynchronous-support-in-servlet-30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/738808468558443815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/738808468558443815'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/asynchronous-support-in-servlet-30.html' title='Asynchronous Support in Servlet 3.0'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-3620816036833217431</id><published>2011-12-29T15:48:00.003+05:30</published><updated>2015-06-18T22:39:46.145+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Creating ZIP and JAR Files in Java</title><content type='html'>ZIP files offer a packaging mechanism, allowing multiple files 
to be bundled together as one. Thus, when you need to download a group of files 
from the web, you can package them into one ZIP file for easier transport as a 
single file. The bundling can include additional information like directory 
hierarchy, thus preserving necessary paths for an application or series of 
resources once unbundled.

&lt;br /&gt;
This tip will address three aspects of ZIP file usage: 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;creating them
&lt;/li&gt;
&lt;li&gt;adding files to them
&lt;/li&gt;
&lt;li&gt;compressing those added files
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Creating Zip Streams&lt;/h2&gt;
The &lt;code&gt;ZipOutputStream&lt;/code&gt; offers a stream for compressing the outgoing bytes. There is a single constructor for &lt;code&gt;ZipOutputStream&lt;/code&gt;, one that accepts another &lt;code&gt;OutputStream&lt;/code&gt;:

&lt;br /&gt;
&lt;pre&gt;public ZipOutputStream(OutputStream out)
&lt;/pre&gt;
If the constructor argument is the type &lt;code&gt;FileOutputStream&lt;/code&gt;, then 
the compressed bytes written by the &lt;code&gt;ZipOutputStream&lt;/code&gt; will be saved to a file. 
However, you aren&#39;t limited to using the &lt;code&gt;ZipOutputStream&lt;/code&gt; with a file. You can also use the &lt;code&gt;OutputStream&lt;/code&gt; that comes from a socket connection or some other non-file-oriented stream. Thus, for a file-oriented &lt;code&gt;ZipOutputStream&lt;/code&gt;, the typical usage will look like this:

&lt;br /&gt;
&lt;pre&gt;String path = &quot;afile.zip&quot;; 
FileOutputStream fos = new FileOutputStream(path);
ZipOutputStream zos = new ZipOutputStream(fos);
&lt;/pre&gt;
&lt;h2&gt;
Adding Entries&lt;/h2&gt;
Once created, you don&#39;t just write bytes to a &lt;code&gt;ZipOutputStream&lt;/code&gt;. Instead, you need to treat the output stream as a collection of components. Each component of a &lt;code&gt;ZipOutputStream&lt;/code&gt; is paired with a &lt;code&gt;ZipEntry&lt;/code&gt;. It is this &lt;code&gt;ZipEntry&lt;/code&gt; that you create and then add to the &lt;code&gt;ZipOutputStream&lt;/code&gt; before actually writing its contents to the stream.

&lt;br /&gt;
&lt;pre&gt;String name = ...; 
ZipEntry entry = new ZipEntry(name);
zos.putNextEntry(entry);
zos.write(&amp;lt;&amp;lt; all the bytes for entry &amp;gt;&amp;gt;); 
&lt;/pre&gt;
Each entry serves as a marker in the overall stream, where you&#39;ll find the
bytes related to the entry in the library file. After the ZIP file has been
created, when you need to get the entry contents back, just ask for the related
input stream:

&lt;br /&gt;
&lt;pre&gt;ZipFile zip = new ZipFile(&quot;afile.zip&quot;); 
ZipEntry entry = zip.getEntry(&quot;anEntry.name&quot;);
InputStream is = zip.getInputStream(entry);
&lt;/pre&gt;
Now that you&#39;ve seen how to create the zip file and add entries to that file, 
it is important to point out that the &lt;code&gt;java.util.zip&lt;/code&gt; libraries offer some level of control for the added entries of the &lt;code&gt;ZipOutputStream&lt;/code&gt;. First, the order you add entries to the &lt;code&gt;ZipOutputStream&lt;/code&gt; is the order they are physically located in the .zip file. You can manipulate the enumeration of entries returned back by the &lt;code&gt;entries()&lt;/code&gt; method of &lt;code&gt;ZipFile&lt;/code&gt;
 to produce a list in alphabetical or size order, but the entries are 
still stored in the order they were written to the output stream. 

&lt;br /&gt;
&lt;h2&gt;
Compressing Files&lt;/h2&gt;
Files added to a ZIP/JAR file are compressed individually. Unlike Microsoft &lt;code&gt;CAB&lt;/code&gt;
 files which compress the library package as a whole, files in a ZIP/JAR
 file are each compressed or not compressed separately. Before adding a &lt;code&gt;ZipEntry&lt;/code&gt; to the &lt;code&gt;ZipOutputStream&lt;/code&gt;, you determine whether its associated bytes are compressed. The &lt;code&gt;setMethod&lt;/code&gt; method of &lt;code&gt;ZipEntry&lt;/code&gt; allows you to specify which of the two available compression formats to use. Use the &lt;code&gt;STORED&lt;/code&gt; constant of &lt;code&gt;ZipEntry&lt;/code&gt; to give you an uncompressed file and the &lt;code&gt;DEFLATED&lt;/code&gt; setting
for a compressed version. You cannot control the compression efficiency. That 
depends on the type of data in the associated entry. Straight 
text can be compressed to around 80% of its size quite easily, whereas MP3 or JPEG
data will be compressed much less.

&lt;br /&gt;
While you might think it obvious that everything should be compressed, it does 
take time to compress and uncompress a file. If the task of compressing is too 
costly a task to do at the point of creation, it may sometimes be better to 
just store the data of the whole file in a &lt;code&gt;STORED&lt;/code&gt; format, 
which just stores the raw bytes. The same can be said of the time cost 
of uncompression. Of course, uncompressed files are larger, and you have
 to pay the cost with either higher disk space usage or bandwidth when 
transferring file. Keep in mind that you 
need to change the setting for each entry, not the &lt;code&gt;ZipFile&lt;/code&gt; as a whole. 
However, it is more typical to compress or not compress a whole &lt;code&gt;ZipFile&lt;/code&gt;, as opposed to different settings for each entry.

&lt;br /&gt;
There is one key thing you need to know if you use the &lt;code&gt;STORED&lt;/code&gt; constant for the compression method: you must explicitly set certain attributes of the &lt;code&gt;ZipEntry&lt;/code&gt;
 which are automatically set when the entry is compressed. These are the
 size, compressed size, and the checksum of the entry&#39;s input stream. 
Assuming an input file, the size and compressed size can just be the 
file size. To compute the checksum, use the CRC32 class in the &lt;code&gt;java.util.zip&lt;/code&gt; package. You cannot just pass in 0 or -1 to ignore the checksum value; the CRC value will 
be used to validate your input when creating the ZIP and when reading from it 
later.

&lt;br /&gt;
&lt;pre&gt;ZipEntry entry = new ZipEntry(name);
entry.setMethod(ZipEntry.STORED);
entry.setCompressedSize(file.length());
entry.setSize(file.length());
CRC32 crc = new CRC32();
crc.update(&amp;lt;&amp;lt; all the bytes for entry &amp;gt;&amp;gt;); 
entry.setCrc(crc.getValue());
zos.putNextEntry(entry);
&lt;/pre&gt;
To demonstrate, the following program will combine a series of files  
using the &lt;code&gt;STORED&lt;/code&gt; compression method. The first argument to 
the program will be the ZIP file to create. Remaining arguments 
represent the files to add. If the ZIP file to create already exists, 
the program will exit without modifying the
file. If you add a non-existing file to the ZIP file, the program will 
skip
the non-existing file, adding any remaining command line arguments to 
the 
created ZIP. 

&lt;br /&gt;
&lt;pre&gt;import java.util.zip.\*;
import java.io.\*;

public class ZipIt {
    public static void main(String args[]) throws IOException {
        if (args.length &amp;lt; 2) {
            System.err.println(&quot;usage: java ZipIt Zip.zip file1 file2 file3&quot;);
            System.exit(-1);
        }
        File zipFile = new File(args[0]);
        if (zipFile.exists()) {
            System.err.println(&quot;Zip file already exists, please try another&quot;);
            System.exit(-2);
        }
        FileOutputStream fos = new FileOutputStream(zipFile);
        ZipOutputStream zos = new ZipOutputStream(fos);
        int bytesRead;
        byte[] buffer = new byte[1024];
        CRC32 crc = new CRC32();
        for (int i=1, n=args.length; i &amp;lt; n; i++) {
            String name = args[i];
            File file = new File(name);
            if (!file.exists()) {
                System.err.println(&quot;Skipping: &quot; + name);
                continue;
            }
            BufferedInputStream bis = new BufferedInputStream(
                new FileInputStream(file));
            crc.reset();
            while ((bytesRead = bis.read(buffer)) != -1) {
                crc.update(buffer, 0, bytesRead);
            }
            bis.close();
            // Reset to beginning of input stream
            bis = new BufferedInputStream(
                new FileInputStream(file));
            ZipEntry entry = new ZipEntry(name);
            entry.setMethod(ZipEntry.STORED);
            entry.setCompressedSize(file.length());
            entry.setSize(file.length());
            entry.setCrc(crc.getValue());
            zos.putNextEntry(entry);
            while ((bytesRead = bis.read(buffer)) != -1) {
                zos.write(buffer, 0, bytesRead);
            }
            bis.close();
        }
        zos.close();
    }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;For More info&lt;/span&gt;&lt;/b&gt;&amp;nbsp; &lt;a href=&quot;http://blogs.oracle.com/CoreJavaTechTips/entry/creating_zip_and_jar_files&quot; target=&quot;_blank&quot;&gt;Creating Zip &amp;amp; Jar Files in Java&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/3620816036833217431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/creating-zip-and-jar-files-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/3620816036833217431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/3620816036833217431'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/creating-zip-and-jar-files-in-java.html' title='Creating ZIP and JAR Files in Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-54260908797164677</id><published>2011-12-29T14:31:00.001+05:30</published><updated>2015-06-18T22:39:46.169+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Using Callable to Return Results From Runnables</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;The Runnable interface has been around since the beginning of time for the Java platform. It allows you to define a task to be completed by a thread. As most people probably know already, it offers a single method run() that accepts no arguments and returns no values, nor can it throw any checked exceptions. If you need to get a value back from the now-completed task, you must use a method outside the interface and wait for some kind of notification message that the task completed. For example, the following demonstrates what you might do for just such a scenario: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  Runnable runnable = ...;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  Thread t = new Thread(runnable);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  t.start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  t.join();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  String value = someMethodtoGetSavedValue()&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Nothing is inherently wrong with this code, but it can be done differently now, thanks to the Callable interface introduced in J2SE 5.0. Instead of having a run() method, the Callable interface offers a call() method, which can return an Object or, more specifically, any type that is introduced in the genericized form: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  public interface Callable&amp;lt;V&amp;gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;     V call() throws Exception;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Because you cannot pass a Callable into a Thread to execute, you instead use the ExecutorService to execute the Callable object. The service accepts Callable objects to run by way of the submit() method: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  &amp;lt;T&amp;gt; Future&amp;lt;T&amp;gt; submit(Callable&amp;lt;T&amp;gt; task)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;As the method definition shows, submitting a Callable object to the ExecutorService returns a Future object. The get() method of Future will then block until the task is completed. This is the equivalent of the join() call in the first example. Actually, it is the equivalent of both the join() call and the get value call as get() returns the value calculated by the Callable instance. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;To demonstrate, the following example creates separate Callable instances for each word passed in on the command line and sums up their length. Each Callable will just calculate the sum of its individual word. The set of Future objects are saved to acquire the calculated value from each. If the order of the returned values needed to be preserved, a List could be used instead. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;import java.util.\*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;import java.util.concurrent.\*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;public class CallableExample {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  public static class WordLengthCallable&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;        implements Callable {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    private String word;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    public WordLengthCallable(String word) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;      this.word = word;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    public Integer call() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;      return Integer.valueOf(word.length());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  public static void main(String args[]) throws Exception {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    ExecutorService pool = Executors.newFixedThreadPool(3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    Set&amp;lt;Future&amp;lt;Integer&amp;gt;&amp;gt; set = new HashSet&amp;lt;Future&lt;span style=&#39;font-family:&quot;Cambria Math&quot;,&quot;serif&quot;&#39;&gt;≶&lt;/span&gt;Integer&amp;gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    for (String word: args) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;      Callable&amp;lt;Integer&amp;gt; callable = new WordLengthCallable(word);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;      Future&amp;lt;Integer&amp;gt; future = pool.submit(callable);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;      set.add(future);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    int sum = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    for (Future&amp;lt;Integer&amp;gt; future : set) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;      sum += future.get();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    System.out.printf(&amp;quot;The sum of lengths is %s%n&amp;quot;, sum);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;    System.exit(sum);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;  }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;The WordLengthCallable saves each word and uses the word&#39;s length as the value returned by the call() method. This value could take some time to generate but in this case is known immediately. The only requirement of call() is the value is returned at the end of the call. When the get() method of Future is later called, the Future will either have the value immediately if the task runs quickly, as in this case, or will wait until the value is done generating. Multiple calls to get() will not cause the task to be rerun in the thread. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Because the goal of the program is to calculate the sum of all word lengths, it doesn&#39;t matter in which order the Callable tasks finish. It is perfectly OK if the last task completes before the first three. The first get() call to Future will just wait for the first task in the Set to complete. This does not block other tasks from running to completion separately. It is just waiting for that one thread or task to complete. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;For more information on the use of executors and thread pools, see the &lt;a href=&quot;http://java.sun.com/tutorial/essential/concurrency/executors.html&quot;&gt;Executors lesson&lt;/a&gt; in the Java Tutorial.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/54260908797164677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/using-callable-to-return-results-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/54260908797164677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/54260908797164677'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/using-callable-to-return-results-from.html' title='Using Callable to Return Results From Runnables'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-7876349436456827664</id><published>2011-12-29T14:21:00.001+05:30</published><updated>2015-06-18T22:39:46.231+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Using Generics With Wildcards and Extends</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;J2SE 5.0 introduced generics to the Java programming. Generics allow for the identification of what you want to store in a collection. So instead of saying that your program has a &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;List&lt;/span&gt;&lt;/code&gt; of &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;Objects&lt;/span&gt;&lt;/code&gt;, you can now specify that you have a &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;List&lt;/span&gt;&lt;/code&gt; of &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;String&lt;/span&gt;&lt;/code&gt; objects or some other class type. Then, if you accidentally try to add something to the &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;List&lt;/span&gt;&lt;/code&gt; that is of the wrong type, the compiler notifies you of the error and it can be fixed at compile time, rather than having to wait until you run the program and the program reaches the point in code where the fetch operation produces a runtime casting exception. Iterators now become typesafe. The &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;next()&lt;/span&gt;&lt;/code&gt; method of the &lt;code&gt;&lt;span style=&#39;font-size:10.0pt&#39;&gt;Iterator&lt;/span&gt;&lt;/code&gt; interface returns the typesafe version of the next element of the collection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Most people don&#39;t fully understand the use of the extends keyword when using generics. A typical example shown to explain the use of extends has to do with drawing shapes. Instead, this tech tip will use an example that uses Swing components so that you do not have to create extra new classes. In a very limited case, the class hierarchy for Swing button components is shown here, with Object as the real root: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Component&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;|- Container&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp; |- JComponent&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- AbstractButton&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JButton&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JMenuItem&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JCheckBoxMenuItem&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JMenu&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JRadioButtonMenuItem&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JToggleButton&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JCheckBox&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |- JRadioButton&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;One thing that all AbstractButton subclasses share in common is a getText() method. So in the spirit of generics, you can define a method that takes a List of AbstractButton items and return a List of the String labels of those buttons. Here&#39;s the first version of such a method: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; public static List&amp;lt;String&amp;gt; getLabels(List&amp;lt;AbstractButton&amp;gt; list) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;String&amp;gt; labelList = new ArrayList&amp;lt;String&amp;gt;(list.size());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (AbstractButton button: list) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labelList.add(button.getText());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return labelList;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;And here is how you might use the method. First, define a List of AbstractButton types, fill it up, and call the method: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; List&amp;lt;AbstractButton&amp;gt; buttonList =&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new ArrayList&amp;lt;AbstractButton&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; buttonList.add(new JButton(&amp;quot;Hello&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; buttonList.add(new JCheckBox(&amp;quot;World&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; buttonList.add(new JRadioButton(&amp;quot;Hola&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; buttonList.add(new JMenuItem(&amp;quot;Mundo&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; List labels = getLabels(buttonList);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; System.out.println(labels);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;quot;Hola, Mundo&amp;quot; is the Spanish translation of &amp;quot;Hello, World,&amp;quot; according to Google. The results of the println() call is as follows: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;[Hello, World, Hola, Mundo]&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;With a List of AbstractButtons, everything functions fine, but this breaks down when the List is of something else, specifically a subclass. One would logically think that with a List of JButton items, everything would work fine, because JButton is a subclass of AbstractButton. Shouldn&#39;t you be able to call getLabels(List&amp;lt;AbstractButton&amp;gt;) with a List of a subclass of AbstractButton? &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; List&amp;lt;JButton&amp;gt; buttonList = ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; // ... Fill list ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; List&amp;lt;String&amp;gt; labels = getLabels(buttonList);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Well, that isn&#39;t the case. Because this is a compile-time check, and because the definition of getLabels() is defined to accept only an AbstractButton List, you cannot pass anything else to it. The compilation-time error message follows: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;GetList.java:13: getLabels(java.util.List&amp;lt;javax.swing.AbstractButton&amp;gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; in GetList cannot be applied to (java.util.List&amp;lt;javax.swing.JButton&amp;gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;String&amp;gt; labels = getLabels(buttonList);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \^&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;1 error&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;And this is where the extends keyword comes in handy. Instead of defining the getLabels() method to accept only an AbstractButton list, define it to accept any List of AbstractButton subclasses: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static List&amp;lt;String&amp;gt; getLabels(&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;? extends AbstractButton&amp;gt; list) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;The wildcard ? here says that the method doesn&#39;t care what the exact class type is, as long as it is a subclass of AbstractButton. Here&#39;s a complete example that puts all the pieces together: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;import java.util.\*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;import javax.swing.\*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;public class GetList {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; public static void main(String args[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;JButton&amp;gt; buttonList =&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new ArrayList&amp;lt;JButton&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buttonList.add(new JButton(&amp;quot;Hello&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buttonList.add(new JButton(&amp;quot;World&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buttonList.add(new JButton(&amp;quot;Hola&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buttonList.add(new JButton(&amp;quot;Mundo&amp;quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List labels = getLabels(buttonList);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(labels);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; public static List&amp;lt;String&amp;gt; getLabels(&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;? extends AbstractButton&amp;gt; list) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;String&amp;gt; labelList = new ArrayList&amp;lt;String&amp;gt;(list.size());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (AbstractButton button: list) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labelList.add(button.getText());&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return labelList;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;Now, when you are defining your own classes and methods with generics and are thinking of accepting an abstract class as the generic argument, or any superclass, remember to use wildcards so that the same method works best with subclasses too. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/7876349436456827664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/using-generics-with-wildcards-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/7876349436456827664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/7876349436456827664'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/using-generics-with-wildcards-and.html' title='Using Generics With Wildcards and Extends'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-2510492496261261000</id><published>2011-12-29T11:37:00.001+05:30</published><updated>2015-06-18T22:39:46.140+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Solaris"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Oracle 11g R2 Recovering database on Solaris 10 : ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr]</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;b&gt;ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr]&lt;/b&gt;&lt;br&gt; &lt;br&gt; &lt;br&gt; I have an Oracle 11g R2 database on a Solaris 10. I got this error many times, it was due to Solaris illegal shutdown.&lt;br&gt; &lt;br&gt; Here are the steps I performed to resolve this error&lt;br&gt; &lt;br&gt; Launch SQL Plus from Oracle\bin folder ( not from Client folder)&lt;br&gt; &lt;br&gt; SQL&amp;gt; conn sys/sys as sysdba&lt;br&gt; &lt;br&gt; Connected to an idle instance.&lt;br&gt; &lt;br&gt; SQL&amp;gt; startup mount&lt;br&gt; &lt;br&gt; ORACLE instance started.&lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database recover;&lt;br&gt; &lt;br&gt; Database altered.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database open;&lt;br&gt; &lt;br&gt; alter database open&lt;br&gt; &lt;br&gt; *&lt;br&gt; &lt;br&gt; ERROR at line 1:&lt;br&gt; &lt;br&gt; ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1],&lt;br&gt; &lt;br&gt; [136], [65730], [65738], [], [], [], [], [], [], []&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; shutdown immediate;&lt;br&gt; &lt;br&gt; ORACLE instance shut down.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; startup mount&lt;br&gt; &lt;br&gt; ORACLE instance started.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database recover until cancel using backup controlfile;&lt;br&gt; &lt;br&gt; alter database recover until cancel using backup controlfile&lt;br&gt; &lt;br&gt; *&lt;br&gt; &lt;br&gt; ERROR at line 1:&lt;br&gt; &lt;br&gt; ORA-00279: change 3997604 generated at 02/11/2011 21:08:59 needed for thread 1&lt;br&gt; ORA-00289: suggestion :&lt;br&gt; C:\APP\RMANNI\RECOVERY_AREA\ORCLDB11G\ARCHIVELOG\2011_02_14\O1_MF_1_136_%U_.ARC&lt;br&gt; ORA-00280: change 3997604 for thread 1 is in sequence #136&lt;br&gt; &lt;br&gt; Since my database is not running in archive log mode, I couldn&#39;t find the file specified in the above error message. I proceeded with the following&lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database recover continue default;&lt;br&gt; &lt;br&gt; alter database recover continue default&lt;br&gt; &lt;br&gt; *&lt;br&gt; &lt;br&gt; ERROR at line 1:&lt;br&gt; &lt;br&gt; ORA-00308: cannot open archived log&lt;br&gt; &lt;br&gt; &#39;C:\APP\RMANNI\RECOVERY_AREA\ORCLDB11G\ARCHIVELOG\2011_02_14\O1_MF_1_136_%U_.ARC&#39;&lt;br&gt; &lt;br&gt; ORA-27041: unable to open file&lt;br&gt; &lt;br&gt; OSD-04002: unable to open file&lt;br&gt; &lt;br&gt; O/S-Error: (OS 2) The system cannot find the file specified.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database recover cancel;&lt;br&gt; &lt;br&gt; Database altered.&lt;br&gt; &lt;br&gt; &lt;br&gt; If the above step errored out, then proceed with the lines shown below inbetween the dotted lines, if not&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database open resetlogs;&lt;br&gt; &lt;br&gt; Database altered.&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; Your database is good to go, You should now be able to connect&lt;br&gt; &lt;br&gt; &lt;br&gt; -----------If Alter database recover cancel Failed ------------------&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database recover cancel;&lt;br&gt; &lt;br&gt; alter database recover cancel&lt;br&gt; &lt;br&gt; *&lt;br&gt; &lt;br&gt; ERROR at line 1:&lt;br&gt; &lt;br&gt; ORA-10879: error signaled in parallel recovery slave&lt;br&gt; &lt;br&gt; ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below&lt;br&gt; &lt;br&gt; ORA-01194: file 1 needs more recovery to be consistent&lt;br&gt; &lt;br&gt; ORA-01110: data file 1: &#39;C:\APP\RMANNI\ORADATA\ORCLDB\SYSTEM01.DBF&#39;&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; recover database using backup controlfile until cancel;&lt;br&gt; &lt;br&gt; ORA-00275: media recovery has already been started&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; shutdown immediate;&lt;br&gt; &lt;br&gt; ORACLE instance shut down.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; startup mount&lt;br&gt; &lt;br&gt; ORACLE instance started.&lt;br&gt; &lt;br&gt; &lt;br&gt; Now, when you try to recover, Oracle will provide a suggestion,provide the path for your REDO log files. One of the log files will fix your database. I started with Redo03, but Redo01 fixed my database. You probably don&#39;t need to shutdown and restart the database for each Redo log flies.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; recover database using backup controlfile until cancel;&lt;br&gt; &lt;br&gt; &lt;br&gt; ORA-00279: change 2448238 generated at 11/16/2010 22:05:53 needed for thread 1&lt;br&gt; &lt;br&gt; ORA-00289: suggestion :&lt;br&gt; &lt;br&gt; C:\APP\RMANNI\FLASH_RECOVERY_AREA\ORCLDB\ARCHIVELOG\2011_02_14\O1_MF_1_67_%U_.ARC&lt;br&gt; &lt;br&gt; ORA-00280: change 2448238 for thread 1 is in sequence #67&lt;br&gt; &lt;br&gt; &lt;br&gt; Specify log: {=suggested &lt;br&gt; filename &lt;br&gt; AUTO &lt;br&gt; CANCEL}&lt;br&gt; &lt;br&gt; C:\app\rmanni\oradata\ORCLDB\REDO03.LOG&lt;br&gt; &lt;br&gt; ORA-00310: archived log contains sequence 66; sequence 67 required&lt;br&gt; &lt;br&gt; ORA-00334: archived log: &#39;C:\APP\RMANNI\ORADATA\ORCLDB\REDO03.LOG&#39;&lt;br&gt; &lt;br&gt; ORA-10879: error signaled in parallel recovery slave&lt;br&gt; &lt;br&gt; ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below&lt;br&gt; &lt;br&gt; ORA-01194: file 1 needs more recovery to be consistent&lt;br&gt; &lt;br&gt; ORA-01110: data file 1: &#39;C:\APP\RMANNI\ORADATA\ORCLDB\SYSTEM01.DBF&#39;&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; shutdown immediate;&lt;br&gt; &lt;br&gt; ORACLE instance shut down.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; startup mount&lt;br&gt; &lt;br&gt; ORACLE instance started.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; recover database using backup controlfile until cancel;&lt;br&gt; &lt;br&gt; ORA-00279: change 2448238 generated at 11/16/2010 22:05:53 needed for thread 1&lt;br&gt; &lt;br&gt; ORA-00289: suggestion :&lt;br&gt; &lt;br&gt; C:\APP\RMANNI\FLASH_RECOVERY_AREA\ORCLDB\ARCHIVELOG\2011_02_14\O1_MF_1_67_%U_.ARC&lt;br&gt; &lt;br&gt; ORA-00280: change 2448238 for thread 1 is in sequence #67&lt;br&gt; &lt;br&gt; &lt;br&gt; Specify log: {=suggested filename AUTO CANCEL}&lt;br&gt; &lt;br&gt; C:\app\rmanni\oradata\ORCLDB\REDO02.LOG&lt;br&gt; &lt;br&gt; ORA-00310: archived log contains sequence 65; sequence 67 required&lt;br&gt; &lt;br&gt; ORA-00334: archived log: &#39;C:\APP\RMANNI\ORADATA\ORCLDB\REDO02.LOG&#39;&lt;br&gt; &lt;br&gt; ORA-10879: error signaled in parallel recovery slave&lt;br&gt; &lt;br&gt; ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below&lt;br&gt; &lt;br&gt; ORA-01194: file 1 needs more recovery to be consistent&lt;br&gt; &lt;br&gt; ORA-01110: data file 1: &#39;C:\APP\RMANNI\ORADATA\ORCLDB\SYSTEM01.DBF&#39;&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; Shutdown immediate;&lt;br&gt; &lt;br&gt; ORACLE instance shut down.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; startup mount;&lt;br&gt; &lt;br&gt; ORACLE instance started.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; recover database using backup controlfile until cancel;&lt;br&gt; &lt;br&gt; ORA-00279: change 2448238 generated at 11/16/2010 22:05:53 needed for thread 1&lt;br&gt; &lt;br&gt; ORA-00289: suggestion :&lt;br&gt; &lt;br&gt; C:\APP\RMANNI\FLASH_RECOVERY_AREA\ORCLDB\ARCHIVELOG\2011_02_14\O1_MF_1_67_%U_.ARC&lt;br&gt; &lt;br&gt; ORA-00280: change 2448238 for thread 1 is in sequence #67&lt;br&gt; &lt;br&gt; &lt;br&gt; Specify log: {=suggested filename AUTO CANCEL}&lt;br&gt; &lt;br&gt; C:\app\rmanni\oradata\ORCLDB\REDO01.log&lt;br&gt; &lt;br&gt; Log applied.&lt;br&gt; &lt;br&gt; Media recovery complete.&lt;br&gt; &lt;br&gt; &lt;br&gt; SQL&amp;gt; alter database open resetlogs;&lt;br&gt; &lt;br&gt; Database altered.&lt;br&gt; &lt;br&gt; -----------If Alter database recover cancel Failed ------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/2510492496261261000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/oracle-11g-r2-recovering-database-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/2510492496261261000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/2510492496261261000'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/oracle-11g-r2-recovering-database-on.html' title='Oracle 11g R2 Recovering database on Solaris 10 : ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-6573758771564784712</id><published>2011-12-29T11:31:00.001+05:30</published><updated>2015-06-18T22:39:46.200+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Word of the day"/><title type='text'>Word of the day</title><content type='html'>&lt;div class=Section1&gt;  &lt;table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 width=&quot;43%&quot;  style=&#39;width:43.78%;background:#E9F3FF;border:solid #AABBDD 2.25pt&#39;&gt;  &lt;tr&gt;   &lt;td width=&quot;100%&quot; style=&#39;width:100.0%;border:none;padding:7.5pt 7.5pt 7.5pt 7.5pt&#39;&gt;   &lt;p class=MsoNormal&gt;&lt;b&gt;&lt;a href=&quot;http://en.wiktionary.org/wiki/bespectacled&quot;   title=bespectacled&gt;bespectacled&lt;/a&gt;&lt;/b&gt; &lt;i&gt;adj&lt;/i&gt;&lt;span style=&#39;font-size:   12.0pt&#39;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width=&quot;100%&quot; valign=top style=&#39;width:100.0%;border:none;padding:7.5pt 7.5pt 7.5pt 7.5pt&#39;&gt;   &lt;p class=MsoNormal&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-1I86t0c9LiA/TvwCTq6rdYI/AAAAAAAAAu8/Rv38BJJrhiU/s1600/image001-710591.png&quot;&gt;&lt;img src=&quot;http://4.bp.blogspot.com/-1I86t0c9LiA/TvwCTq6rdYI/AAAAAAAAAu8/Rv38BJJrhiU/s320/image001-710591.png&quot;  border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5691426566050641282&quot; /&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;ol start=1 type=1&gt;    &lt;li class=MsoNormal style=&#39;mso-margin-top-alt:auto;mso-margin-bottom-alt:        auto;mso-list:l0 level1 lfo1&#39;&gt;Wearing spectacles (glasses). &lt;span        style=&#39;font-size:12.0pt&#39;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;   &lt;/ol&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/table&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/6573758771564784712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/word-of-day.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/6573758771564784712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/6573758771564784712'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/word-of-day.html' title='Word of the day'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-1I86t0c9LiA/TvwCTq6rdYI/AAAAAAAAAu8/Rv38BJJrhiU/s72-c/image001-710591.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-8618941191348892844</id><published>2011-12-29T10:59:00.001+05:30</published><updated>2015-06-18T22:39:46.239+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="Solaris"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Step by step installation of oracle on Solaris 10</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;strong&gt;&lt;span style=&#39;font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;color:blue&#39;&gt;Oracle installation&lt;/span&gt;&lt;/strong&gt;&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;1. /usr/sbin/groupadd oinstall&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;2. /usr/sbin/groupadd dba&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;3. /usr/sbin/groupadd oper&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;4. mkdir /export/home/oracle&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;5. /usr/sbin/useradd -g oinstall -G dba,oper -d /export/home/oracle oracle&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;6. chown oracle:oinstall /export/home/oracle &lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;7. mkfile 5gb /tempswap&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;8. swap -a /tempswap &lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;9. prctl -n project.max-shm-memory -v 6gb -r -i project default&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;10 connect to oracle user&lt;/span&gt;&lt;br&gt; &lt;span style=&#39;color:#6AA84F&#39;&gt;11. ./runInstaller&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/8618941191348892844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/step-by-step-installation-of-oracle-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/8618941191348892844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/8618941191348892844'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/step-by-step-installation-of-oracle-on.html' title='Step by step installation of oracle on Solaris 10'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8375270122264838256.post-2351024366602281206</id><published>2011-12-29T10:58:00.001+05:30</published><updated>2015-06-18T22:39:46.135+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Documentation"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Jersey"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Webservices"/><title type='text'>Jersey Restful Webservices API document automation using maven</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoListParagraph style=&#39;text-indent:-.25in;mso-list:l0 level1 lfo1&#39;&gt;&lt;![if !supportLists]&gt;&lt;span style=&#39;mso-list:Ignore&#39;&gt;1.&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;&amp;nbsp;1.&amp;nbsp;&amp;nbsp;Include following configuration in pom.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;mso-margin-top-alt:0in;margin-right:0in;margin-bottom: 12.0pt;margin-left:.5in&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in;text-indent:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;profiles&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;profile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;id&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;release&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;id&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;build&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugins&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;org.apache.maven.plugins&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;maven&lt;/span&gt;&lt;/u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;-&lt;u&gt;javadoc&lt;/u&gt;-&lt;u&gt;plugin&lt;/u&gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;links&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;link&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;http://jsr311.java.net/nonav/releases/1.1&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;link&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;links&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugins&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;build&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;profile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;profiles&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;mso-margin-top-alt:0in;margin-right:0in;margin-bottom: 12.0pt;margin-left:.5in&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in;text-indent:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;&amp;lt;plugins&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in;text-indent:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;org.apache.maven.plugins&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;maven&lt;/span&gt;&lt;/u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;-&lt;u&gt;javadoc&lt;/u&gt;-&lt;u&gt;plugin&lt;/u&gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;2.4&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;executions&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;execution&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goals&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goal&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;javadoc&lt;/span&gt;&lt;/u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goal&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goals&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;phase&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;package&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;phase&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;execution&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;executions&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;encoding&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;UTF-8&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;encoding&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;verbose&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;false&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;verbose&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;show&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;public&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;show&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- provide package information for webservicecs classes --&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;subpackages&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.abc.webservices&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;subpackages&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;doclet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey.wadl.resourcedoc.ResourceDoclet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;doclet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifacts&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifact&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey.contribs&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;wadl-resourcedoc-doclet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${jersey-release-version}&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifact&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F5FBF&#39;&gt;&amp;lt;!--&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F5FBF&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Also specify jersey and &lt;u&gt;xerces&lt;/u&gt; as &lt;u&gt;doclet&lt;/u&gt; artifacts as the ResourceDoclet&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F5FBF&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uses classes provided by them to generate the &lt;u&gt;resourcedoc&lt;/u&gt;.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F5FBF&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifact&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;jersey-server&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${jersey-release-version}&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifact&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifact&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;xerces&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;xercesImpl&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;2.6.1&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifact&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;docletArtifacts&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;additionalparam&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;-output ${project.build.outputDirectory}/resourcedoc.xml&lt;/span&gt;&lt;span style=&#39;font-size: 10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;additionalparam&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey.contribs&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;maven&lt;/span&gt;&lt;/u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;-&lt;u&gt;wadl&lt;/u&gt;-&lt;u&gt;plugin&lt;/u&gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${jersey-release-version}&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;executions&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;execution&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;id&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;generate&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;id&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goals&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goal&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;generate&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goal&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goals&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;phase&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;package&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;phase&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;execution&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;executions&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${project.build.outputDirectory}/application.wadl&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;formatWadlFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;true&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;formatWadlFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;baseUri&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;http://localhost:8080/api&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;baseUri&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;packagesResourceConfig&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- provide package information for webservicecs classes --&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;param&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.abc.webservices&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;param&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;packagesResourceConfig&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGenerators&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGeneratorDescription&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;className&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;className&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;properties&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;property&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;name&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;applicationDocsFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;name&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;value&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${basedir}/src/main/resources/application-doc.xml&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;value&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;property&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;properties&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGeneratorDescription&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGeneratorDescription&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;className&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;className&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;properties&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;property&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;name&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;grammarsFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;name&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;value&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${basedir}/src/main/resources/application-grammars.xml&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;value&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;property&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;properties&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGeneratorDescription&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGeneratorDescription&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;className&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;className&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;properties&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;property&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;name&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;resourceDocFile&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;name&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;value&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${project.build.outputDirectory}/resourcedoc.xml&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;value&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;property&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;properties&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGeneratorDescription&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;wadlGenerators&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size: 10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size: 10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;org.codehaus.mojo&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;xml&lt;/span&gt;&lt;/u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;-&lt;u&gt;maven&lt;/u&gt;-&lt;u&gt;plugin&lt;/u&gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size: 10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size: 10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;1.0&lt;/span&gt;&lt;span style=&#39;font-size: 10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;executions&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;execution&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goals&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goal&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;transform&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goal&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;goals&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;phase&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;package&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;phase&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;execution&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;executions&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;transformationSets&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;transformationSet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;dir&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${project.build.outputDirectory}&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;dir&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;; color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;; color:#3F7F7F&#39;&gt;includes&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;; color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;include&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;application.wadl&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;include&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;includes&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;stylesheet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${basedir}/src/main/resources/wadl_documentation.xsl&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;stylesheet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;outputDir&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;${project.build.directory}&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;outputDir&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;fileMappers&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;fileMapper&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:#7F007F&#39;&gt;implementation&lt;/span&gt;&lt;span style=&#39;color:black&#39;&gt;=&lt;/span&gt;&lt;i&gt;&lt;span style=&#39;color:#2A00FF&#39;&gt;&amp;quot;org.codehaus.plexus.components.io.filemappers.FileExtensionMapper&amp;quot;&lt;/span&gt;&lt;/i&gt;&lt;span style=&#39;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;targetExtension&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;.html&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;targetExtension&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;fileMapper&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;fileMappers&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;transformationSet&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;transformationSets&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;configuration&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;dependencies&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;dependency&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;net.sf.saxon&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;groupId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;saxon&lt;/span&gt;&lt;/u&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;artifactId&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black&#39;&gt;8.7&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;version&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;dependency&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;dependencies&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugin&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:black&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F7F&#39;&gt;plugins&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:teal&#39;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal style=&#39;margin-left:.5in&#39;&gt;&lt;br&gt; 2.&amp;nbsp;Copy &lt;a href=&quot;http://java.net/projects/jersey/sources/svn/content/trunk/jersey/samples/extended-wadl-webapp/src/main/resources/application-doc.xml?raw=true&quot;&gt;application-doc.xml&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://java.net/projects/jersey/sources/svn/content/trunk/jersey/samples/extended-wadl-webapp/src/main/resources/application-grammars.xml?raw=true&quot;&gt;application-grammars.xml&lt;/a&gt; and&amp;nbsp;&lt;a href=&quot;http://java.net/projects/jersey/sources/svn/content/trunk/jersey/samples/generate-wadl/src/main/doc/wadl_documentation.xsl?raw=true&quot;&gt;wadl_documentation.xsl&lt;/a&gt; in src/main/resources directory&lt;br&gt; 3.&amp;nbsp;&amp;nbsp;Run mvn clean install&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://infoally.blogspot.com/feeds/2351024366602281206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://infoally.blogspot.com/2011/12/jersey-restful-webservices-api-document.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/2351024366602281206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8375270122264838256/posts/default/2351024366602281206'/><link rel='alternate' type='text/html' href='http://infoally.blogspot.com/2011/12/jersey-restful-webservices-api-document.html' title='Jersey Restful Webservices API document automation using maven'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>