<?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-9079697573277641059</id><updated>2026-08-01T17:17:11.054-07:00</updated><category term="Alert box"/><category term="Introduction"/><category term="Phone Contact Details"/><category term="Simple HttpRequest"/><category term="dynamically creating controls"/><title type='text'>Android Beginners</title><subtitle type='html'>Android is a mobile operating system running on the Linux kernel.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-1735345834969335804</id><published>2012-05-24T11:31:00.000-07:00</published><updated>2012-05-24T11:31:57.818-07:00</updated><title type='text'>Reading a pdf file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Here we are try to read a pdf file with help of iText .&amp;nbsp;You can download the iText binary from&amp;nbsp;http://sourceforge.net/projects/itext/.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;import java.io.FileOutputStream;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import com.itextpdf.text.Document;&lt;br /&gt;import com.itextpdf.text.DocumentException;&lt;br /&gt;import com.itextpdf.text.Image;&lt;br /&gt;import com.itextpdf.text.pdf.PdfImportedPage;&lt;br /&gt;import com.itextpdf.text.pdf.PdfReader;&lt;br /&gt;import com.itextpdf.text.pdf.PdfWriter;&lt;br /&gt;public class ReadAndUsePdf {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String INPUTFILE = &quot;c:/temp/FirstPdf.pdf&quot;;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String OUTPUTFILE = &quot;c:/temp/ReadPdf.pdf&quot;;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) throws DocumentException,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;IOException {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Document document = new Document();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;PdfWriter writer = PdfWriter.getInstance(document,&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;new FileOutputStream(OUTPUTFILE));&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;document.open();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;PdfReader reader = new PdfReader(INPUTFILE);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int n = reader.getNumberOfPages();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;PdfImportedPage page;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Go through all pages&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = 1; i &amp;lt;= n; i++) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Only page number 2 will be included&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (i == 2) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;page = writer.getImportedPage(reader, i);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Image instance = Image.getInstance(page);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;document.add(instance);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;document.close();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/1735345834969335804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2012/05/reading-pdf-file.html#comment-form' title='27 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/1735345834969335804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/1735345834969335804'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2012/05/reading-pdf-file.html' title='Reading a pdf file'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>27</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-5489049764836109643</id><published>2012-05-24T11:27:00.000-07:00</published><updated>2012-05-24T11:27:06.595-07:00</updated><title type='text'>Creating a pdf in Android with help of iText</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;With help of iText we can create a pdf file. you can download the latest binary from&amp;nbsp;
&lt;a href=&quot;http://sourceforge.net/projects/itext/&quot;&gt;http://sourceforge.net/projects/itext/&lt;/a&gt;.&lt;/span&gt;&lt;div&gt;
&lt;pre class=&quot;programlisting&quot; style=&quot;background-color: whitesmoke; border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; border-top-left-radius: 9px; border-top-right-radius: 9px; border: 1px solid rgb(187, 187, 187); font-size: 13px; line-height: 16px; margin-top: 1em; overflow: auto; padding-left: 0.8em; text-align: -webkit-auto; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; java.io.FileOutputStream;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; java.util.Date;

&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Anchor;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.BadElementException;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.BaseColor;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Chapter;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Document;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.DocumentException;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Element;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Font;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.List;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.ListItem;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Paragraph;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Phrase;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.Section;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.pdf.PdfPCell;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.pdf.PdfPTable;
&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;import&lt;/span&gt; com.itextpdf.text.pdf.PdfWriter;


&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;class&lt;/span&gt; FirstPdf {
 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; String FILE = &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;c:/temp/FirstPdf.pdf&quot;&lt;/span&gt;;
 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; Font catFont = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Font(Font.FontFamily.TIMES_ROMAN, &lt;span class=&quot;hl-number&quot;&gt;18&lt;/span&gt;,
   Font.BOLD);
 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; Font redFont = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Font(Font.FontFamily.TIMES_ROMAN, &lt;span class=&quot;hl-number&quot;&gt;12&lt;/span&gt;,
   Font.NORMAL, BaseColor.RED);
 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; Font subFont = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Font(Font.FontFamily.TIMES_ROMAN, &lt;span class=&quot;hl-number&quot;&gt;16&lt;/span&gt;,
   Font.BOLD);
 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; Font smallBold = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Font(Font.FontFamily.TIMES_ROMAN, &lt;span class=&quot;hl-number&quot;&gt;12&lt;/span&gt;,
   Font.BOLD);

 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; main(String[] args) {
  &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;try&lt;/span&gt; {
   Document document = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Document();
   PdfWriter.getInstance(document, &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; FileOutputStream(FILE));
   document.open();
   addMetaData(document);
   addTitlePage(document);
   addContent(document);
   document.close();
  } &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;catch&lt;/span&gt; (Exception e) {
   e.printStackTrace();
  }
 }

 &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// iText allows to add metadata to the PDF which can be viewed in your Adobe&lt;/em&gt;
 &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Reader&lt;/em&gt;
 &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// under File -&amp;gt; Properties&lt;/em&gt;
 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; addMetaData(Document document) {
  document.addTitle(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;My first PDF&quot;&lt;/span&gt;);
  document.addSubject(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Using iText&quot;&lt;/span&gt;);
  document.addKeywords(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Java, PDF, iText&quot;&lt;/span&gt;);
  document.addAuthor(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Lars Vogel&quot;&lt;/span&gt;);
  document.addCreator(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Lars Vogel&quot;&lt;/span&gt;);
 }

 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; addTitlePage(Document document)
   &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;throws&lt;/span&gt; DocumentException {
  Paragraph preface = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph();
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// We add one empty line&lt;/em&gt;
  addEmptyLine(preface, &lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Lets write a big header&lt;/em&gt;
  preface.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Title of the document&quot;&lt;/span&gt;, catFont));

  addEmptyLine(preface, &lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Will create: Report generated by: _name, _date&lt;/em&gt;
  preface.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(
    &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Report generated by: &quot;&lt;/span&gt; + System.getProperty(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;user.name&quot;&lt;/span&gt;) + &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;, &quot;&lt;/span&gt; + &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Date(), &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$&lt;/em&gt;
    smallBold));
  addEmptyLine(preface, &lt;span class=&quot;hl-number&quot;&gt;3&lt;/span&gt;);
  preface.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(
    &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;This document describes something which is very important &quot;&lt;/span&gt;,
    smallBold));

  addEmptyLine(preface, &lt;span class=&quot;hl-number&quot;&gt;8&lt;/span&gt;);

  preface.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(
    &lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;This document is a preliminary version and not subject to your license agreement or any other agreement with vogella.com ;-).&quot;&lt;/span&gt;,
    redFont));

  document.add(preface);
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Start a new page&lt;/em&gt;
  document.newPage();
 }

 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; addContent(Document document) &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;throws&lt;/span&gt; DocumentException {
  Anchor anchor = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Anchor(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;First Chapter&quot;&lt;/span&gt;, catFont);
  anchor.setName(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;First Chapter&quot;&lt;/span&gt;);

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Second parameter is the number of the chapter&lt;/em&gt;
  Chapter catPart = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Chapter(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(anchor), &lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);

  Paragraph subPara = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Subcategory 1&quot;&lt;/span&gt;, subFont);
  Section subCatPart = catPart.addSection(subPara);
  subCatPart.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Hello&quot;&lt;/span&gt;));

  subPara = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Subcategory 2&quot;&lt;/span&gt;, subFont);
  subCatPart = catPart.addSection(subPara);
  subCatPart.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Paragraph 1&quot;&lt;/span&gt;));
  subCatPart.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Paragraph 2&quot;&lt;/span&gt;));
  subCatPart.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Paragraph 3&quot;&lt;/span&gt;));

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Add a list&lt;/em&gt;
  createList(subCatPart);
  Paragraph paragraph = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph();
  addEmptyLine(paragraph, &lt;span class=&quot;hl-number&quot;&gt;5&lt;/span&gt;);
  subCatPart.add(paragraph);

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Add a table&lt;/em&gt;
  createTable(subCatPart);

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Now add all this to the document&lt;/em&gt;
  document.add(catPart);

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Next section&lt;/em&gt;
  anchor = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Anchor(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Second Chapter&quot;&lt;/span&gt;, catFont);
  anchor.setName(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Second Chapter&quot;&lt;/span&gt;);

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Second parameter is the number of the chapter&lt;/em&gt;
  catPart = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Chapter(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(anchor), &lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);

  subPara = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Subcategory&quot;&lt;/span&gt;, subFont);
  subCatPart = catPart.addSection(subPara);
  subCatPart.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;This is a very important message&quot;&lt;/span&gt;));

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// Now add all this to the document&lt;/em&gt;
  document.add(catPart);

 }

 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; createTable(Section subCatPart)
   &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;throws&lt;/span&gt; BadElementException {
  PdfPTable table = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; PdfPTable(&lt;span class=&quot;hl-number&quot;&gt;3&lt;/span&gt;);

  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// t.setBorderColor(BaseColor.GRAY);&lt;/em&gt;
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// t.setPadding(4);&lt;/em&gt;
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// t.setSpacing(4);&lt;/em&gt;
  &lt;em class=&quot;hl-comment&quot; style=&quot;color: #008800;&quot;&gt;// t.setBorderWidth(1);&lt;/em&gt;

  PdfPCell c1 = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; PdfPCell(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Phrase(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Table Header 1&quot;&lt;/span&gt;));
  c1.setHorizontalAlignment(Element.ALIGN_CENTER);
  table.addCell(c1);

  c1 = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; PdfPCell(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Phrase(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Table Header 2&quot;&lt;/span&gt;));
  c1.setHorizontalAlignment(Element.ALIGN_CENTER);
  table.addCell(c1);

  c1 = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; PdfPCell(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Phrase(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Table Header 3&quot;&lt;/span&gt;));
  c1.setHorizontalAlignment(Element.ALIGN_CENTER);
  table.addCell(c1);
  table.setHeaderRows(&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;);

  table.addCell(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;);
  table.addCell(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;1.1&quot;&lt;/span&gt;);
  table.addCell(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;1.2&quot;&lt;/span&gt;);
  table.addCell(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;2.1&quot;&lt;/span&gt;);
  table.addCell(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;2.2&quot;&lt;/span&gt;);
  table.addCell(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;2.3&quot;&lt;/span&gt;);

  subCatPart.add(table);

 }

 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; createList(Section subCatPart) {
  List list = &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; List(true, false, &lt;span class=&quot;hl-number&quot;&gt;10&lt;/span&gt;);
  list.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; ListItem(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;First point&quot;&lt;/span&gt;));
  list.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; ListItem(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Second point&quot;&lt;/span&gt;));
  list.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; ListItem(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot;Third point&quot;&lt;/span&gt;));
  subCatPart.add(list);
 }

 &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt; addEmptyLine(Paragraph paragraph, &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt; number) {
  &lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; number; i++) {
   paragraph.add(&lt;span class=&quot;hl-keyword&quot; style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;new&lt;/span&gt; Paragraph(&lt;span class=&quot;hl-string&quot; style=&quot;color: blue;&quot;&gt;&quot; &quot;&lt;/span&gt;));
  }
 }
}
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/5489049764836109643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2012/05/creating-pdf-in-android-with-help-of.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/5489049764836109643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/5489049764836109643'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2012/05/creating-pdf-in-android-with-help-of.html' title='Creating a pdf in Android with help of iText'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-4179273457693756808</id><published>2011-02-21T01:47:00.000-08:00</published><updated>2011-02-21T01:47:06.687-08:00</updated><title type='text'>Adding LayoutParams</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Adding the&amp;nbsp;LayoutParams&amp;nbsp;to the control&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LayoutParams.FILL_PARENT,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LayoutParams.WRAP_CONTENT);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;params.leftMargin=22;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;params.height=20;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;params.width=10;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/4179273457693756808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2011/02/adding-layoutparams.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/4179273457693756808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/4179273457693756808'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2011/02/adding-layoutparams.html' title='Adding LayoutParams'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-3779656597663367966</id><published>2011-02-21T01:43:00.000-08:00</published><updated>2011-02-21T01:44:28.855-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dynamically creating controls"/><title type='text'>Creating dynamic controls.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here is the code for dynamically creating controls in the table layout... &lt;br /&gt;
TableLayout tl=(TableLayout)findViewById(R.id.NewsTable);&lt;br /&gt;
&amp;nbsp;for (int i = 0; i &amp;lt; 16; i++)&lt;br /&gt;
&amp;nbsp;{&lt;br /&gt;
TableRow tr=new TableRow(this);&lt;br /&gt;
TextView TV=new TextView(this);&lt;br /&gt;
&amp;nbsp;TV.setText(&quot;Dynamic Button--&quot;+i);&lt;br /&gt;
ImageView IV=new ImageView(this);&lt;br /&gt;
&amp;nbsp;Uri imgUri=Uri.parse(&quot;android.resource://com.example.hello/&quot;+R.drawable.icon);&lt;br /&gt;
IV.setImageURI(imgUri);&lt;br /&gt;
&amp;nbsp;tr.addView(IV);&lt;br /&gt;
&amp;nbsp;tr.addView(TV);&lt;br /&gt;
tl.addView(tr);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/3779656597663367966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2011/02/creating-dynamic-controls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/3779656597663367966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/3779656597663367966'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2011/02/creating-dynamic-controls.html' title='Creating dynamic controls.'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-5474488217873803752</id><published>2010-01-28T08:48:00.000-08:00</published><updated>2010-01-28T08:48:22.820-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Phone Contact Details"/><title type='text'>Get Phone Contact Details</title><content type='html'>private void getMyPhoneNumber(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Form an array specifying which columns to return. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String[] projection = new String[] {&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; People._ID,&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; People.LABEL,//._COUNT,&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; People.NAME,&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; People.NUMBER,&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; People.PRIMARY_EMAIL_ID&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the base URI for the People table in the Contacts content provider.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Uri contacts =&amp;nbsp; People.CONTENT_URI;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Make the query. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Cursor managedCursor = managedQuery(contacts,&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;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; projection, // Which columns to return &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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Which rows to return (all rows)&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Selection arguments (none)&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Put the results in ascending order by name&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; People.NAME + &quot; ASC&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox(&quot;Contacts&quot;, getColumnData(managedCursor));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; catch(Exception e){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox(&quot;Exception&quot;, e.getMessage());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;private String getColumnData(Cursor cur){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String ContactsName=&quot;&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cur.moveToFirst()) {&lt;br /&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; String name; &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; String phoneNumber; &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; String email;&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; String Label;&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; int nameColumn = cur.getColumnIndex(People.NAME); &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; int phoneColumn = cur.getColumnIndex(People.NUMBER);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; String imagePath; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; do {&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; // Get the field values&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; name = cur.getString(nameColumn);&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; phoneNumber = cur.getString(phoneColumn);&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;nbsp; email =cur.getString(cur.getColumnIndex(People.PRIMARY_EMAIL_ID));&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;nbsp; Label =cur.getString(cur.getColumnIndex(People.LABEL));&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; ContactsName+=&quot;name:&quot;+name+&quot; Phoneno:&quot;+phoneNumber+&quot;email:&quot;+email+&quot;label:&quot;+Label;&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; &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; } while (cur.moveToNext());&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ContactsName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/5474488217873803752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/get-phone-contact-details.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/5474488217873803752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/5474488217873803752'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/get-phone-contact-details.html' title='Get Phone Contact Details'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-3780351478161323771</id><published>2010-01-15T11:59:00.000-08:00</published><updated>2010-01-15T11:59:35.457-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Alert box"/><title type='text'>Alert box in Android</title><content type='html'>&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
As as java script we show a alert dailoge box.&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
Java Code:&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void alertbox(String title, String mymessage)&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new AlertDialog.Builder(this)&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setMessage(mymessage)&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setTitle(title)&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setCancelable(true)&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setNeutralButton(android.R.string.cancel,&amp;nbsp; &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; new DialogInterface.OnClickListener() {&amp;nbsp; &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; public void onClick(DialogInterface dialog, int whichButton){}&amp;nbsp; &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; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .show();&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/3780351478161323771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/alert-box-in-android.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/3780351478161323771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/3780351478161323771'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/alert-box-in-android.html' title='Alert box in Android'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-9158803184994020901</id><published>2010-01-15T11:29:00.000-08:00</published><updated>2010-01-15T11:55:37.046-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Simple HttpRequest"/><title type='text'>Communication with HttpRequest</title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Get data from server with help of http request and get the response.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Java file:&lt;/b&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;package com.example.HttpExample;&lt;br /&gt;
import java.io.BufferedInputStream;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.InputStream;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.NameValuePair;&lt;br /&gt;
import org.apache.http.client.ClientProtocolException;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.entity.UrlEncodedFormEntity;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.message.BasicNameValuePair;&lt;br /&gt;
import org.apache.http.protocol.HTTP;&lt;br /&gt;
import org.apache.http.util.ByteArrayBuffer;&lt;br /&gt;
&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.app.AlertDialog;&lt;br /&gt;
import android.content.DialogInterface;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.view.View;&lt;br /&gt;
import android.view.View.OnClickListener;&lt;br /&gt;
import android.widget.Button;&lt;br /&gt;
import android.widget.TextView; &lt;br /&gt;
&lt;br /&gt;
public class HttpExample extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;String url = &quot;http://techy.limewebs.com/data.php&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; TextView tv=new TextView(this);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; tv.setText(&quot;Android !!!!!!!!!!!!&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Button myButton = (Button) findViewById(R.id.button);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; myButton.setOnClickListener(new OnClickListener() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onClick(View v) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Auto-generated method stub&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; btn_Click();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;br /&gt;
);&lt;br /&gt;
&amp;nbsp; // setContentView(tv);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void btn_Click(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //alertbox(&quot;My Alert&quot;,&quot;U click Me&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SendHttpRequset();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void alertbox(String title, String mymessage)&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new AlertDialog.Builder(this)&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setMessage(mymessage)&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setTitle(title)&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setCancelable(true)&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setNeutralButton(android.R.string.cancel,&amp;nbsp; &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; new DialogInterface.OnClickListener() {&amp;nbsp; &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; public void onClick(DialogInterface dialog, int whichButton){}&amp;nbsp; &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; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .show();&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private void SendHttpRequset(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;try {&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; HttpClient httpclient = new DefaultHttpClient();&amp;nbsp; &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; HttpPost httppost = new HttpPost(url);&amp;nbsp; &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; &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; &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; List&lt;namevaluepair&gt; nameValuePairs = new ArrayList&lt;namevaluepair&gt;();&amp;nbsp; &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; nameValuePairs.add(new BasicNameValuePair(&quot;data&quot;, &quot;Atul Yadav&quot;));&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8));&amp;nbsp; &lt;br /&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; // Execute HTTP Post Request&amp;nbsp; &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; HttpResponse response = httpclient.execute(httppost);&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; &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; InputStream is = response.getEntity().getContent();&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; BufferedInputStream bis = new BufferedInputStream(is);&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; ByteArrayBuffer baf = new ByteArrayBuffer(20);&lt;br /&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; int current = 0;&amp;nbsp; &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; while((current = bis.read()) != -1){&amp;nbsp; &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;nbsp;&amp;nbsp; baf.append((byte)current);&amp;nbsp; &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; &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; &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; /* Convert the Bytes read to a String. */&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; TextView lbl = (TextView) findViewById(R.id.ShowResponce);&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; String&amp;nbsp; text = new String(baf.toByteArray());&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; lbl.setText(text);&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; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (ClientProtocolException e) {&amp;nbsp; &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; // TODO Auto-generated catch block &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;TextView lbl = (TextView) findViewById(R.id.ShowResponce);&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;lbl.setText(e.getMessage());&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; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; } catch (IOException e) {&amp;nbsp; &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; // TODO Auto-generated catch block &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;TextView lbl = (TextView) findViewById(R.id.ShowResponce);&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;lbl.setText(e.getMessage());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;/namevaluepair&gt;&lt;/namevaluepair&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Layout :&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Main.xml&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;linearlayout android:layout_height=&quot;fill_parent&quot; android:layout_width=&quot;fill_parent&quot; android:orientation=&quot;vertical&quot; xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
    &lt;textview android:id=&quot;@+id/text&quot; android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;wrap_content&quot; android:text=&quot;Hello, I am a TextView&quot;&gt;
    &lt;button android:id=&quot;@+id/button&quot; android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;wrap_content&quot; android:onclick=&quot;btn_Click()&quot; android:text=&quot;Send Request&quot;&gt;
&lt;textview android:id=&quot;@+id/ShowResponce&quot; android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;wrap_content&quot; android:text=&quot;@+id/TextView01&quot;&gt;&lt;/textview&gt;
&lt;/button&gt;&lt;/textview&gt;

&lt;/linearlayout&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/9158803184994020901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/communication-with-httprequest.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/9158803184994020901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/9158803184994020901'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/communication-with-httprequest.html' title='Communication with HttpRequest'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9079697573277641059.post-5386978036835892327</id><published>2010-01-13T12:37:00.000-08:00</published><updated>2010-01-13T12:49:37.273-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Introduction"/><title type='text'>What is Android</title><content type='html'>&lt;div style=&quot;color: #444444; font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Android&lt;/b&gt; is a mobile operating system running on the Linux kernel. It was initially developed by Android Inc., a firm later purchased by Google, and lately by the Open Handset Alliance. It allows developers to write managed code in the Java language, controlling the device via Google-developed Java libraries.&lt;br /&gt;
The unveiling of the Android distribution on 5 November 2007 was announced with the founding of the Open Handset Alliance, a consortium of&amp;nbsp; hardware, software, and telecom companies devoted to advancing open standards for mobile devices.Google released most of the Android code under the Apache License, a free software and open source license.&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #444444; font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #444444; font-family: Verdana,sans-serif; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoMFouQgq8UGX5OLxhN1oKJ7WT6DARkaiz9RvTpgTClWHnj4-ZzGT92aYxiCVrJ8IBbtYlEpt8pioednP0SkEfk7CSkHOs8vfOhhNiq08R8rcCuCX-utImbJSR6tVUUIBZJ7IF9tLGEfeD/s1600-h/250px-Android-2.0.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoMFouQgq8UGX5OLxhN1oKJ7WT6DARkaiz9RvTpgTClWHnj4-ZzGT92aYxiCVrJ8IBbtYlEpt8pioednP0SkEfk7CSkHOs8vfOhhNiq08R8rcCuCX-utImbJSR6tVUUIBZJ7IF9tLGEfeD/s320/250px-Android-2.0.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #444444; font-family: Verdana,sans-serif; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h2 style=&quot;color: #444444; font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span id=&quot;Features&quot;&gt;Features&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;table class=&quot;wikitable&quot; style=&quot;color: #444444; font-family: Verdana,sans-serif; margin: 1em auto; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;text-align: left;&quot;&gt;&lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Handset layouts&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on OpenGL ES 1.0 specifications, and traditional smartphone layouts.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Storage&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;The Database Software SQLite is used for data storage purposes&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Connectivity&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Android supports connectivity technologies including GSM/EDGE, CDMA, EV-DO, UMTS, Bluetooth, and Wi-Fi.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Messaging&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SMS and MMS are available forms of messaging including threaded text messaging.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Web browser&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;The web browser available in Android is based on the open-source WebKit application framework. The browser scores a 93/100 on the Acid3 Test.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Java support&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Software written in Java can be compiled to be executed in the Dalvik virtual machine, which is a specialized VM implementation designed for mobile device use, although not technically a standard Java Virtual Machine.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Additional hardware support&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Android can use video/still cameras, touchscreens, GPS, accelerometers, magnetometers, accelerated 2D bit blits (with hardware orientation, scaling, pixel format conversion) and accelerated 3D graphics.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Development environment&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Includes a device emulator, tools for debugging, memory and performance profiling, a plugin for the Eclipse IDE.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Market&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Like many phone-based application stores, the Android Market&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-37&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Android_%28operating_system%29#cite_note-37&quot;&gt;&lt;/a&gt;&lt;/sup&gt; The Android Market has been expanding rapidly. By December, 2009, it had over 20,000 Android applications for download.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-38&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Android_%28operating_system%29#cite_note-38&quot;&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;is a catalog of applications that can be downloaded and installed to target hardware over-the-air, without the use of a PC. Originally only freeware applications were supported. Paid-for apps have been available on the Android Market in the United States since 19 February 2009.&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;th&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Multi-touch&lt;/span&gt;&lt;br /&gt;
&lt;/th&gt; &lt;td&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Android has native support for multi-touch which is available in newer handsets such as the HTC Hero. The feature was initially disabled at the kernel level (possibly to avoid infringing Apple patents on touch-screen technology&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-39&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Android_%28operating_system%29#cite_note-39&quot;&gt;&lt;/a&gt;&lt;/sup&gt;).&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;color: #444444; font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span id=&quot;Features&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #444444; font-family: Verdana,sans-serif; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #444444; font-family: Verdana,sans-serif; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbeginner.blogspot.com/feeds/5386978036835892327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/what-is-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/5386978036835892327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9079697573277641059/posts/default/5386978036835892327'/><link rel='alternate' type='text/html' href='http://androidbeginner.blogspot.com/2010/01/what-is-android.html' title='What is Android'/><author><name>Atul Kr Yadav</name><uri>http://www.blogger.com/profile/05045632781949992374</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMoVMJk8aqmu4qQMLjtmbx2QrGDTma_WSer7YuNk3kaiSyfjQFzskWywIUk1vrIDN9Iz12JmBvKeHmUt2pT_tE2jDWFhNWl5Ua8J2nnN1r1Ushi7iv6qIxqyFQ-I4M98w/s220/OgAAADHli9wuCSifNu7fiOivMCkpmdc6FLejzGzi4Ggq5BvEMg2X3NhLjiJtN-zU5NiFaIi62EwrlQKukWemBF1Ic3QAm1T1UHfYEtTP1E8eNB-dA2bOf-0w5NOj.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoMFouQgq8UGX5OLxhN1oKJ7WT6DARkaiz9RvTpgTClWHnj4-ZzGT92aYxiCVrJ8IBbtYlEpt8pioednP0SkEfk7CSkHOs8vfOhhNiq08R8rcCuCX-utImbJSR6tVUUIBZJ7IF9tLGEfeD/s72-c/250px-Android-2.0.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>