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

<channel>
	<title>Steve Loper</title>
	<atom:link href="http://steveloper.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://steveloper.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 20 Apr 2012 19:50:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to show a Yes/No box in a Android App</title>
		<link>http://steveloper.com/how-to-show-a-yesno-box-in-a-android-app/</link>
		<comments>http://steveloper.com/how-to-show-a-yesno-box-in-a-android-app/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 19:39:52 +0000</pubDate>
		<dc:creator>stev9397</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://steveloper.com/?p=127</guid>
		<description><![CDATA[Sometimes you need to get a yes/no response from a user. Here is some simple code that you can call to show a Yes/No box with a message public void ShowYesNo&#40;String sMessage&#41; &#123; AlertDialog.Builder alt_bld = new AlertDialog.Builder&#40;this&#41;; alt_bld.setMessage&#40;sMessage&#41; .setCancelable&#40;false&#41;.setNegativeButton&#40;&#34;No&#34;,<span class="ellipsis">&#8230;</span> <a href="http://steveloper.com/how-to-show-a-yesno-box-in-a-android-app/"><div class="read-more">Read more &#8250;</div><!-- end of .read-more --></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to get a yes/no response from a user.  Here is some simple code that you can call to show a Yes/No box with a message</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java"><div class="devcodeoverflow">
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> ShowYesNo<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> sMessage<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
AlertDialog.<span style="color: #006633;">Builder</span> alt_bld <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AlertDialog.<span style="color: #006633;">Builder</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
alt_bld.<span style="color: #006633;">setMessage</span><span style="color: #009900;">&#40;</span>sMessage<span style="color: #009900;">&#41;</span>
.<span style="color: #006633;">setCancelable</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setNegativeButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> DialogInterface.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>DialogInterface dialog, <span style="color: #000066; font-weight: bold;">int</span> id<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Action for 'NO' Button</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setPositiveButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Yes&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> DialogInterface.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>DialogInterface dialog, <span style="color: #000066; font-weight: bold;">int</span> id<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Action for 'YES' Button</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
AlertDialog alert <span style="color: #339933;">=</span> alt_bld.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Title for AlertDialog</span>
alert.<span style="color: #006633;">setTitle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Create Contact&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Icon for AlertDialog</span>
alert.<span style="color: #006633;">setIcon</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">ic_launcher</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
alert.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
</div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://steveloper.com/how-to-show-a-yesno-box-in-a-android-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to send an email in Android</title>
		<link>http://steveloper.com/how-to-send-an-email-in-android/</link>
		<comments>http://steveloper.com/how-to-send-an-email-in-android/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 12:22:24 +0000</pubDate>
		<dc:creator>stev9397</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://steveloper.com/?p=124</guid>
		<description><![CDATA[With many applications you want to be able to send an email with a message. &#160;To accomplish this, just put the following code where you need it. &#160;When executed it will create an email for the user to send. &#160;<span class="ellipsis">&#8230;</span> <a href="http://steveloper.com/how-to-send-an-email-in-android/"><div class="read-more">Read more &#8250;</div><!-- end of .read-more --></a>]]></description>
			<content:encoded><![CDATA[<p>With many applications you want to be able to send an email with a message. &nbsp;To accomplish this, just put the following code where you need it. &nbsp;When executed it will create an email for the user to send.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java"><div class="devcodeoverflow">
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">final</span> Intent emailIntent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Intent<span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">content</span>.<span style="color: #006633;">Intent</span>.<span style="color: #006633;">ACTION_SEND</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
emailIntent.<span style="color: #006633;">setType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;plain/text&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
emailIntent.<span style="color: #006633;">putExtra</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">content</span>.<span style="color: #006633;">Intent</span>.<span style="color: #006633;">EXTRA_EMAIL</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;To@youremail.com&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
emailIntent.<span style="color: #006633;">putExtra</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">content</span>.<span style="color: #006633;">Intent</span>.<span style="color: #006633;">EXTRA_SUBJECT</span>, <span style="color: #0000ff;">&quot;This is the subject&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
emailIntent.<span style="color: #006633;">putExtra</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">content</span>.<span style="color: #006633;">Intent</span>.<span style="color: #006633;">EXTRA_TEXT</span>, <span style="color: #0000ff;">&quot;This is the body of the email&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
startActivity<span style="color: #009900;">&#40;</span>Intent.<span style="color: #006633;">createChooser</span><span style="color: #009900;">&#40;</span>emailIntent, <span style="color: #0000ff;">&quot;Send mail...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
</div></pre><!--END_DEVFMTCODE--></p>
<p>Quick and simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://steveloper.com/how-to-send-an-email-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to call an ASP.NET web page from Android</title>
		<link>http://steveloper.com/how-to-call-an-asp-net-web-page-from-android/</link>
		<comments>http://steveloper.com/how-to-call-an-asp-net-web-page-from-android/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 13:41:07 +0000</pubDate>
		<dc:creator>stev9397</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://steveloper.com/?p=105</guid>
		<description><![CDATA[This is a simple way of connecting to an asp.net web page and getting data back from him. There may be more eloquent ways, but this is a simple approach. &#160;In your Android app create a class called SimpleWebCalls. Copy<span class="ellipsis">&#8230;</span> <a href="http://steveloper.com/how-to-call-an-asp-net-web-page-from-android/"><div class="read-more">Read more &#8250;</div><!-- end of .read-more --></a>]]></description>
			<content:encoded><![CDATA[<p>This is a simple way of connecting to an asp.net web page and getting data back from him. There may be more eloquent ways, but this is a simple approach. &nbsp;In your Android app create a class called SimpleWebCalls. Copy the <strong>[JAVA Code]</strong> below into it. &nbsp;Then in your asp.net project create a web page and copy the <strong>[ASP.NET CODE]</strong> below into it. &nbsp;</p>
<p>To implement, just code the web page to return what you need in the header. (In the example) and then call the function in Android.</p>
<p><strong>[Implementation Code]</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java"><div class="devcodeoverflow"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> GetDataFromServer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 SimpleWebCalls tWebCall <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleWebCalls<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003399;">String</span> sReturn<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
 sReturn <span style="color: #339933;">=</span> tWebCall.<span style="color: #006633;">CallWebPageAndGetDataBack</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WhatToSendInTheQueryString&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//do something with what was returned</span>
 <span style="color: #009900;">&#125;</span>
</div></pre><!--END_DEVFMTCODE-->&nbsp;</p>
<p><strong>[JAVA Code]:</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java"><div class="devcodeoverflow">
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.BufferedReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.InputStreamReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.UnsupportedEncodingException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URI</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URLEncoder</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.HttpResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.HttpClient</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.methods.HttpGet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.methods.HttpPost</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.impl.client.DefaultHttpClient</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleWebCalls <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> ImageBackup<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> sVariable<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #003399;">String</span> sReturn <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UNK&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">try</span>
 <span style="color: #009900;">&#123;</span>
 sVariable <span style="color: #339933;">=</span> <span style="color: #003399;">URLEncoder</span>.<span style="color: #006633;">encode</span><span style="color: #009900;">&#40;</span>sVariable, <span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">UnsupportedEncodingException</span> e1<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span>
 e1.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #666666; font-style: italic;">// Create a new HttpClient and Post Header</span>
 <span style="color: #000000; font-weight: bold;">try</span>
 <span style="color: #009900;">&#123;</span>
&nbsp;
 URI tURI <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> URI<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://YouASPNETSite.com/YourWebPage.aspx?VAR=&quot;</span> <span style="color: #339933;">+</span> sVariable<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 HttpClient httpClient <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DefaultHttpClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 HttpGet pageGet <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpGet<span style="color: #009900;">&#40;</span>tURI<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 HttpPost pagePost <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpPost<span style="color: #009900;">&#40;</span>tURI<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 HttpResponse response <span style="color: #339933;">=</span> httpClient.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>pagePost<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">// This is the response back from the server</span>
 <span style="color: #003399;">String</span> sList <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
 sList <span style="color: #339933;">=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>response.<span style="color: #006633;">getStatusLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getStatusCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">//This is the data that comes back from the server from the header information</span>
 <span style="color: #003399;">String</span> sMessage <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
 sMessage <span style="color: #339933;">=</span> response.<span style="color: #006633;">getHeaders</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;YourHeaderName&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">// This checks to see if the call was successfull</span>
 <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>sList.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;200&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 sReturn <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;COMPLETE&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">else</span>
 <span style="color: #009900;">&#123;</span>
 sReturn <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;FAIL&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 sReturn <span style="color: #339933;">=</span> sMessage<span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 sReturn <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ERR&quot;</span><span style="color: #339933;">;</span>
 e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">return</span> sReturn<span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
</div></pre><!--END_DEVFMTCODE--></p>
<p><strong>[ASP.NET CODE]</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Visual Basic"><div class="devcodeoverflow">
&nbsp;
Partial Class ExampleWebPage
  Inherits System.Web.UI.Page
&nbsp;
  Protected <span style="color: #E56717; font-weight: bold;">Sub</span> Page_Load(<span style="color: #151B8D; font-weight: bold;">ByVal</span> sender <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Object</span>, <span style="color: #151B8D; font-weight: bold;">ByVal</span> e <span style="color: #151B8D; font-weight: bold;">As</span> System.EventArgs) Handles Me.Load
    GetDataFromServer()
  <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span>
&nbsp;
  <span style="color: #E56717; font-weight: bold;">Public</span> <span style="color: #E56717; font-weight: bold;">Function</span> GetDataFromServer() <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>
    <span style="color: #151B8D; font-weight: bold;">Dim</span> sVar <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span> = QueryStringVariable
    <span style="color: #008000;">'Do something on the server with the query string sent</span>
    <span style="color: #008000;">'Do something on the server with the query string sent</span>
    <span style="color: #008000;">'Do something on the server with the query string sent</span>
&nbsp;
    Response.Headers.Add(<span style="color: #800000;">&quot;AustinAndroidReturn&quot;</span>, <span style="color: #800000;">&quot;YourReturnValue&quot;</span>)
    <span style="color: #008000;">'This will be sent back to the device</span>
&nbsp;
  <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Function</span>
  <span style="color: #E56717; font-weight: bold;">Public</span> ReadOnly <span style="color: #151B8D; font-weight: bold;">Property</span> QueryStringVariable() <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>
    <span style="color: #151B8D; font-weight: bold;">Get</span>
      <span style="color: #151B8D; font-weight: bold;">Dim</span> sReturn <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span> = <span style="color: #800000;">&quot;&quot;</span>
      Try
        sReturn = Request.QueryString(<span style="color: #800000;">&quot;VAR&quot;</span>).ToString
      Catch ex <span style="color: #151B8D; font-weight: bold;">As</span> Exception
        sReturn = <span style="color: #800000;">&quot;&quot;</span>
      <span style="color: #8D38C9; font-weight: bold;">End</span> Try
      Return sReturn
    <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #151B8D; font-weight: bold;">Get</span>
  <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #151B8D; font-weight: bold;">Property</span>
<span style="color: #8D38C9; font-weight: bold;">End</span> Class
&nbsp;
</div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://steveloper.com/how-to-call-an-asp-net-web-page-from-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a Longboard pole</title>
		<link>http://steveloper.com/how-to-make-a-longboard-pole/</link>
		<comments>http://steveloper.com/how-to-make-a-longboard-pole/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 14:09:08 +0000</pubDate>
		<dc:creator>stev9397</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://steveloper.com/?p=49</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://steveloper.com/how-to-make-a-longboard-pole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to read TXT messages in Android</title>
		<link>http://steveloper.com/how-to-read-txt-messages-in-android/</link>
		<comments>http://steveloper.com/how-to-read-txt-messages-in-android/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 14:08:16 +0000</pubDate>
		<dc:creator>stev9397</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[TXT Messages]]></category>

		<guid isPermaLink="false">http://steveloper.com/?p=47</guid>
		<description><![CDATA[This code provides a way for you to read all the text messages on your device from the inbox and outbox of the phone and it returns a delimited string of all the sms data. Go to the manifest and<span class="ellipsis">&#8230;</span> <a href="http://steveloper.com/how-to-read-txt-messages-in-android/"><div class="read-more">Read more &#8250;</div><!-- end of .read-more --></a>]]></description>
			<content:encoded><![CDATA[<p>This code provides a way for you to read all the text messages on your device from the inbox and outbox of the phone and it returns a delimited string of all the sms data.</p>
<p>Go to the manifest and add the following permission:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="XML"><div class="devcodeoverflow">
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.READ_SMS&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
</div></pre><!--END_DEVFMTCODE--><br />
Then add a the class called GetAllTextMessages to your project and copy the below <b>Core Code</b> to a class you have.  To call the function use the code below:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java"><div class="devcodeoverflow">
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> GetAllMessages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
GetAllTextMessages tMessage <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GetAllTextMessages<span style="color: #009900;">&#40;</span>mContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> sInbox<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> sOutBox<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
sInbox <span style="color: #339933;">=</span> tMessage.<span style="color: #006633;">SmsDetails</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
sOutBox <span style="color: #339933;">=</span> tMessage.<span style="color: #006633;">SmsDetails</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p>Simple enough and provide a way to access all the TXT messages from a phone.  Be aware that iterating through all the txt messages on a phone could produce a String value that is larger that 2mg.  2mg is the max size a String variable will take in Android/Java.  </p>
<h3>Core Code</h3>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java"><div class="devcodeoverflow"> 
&nbsp;
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.YourPackageHere</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.ContentUris</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.database.Cursor</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.net.Uri</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.provider.ContactsContract</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.telephony.PhoneNumberUtils</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GetAllTextMessages <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Context</span> mContext<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//steveloper.com</span>
<span style="color: #000000; font-weight: bold;">public</span> GetAllTextMessages<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// TODO Auto-generated constructor stub</span>
mContext <span style="color: #339933;">=</span> context<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_CONTENT_URI <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_INBOX_CONTENT_URI <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">withAppendedPath</span><span style="color: #009900;">&#40;</span>SMS_CONTENT_URI, <span style="color: #0000ff;">&quot;all&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Inbox <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/inbox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Failed <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Queued <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/queued&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Sent <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/sent&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Draft <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/draft&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Outbox <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/outbox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Undelivered <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/undelivered&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_All <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/all&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Uri SMS_Conversations <span style="color: #339933;">=</span> Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;content://sms/conversations&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> SmsDetails<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> inbox<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
StringBuilder sb <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> StringBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">try</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003399;">String</span> sMessageType <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> SMS_READ_COLUMN <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;read&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> SORT_ORDER <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot; _id ASC&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> count <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Cursor</span> cursor<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inbox <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
cursor <span style="color: #339933;">=</span> mContext.<span style="color: #006633;">getContentResolver</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>SMS_Inbox, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;_id&quot;</span>, <span style="color: #0000ff;">&quot;thread_id&quot;</span>, <span style="color: #0000ff;">&quot;address&quot;</span>, <span style="color: #0000ff;">&quot;person&quot;</span>, <span style="color: #0000ff;">&quot;date&quot;</span>, <span style="color: #0000ff;">&quot;body&quot;</span> <span style="color: #009900;">&#125;</span>, <span style="color: #0000ff;">&quot; _id &amp;gt; &quot;</span> <span style="color: #339933;">+</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">null</span>, SORT_ORDER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
sMessageType <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #009900;">&#123;</span>
cursor <span style="color: #339933;">=</span> mContext.<span style="color: #006633;">getContentResolver</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>SMS_Sent, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;_id&quot;</span>, <span style="color: #0000ff;">&quot;thread_id&quot;</span>, <span style="color: #0000ff;">&quot;address&quot;</span>, <span style="color: #0000ff;">&quot;person&quot;</span>, <span style="color: #0000ff;">&quot;date&quot;</span>, <span style="color: #0000ff;">&quot;body&quot;</span> <span style="color: #009900;">&#125;</span>, <span style="color: #0000ff;">&quot; _id &amp;gt; &quot;</span> <span style="color: #339933;">+</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span>,<span style="color: #000066; font-weight: bold;">null</span>, SORT_ORDER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
sMessageType <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003399;">String</span> sDetail <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> iCnt <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> iLimit <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cursor <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">try</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cursor.<span style="color: #006633;">moveToFirst</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003399;">String</span> body <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #009900;">&#123;</span>
iCnt <span style="color: #339933;">=</span> iCnt <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>iCnt <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> iLimit<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">long</span> messageId <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">long</span> threadId <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> address <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">long</span> contactId <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> contactId_string <span style="color: #339933;">=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>contactId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">long</span> timestamp <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> sBody <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
sDetail <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
sDetail <span style="color: #339933;">+=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>messageId<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// messageId</span>
sDetail <span style="color: #339933;">+=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>threadId<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// threadId</span>
sDetail <span style="color: #339933;">+=</span> address <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// address</span>
sDetail <span style="color: #339933;">+=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>contactId<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// contactId</span>
sDetail <span style="color: #339933;">+=</span> GetPersonNameDetails<span style="color: #009900;">&#40;</span>contactId_string, address<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// </span>
sDetail <span style="color: #339933;">+=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>timestamp<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// timestamp</span>
sDetail <span style="color: #339933;">+=</span> sBody <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// body</span>
sDetail <span style="color: #339933;">+=</span> sMessageType <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;^&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// Message Type</span>
sb.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span>sDetail <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>cursor.<span style="color: #006633;">moveToNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
cursor.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// return null;</span>
<span style="color: #000000; font-weight: bold;">return</span> sb.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> GetPersonNameDetails<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> ID, <span style="color: #003399;">String</span> address<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003399;">String</span> sReturn<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UNK&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">try</span>
<span style="color: #009900;">&#123;</span>
sReturn<span style="color: #339933;">=</span>PhoneNumberUtils.<span style="color: #006633;">formatNumber</span><span style="color: #009900;">&#40;</span>address<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Uri contactUri <span style="color: #339933;">=</span> ContentUris.<span style="color: #006633;">withAppendedId</span><span style="color: #009900;">&#40;</span>ContactsContract.<span style="color: #006633;">Contacts</span>.<span style="color: #006633;">CONTENT_URI</span>, <span style="color: #003399;">Integer</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>ID<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Cursor</span> cursor <span style="color: #339933;">=</span> mContext.<span style="color: #006633;">getContentResolver</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>contactUri, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> ContactsContract.<span style="color: #006633;">CommonDataKinds</span>.<span style="color: #006633;">Phone</span>.<span style="color: #006633;">DISPLAY_NAME</span> <span style="color: #009900;">&#125;</span>, <span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cursor <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cursor.<span style="color: #006633;">getCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
cursor.<span style="color: #006633;">moveToFirst</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> name <span style="color: #339933;">=</span> cursor.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
sReturn<span style="color: #339933;">=</span>name<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
cursor.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">return</span> sReturn<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
</div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://steveloper.com/how-to-read-txt-messages-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Facebook TXT messages work</title>
		<link>http://steveloper.com/how-facebook-txt-messages-work/</link>
		<comments>http://steveloper.com/how-facebook-txt-messages-work/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 14:06:39 +0000</pubDate>
		<dc:creator>stev9397</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[TXT Messages]]></category>

		<guid isPermaLink="false">http://steveloper.com/?p=45</guid>
		<description><![CDATA[Facebook has an option to communicate through TXT messages.  I like this option, because I can do quick replies to status updates.  The regular Facebook app was slow, so I ethically hacked the way Facebook TXT messages worked and built<span class="ellipsis">&#8230;</span> <a href="http://steveloper.com/how-facebook-txt-messages-work/"><div class="read-more">Read more &#8250;</div><!-- end of .read-more --></a>]]></description>
			<content:encoded><![CDATA[<p>Facebook has an option to communicate through TXT messages.  I like this option, because I can do quick replies to status updates.  The regular Facebook app was slow, so I ethically hacked the way Facebook TXT messages worked and <a href="https://play.google.com/store/apps/details?id=com.austinandroid.facebookclean" target="_blank">built and app for it (TXT Manager for Facebook)</a>.</p>
<p>If you have TXT notifications turned on in your Facebook settings, any updates sent through text will come from TXT Numbers:</p>
<ul>
<li>32665 or</li>
<li>32665100-32665198</li>
</ul>
<p>For example:  You subscribe to a your friend John status&#8217; through txt message.   John updates his status to &#8220;Eating a hamburger.&#8221;  FB sends you a message from 32665 with his status:</p>
<p><strong>John Smith&#8217;s status: Eating a hamburger Reply with your comment or &#8220;like&#8221;</strong></p>
<p>You reply &#8220;like&#8221; to the message and John knows that you like his status.</p>
<p>When Facebook sends you a TXT message it ties a couple things together to track what they are sending and what you are replying to.  The table probably looks something like this</p>
<table width="95%">
<tbody>
<tr>
<td>MessageID</td>
<td>StatusID</td>
<td>TXTMessageNumber</td>
<td>DestinationPhoneNumber</td>
<td>CreateDate</td>
</tr>
<tr>
<td> 1</td>
<td> 50</td>
<td> 32665</td>
<td> 404-555-1234</td>
<td>01/01/2012</td>
</tr>
<tr>
<td> 2</td>
<td> 51</td>
<td> 32665100</td>
<td> 404-555-1234</td>
<td>01/01/2012</td>
</tr>
<tr>
<td> 3</td>
<td> 52</td>
<td> 32665101</td>
<td> 404-555-1234</td>
<td>01/01/2012</td>
</tr>
</tbody>
</table>
<p>When you reply back to the txt message, your phone number is used as part of the key to look up what to respond to.  So the key to the data is pairing of the TXT number you responded to, your phone number and the date of your response.  I have notices that if you respond to a TXT message that is older than 24 hours, your response may not be recorded.  They have multiple TXT Message numbers that they send from, so you can respond to multiple status updates etc.</p>
<p>One thing that is annoying about this process, is that you can end up with a large amount of TXT messages all from different numbers.  It makes managing your TXT messages a little bit cumbersome.  <a href="https://play.google.com/store/apps/details?id=com.austinandroid.facebookclean" target="_blank">So in the app I developed</a>, I created a way to delete all TXT messages from FB .</p>
<p>&nbsp;</p>
<p><a href="http://steveloper.com/wp-content/uploads/2012/04/1.jpg"><img class="alignnone size-full wp-image-68" title="1" src="http://steveloper.com/wp-content/uploads/2012/04/1.jpg" alt="" width="307" height="512" /></a> <a href="http://steveloper.com/wp-content/uploads/2012/04/2.jpg"><img class="alignnone size-full wp-image-69" title="2" src="http://steveloper.com/wp-content/uploads/2012/04/2.jpg" alt="" width="307" height="512" /></a><a href="http://steveloper.com/wp-content/uploads/2012/04/1.jpg"><img class="alignnone size-full wp-image-68" title="1" src="http://steveloper.com/wp-content/uploads/2012/04/1.jpg" alt="" width="307" height="512" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://steveloper.com/how-facebook-txt-messages-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

