<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rodsit  Services</title>
	<atom:link href="http://rodsit.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rodsit.wordpress.com</link>
	<description>Mobile technology</description>
	<lastBuildDate>Tue, 04 Dec 2012 21:28:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rodsit.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rodsit  Services</title>
		<link>http://rodsit.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rodsit.wordpress.com/osd.xml" title="Rodsit  Services" />
	<atom:link rel='hub' href='http://rodsit.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Testing</title>
		<link>http://rodsit.wordpress.com/2011/12/20/testing/</link>
		<comments>http://rodsit.wordpress.com/2011/12/20/testing/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 18:02:22 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=173</guid>
		<description><![CDATA[test 1 2 3<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=173&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>test 1 2 3</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=173&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2011/12/20/testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Business Vocabulary</title>
		<link>http://rodsit.wordpress.com/2011/12/19/business-vocabulary/</link>
		<comments>http://rodsit.wordpress.com/2011/12/19/business-vocabulary/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 17:27:37 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/2011/12/19/business-vocabulary/</guid>
		<description><![CDATA[any problems email me rodsit@gmail.com An application to get you thinking in business language rather than everyday language. Modern business terms carefully handwritten &#8211; a little accountancy, a little marketing and general business English. A good mix. Just press the &#8230; <a href="http://rodsit.wordpress.com/2011/12/19/business-vocabulary/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=164&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>any problems email me rodsit@gmail.com</p>
<p>An application to get you thinking in business language rather than everyday language. Modern business terms carefully handwritten &#8211; a little accountancy, a little marketing and general business English. A good mix.</p>
<p>Just press the &#8216;question&#8217; button and try to get the definition of the business term used. It does not matter if you get it slightly wrong &#8211; the wording is never exact. But you must try to use business jargon rather than home or sport language.</p>
<p>Good for native speakers of English to get them attuned to business jargon. </p>
<p>Good for leaners of English language.</p>
<p>Good for teachers &#8211; you get a ready-made lesson with answers!</p>
<p><a href="http://rodsit.files.wordpress.com/2011/12/business-1.png"><img class="size-full wp-image" src="http://rodsit.files.wordpress.com/2011/12/business-1.png?w=354" alt="Image" /></a></p>
<p><a href="http://rodsit.files.wordpress.com/2011/12/business-2.png"><img class="size-full wp-image" src="http://rodsit.files.wordpress.com/2011/12/business-2.png?w=362" alt="Image" /></a></p>
<p><a href="http://rodsit.files.wordpress.com/2011/12/business-3.png"><img class="size-full wp-image" src="http://rodsit.files.wordpress.com/2011/12/business-3.png?w=352" alt="Image" /></a></p>
<p><a href="http://rodsit.files.wordpress.com/2011/12/business-4.png"><img class="size-full wp-image" src="http://rodsit.files.wordpress.com/2011/12/business-4.png?w=355" alt="Image" /></a></p>
<p> </p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=164&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2011/12/19/business-vocabulary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2011/12/business-1.png?w=354" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2011/12/business-2.png?w=362" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2011/12/business-3.png?w=352" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2011/12/business-4.png?w=355" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>
	</item>
		<item>
		<title>JSONArray and JSONObject Android</title>
		<link>http://rodsit.wordpress.com/2011/08/03/jsonarray-and-jsonobject-android/</link>
		<comments>http://rodsit.wordpress.com/2011/08/03/jsonarray-and-jsonobject-android/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 07:06:27 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[JSONArray]]></category>
		<category><![CDATA[JSONObject]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=107</guid>
		<description><![CDATA[Having problems retrieving your data using java libraries JSONObject? I am not surprised because its not so easy. This example will help you: /* &#8211; here is an example JSON object from a URL (guardian API) { &#8220;response&#8221;:{ &#8220;status&#8221;:&#8221;ok&#8221;, &#8220;userTier&#8221;:&#8221;free&#8221;, &#8230; <a href="http://rodsit.wordpress.com/2011/08/03/jsonarray-and-jsonobject-android/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=107&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Having problems retrieving your data using java libraries JSONObject?<br />
I am not surprised because its not so easy. This example will help you:</p>
<p>            /* &#8211; here is an example JSON object from a URL (guardian API)<br />
            {<br />
            	  &#8220;response&#8221;:{<br />
            	    &#8220;status&#8221;:&#8221;ok&#8221;,<br />
            	    &#8220;userTier&#8221;:&#8221;free&#8221;,<br />
            	    &#8220;total&#8221;:1361206,<br />
            	    &#8220;startIndex&#8221;:1,<br />
            	    &#8220;pageSize&#8221;:10,<br />
            	    &#8220;currentPage&#8221;:1,<br />
            	    &#8220;pages&#8221;:136121,<br />
            	    &#8220;orderBy&#8221;:&#8221;newest&#8221;,<br />
            	    &#8220;results&#8221;:[{<br />
            	      "id":"world/2011/aug/03/hosni-mubarak-way-trial",<br />
            	      "sectionId":"world",<br />
            	      "sectionName":"World news",<br />
            	      "webPublicationDate":"2011-08-03T07:11:00+01:00",<br />
            	      "webTitle":"Hosni Mubarak on way to face trial, says Egyptian official",<br />
            	      "webUrl":"http://www.guardian.co.uk/world/2011/aug/03/hosni-mubarak-way-trial",<br />
            	      "apiUrl":"http://content.guardianapis.com/world/2011/aug/03/hosni-mubarak-way-trial"<br />
            	    },{<br />
            	      "id":"public-leaders-network/2011/aug/03/pfi-promises-rhetoric-reality",<br />
            	      "sectionId":"public-leaders-network",<br />
            	      "sectionName":"Public Leaders Network",<br />
            	      "webPublicationDate":"2011-08-03T07:00:04+01:00",<br />
            	      "webTitle":"PFI promises are more rhetoric than reality",<br />
            	      "webUrl":"http://www.guardian.co.uk/public-leaders-network/2011/aug/03/pfi-promises-rhetoric-reality",<br />
            	      "apiUrl":"http://content.guardianapis.com/public-leaders-network/2011/aug/03/pfi-promises-rhetoric-reality"<br />
            	    },{<br />
            	      "id":"money/2011/aug/03/home-rental-costs-hit-record-highs",<br />
            	      "sectionId":"money",<br />
            	      "sectionName":"Money",<br />
            	      "webPublicationDate":"2011-08-03T07:00:03+01:00",<br />
            	      "webTitle":"Rents soar to record levels",<br />
            	      "webUrl":"http://www.guardian.co.uk/money/2011/aug/03/home-rental-costs-hit-record-highs",<br />
            	      "apiUrl":"http://content.guardianapis.com/money/2011/aug/03/home-rental-costs-hit-record-highs"<br />
            	    },{<br />
            	      "id":"global-development/poverty-matters/2011/aug/03/africa-drought-uganda-no-somalia",<br />
            	      "sectionId":"global-development",<br />
            	      "sectionName":"Global development",<br />
            	      "webPublicationDate":"2011-08-03T07:00:02+01:00",<br />
            	      "webTitle":"East Africa drought: Uganda has problems, but it is no Somalia | Ben Jones",<br />
            	      "webUrl":"http://www.guardian.co.uk/global-development/poverty-matters/2011/aug/03/africa-drought-uganda-no-somalia",<br />
            	      "apiUrl":"http://content.guardianapis.com/global-development/poverty-matters/2011/aug/03/africa-drought-uganda-no-somalia"<br />
            	    },{<br />
            	      "id":"money/2011/aug/03/virginia-wallis-redemption-charges",<br />
            	      "sectionId":"money",<br />
            	      "sectionName":"Money",<br />
            	      "webPublicationDate":"2011-08-03T07:00:01+01:00",<br />
            	      "webTitle":"Angry and confused over change in mortgage redemption charges",<br />
            	      "webUrl":"http://www.guardian.co.uk/money/2011/aug/03/virginia-wallis-redemption-charges",<br />
            	      "apiUrl":"http://content.guardianapis.com/money/2011/aug/03/virginia-wallis-redemption-charges"<br />
            	    },{<br />
            	      "id":"money/2011/aug/03/virginia-wallis-house-flats-mortgage",<br />
            	      "sectionId":"money",<br />
            	      "sectionName":"Money",<br />
            	      "webPublicationDate":"2011-08-03T07:00:00+01:00",<br />
            	      "webTitle":"I want to convert flats back into a single house \u2013 what mortgage should I go for?",<br />
            	      "webUrl":"http://www.guardian.co.uk/money/2011/aug/03/virginia-wallis-house-flats-mortgage",<br />
            	      "apiUrl":"http://content.guardianapis.com/money/2011/aug/03/virginia-wallis-house-flats-mortgage"<br />
            	    },{<br />
            	      "id":"world/2011/aug/03/china-calls-us-debt-manage",<br />
            	      "sectionId":"world",<br />
            	      "sectionName":"World news",<br />
            	      "webPublicationDate":"2011-08-03T06:45:36+01:00",<br />
            	      "webTitle":"China calls on US to manage its debt 'responsibly' from now on",<br />
            	      "webUrl":"http://www.guardian.co.uk/world/2011/aug/03/china-calls-us-debt-manage",<br />
            	      "apiUrl":"http://content.guardianapis.com/world/2011/aug/03/china-calls-us-debt-manage"<br />
            	    },{<br />
            	      "id":"technology/blog/2011/aug/03/google-sergey-brin-2000-tv-show",<br />
            	      "sectionId":"technology",<br />
            	      "sectionName":"Technology",<br />
            	      "webPublicationDate":"2011-08-03T06:40:00+01:00",<br />
            	      "webTitle":"It's 2000: can you spot the real Sergey Brin on the quizshow?",<br />
            	      "webUrl":"http://www.guardian.co.uk/technology/blog/2011/aug/03/google-sergey-brin-2000-tv-show",<br />
            	      "apiUrl":"http://content.guardianapis.com/technology/blog/2011/aug/03/google-sergey-brin-2000-tv-show"<br />
            	    },{<br />
            	      "id":"environment/2011/aug/03/garden-birds-avian-pox-virus",<br />
            	      "sectionId":"environment",<br />
            	      "sectionName":"Environment",<br />
            	      "webPublicationDate":"2011-08-03T06:00:02+01:00",<br />
            	      "webTitle":"UK garden birds hit by avian pox virus",<br />
            	      "webUrl":"http://www.guardian.co.uk/environment/2011/aug/03/garden-birds-avian-pox-virus",<br />
            	      "apiUrl":"http://content.guardianapis.com/environment/2011/aug/03/garden-birds-avian-pox-virus"<br />
            	    },{<br />
            	      "id":"voluntary-sector-network/2011/aug/03/charity-sector-management-recruitments",<br />
            	      "sectionId":"voluntary-sector-network",<br />
            	      "sectionName":"Voluntary Sector Network",<br />
            	      "webPublicationDate":"2011-08-03T06:00:02+01:00",<br />
            	      "webTitle":"Demand for interim managers in charity sector remains high, says recruitment specialist",<br />
            	      "webUrl":"http://www.guardian.co.uk/voluntary-sector-network/2011/aug/03/charity-sector-management-recruitments",<br />
            	      "apiUrl":"http://content.guardianapis.com/voluntary-sector-network/2011/aug/03/charity-sector-management-recruitments"<br />
            	    }]  }}<br />
 */</p>
<p>// retrieve your JSON somehow, I am using URLConnection. If you want the whole code email me.<br />
   URL twitter = new URL(&#8220;<a href="http://content.guardianapis.com/search?format=json&#038;#8221" rel="nofollow">http://content.guardianapis.com/search?format=json&#038;#8221</a>;);<br />
   URLConnection tc = twitter.openConnection();<br />
   BufferedReader in = new BufferedReader(new InputStreamReader(<br />
   tc.getInputStream()));</p>
<p>    //. put your JSON into a string:<br />
    StringBuilder sb = new StringBuilder();<br />
       String line;<br />
       while ((line = in.readLine()) != null) {<br />
       sb.append(line + &#8220;\n&#8221;);<br />
    }<br />
// <strong>here is what you probably want most</strong> &#8211; its not so damn obvious. I got there by &#8216;trial and error&#8217; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
   JSONObject jObject2 = new JSONObject(sb.toString());<br />
   JSONObject menuObject2 = jObject2.getJSONObject(&#8220;response&#8221;);<br />
   String attributeId12 = menuObject2.getString(&#8220;status&#8221;);<br />
   System.out.println(&#8220;value == &#8221; +attributeId12);<br />
   String attributeId22 = menuObject2.getString(&#8220;userTier&#8221;);<br />
   System.out.println(&#8220;value == &#8221; +attributeId22);<br />
   String attribute3 = menuObject2.getString(&#8220;results&#8221;);<br />
   System.out.println(&#8220;value == &#8221; +attribute3);<br />
   JSONArray ja4 =  jObject2.getJSONObject(&#8220;response&#8221;).getJSONArray(&#8220;results&#8221;);<br />
   System.out.println(&#8220;sub1_att = &#8221; + ja4.getJSONObject(0).getString(&#8220;sectionId&#8221;).toString()+&#8221;\n\n&#8221;);<br />
   System.out.println(&#8220;sub1_att = &#8221; + ja4.getJSONObject(0).getString(&#8220;sectionName&#8221;).toString()+&#8221;\n\n&#8221;);<br />
 for (int i=0;i&lt;ja4.length();i++){<br />
 System.out.println(&quot;length = &quot; +     ja4.getJSONObject(i).getString(&quot;sectionName&quot;).toString()+&quot;\n\n&quot;);<br />
}</p>
<p><strong>All the best with this JSONObject library. It does work but needs careful coding.</strong><br />
&#8216;Like me&#8217; if you appreciated this pls.</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=107&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2011/08/03/jsonarray-and-jsonobject-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Take care of laptop power charger adapters</title>
		<link>http://rodsit.wordpress.com/2011/06/05/take-care-of-laptop-power-charger-adapters/</link>
		<comments>http://rodsit.wordpress.com/2011/06/05/take-care-of-laptop-power-charger-adapters/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 08:41:20 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cheap power chargers]]></category>
		<category><![CDATA[laptop charger]]></category>
		<category><![CDATA[looking after]]></category>
		<category><![CDATA[notebook power charger]]></category>
		<category><![CDATA[power adapter]]></category>
		<category><![CDATA[power charger]]></category>
		<category><![CDATA[taking care]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=101</guid>
		<description><![CDATA[Many notebook power adapters are made with cheap components these days. You may have noticed. Here is how to make them last longer 1) Do not bend the cables as they can break easily these days. I have taped cables &#8230; <a href="http://rodsit.wordpress.com/2011/06/05/take-care-of-laptop-power-charger-adapters/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=101&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Many notebook power adapters are made with cheap components these days. You may have noticed. Here is how to make them last longer</p>
<p>1) Do not bend the cables as they can break easily these days. I have taped cables to the charger body to prevent them waggling around too much. If you carry your adapter round in a laptop bag then give it lots of room and place it in  your back carefully &#8211; as if it were made of glass.<br />
2) Try not to let the adapter get too hot. Processor running full tilt and battery half charged will heat the charger up too much.<br />
3) So, check charger does not get too hot and handle it VERY carefully.</p>
<p>These tips will give you extra time with your very fragile power adapter. All the best with it. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Note: Looking forward to much needed advances in power adapter design. I suppose its not sexy enough <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=101&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2011/06/05/take-care-of-laptop-power-charger-adapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Java Thread wait and notify for Right Handed Thinkers</title>
		<link>http://rodsit.wordpress.com/2011/05/18/java-thread-wait-and-notify-for-right-handed-thinkers/</link>
		<comments>http://rodsit.wordpress.com/2011/05/18/java-thread-wait-and-notify-for-right-handed-thinkers/#comments</comments>
		<pubDate>Wed, 18 May 2011 18:30:40 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[java synchonise]]></category>
		<category><![CDATA[java synchonized]]></category>
		<category><![CDATA[java threads]]></category>
		<category><![CDATA[java wait notify]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=94</guid>
		<description><![CDATA[This code may be enough for you, but I will add a few words at the end. (note: if you use this code replace the WordPress &#8221; with real ones) ********************************* package com.multiple.threads; public class Controller { public static void &#8230; <a href="http://rodsit.wordpress.com/2011/05/18/java-thread-wait-and-notify-for-right-handed-thinkers/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=94&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This code may be enough for you, but I will add a few words at the end. (note: if you use this code replace the WordPress &#8221; with real ones)</p>
<p>*********************************<br />
package com.multiple.threads;</p>
<p>public class Controller<br />
{<br />
public static void main(String[]args) throws InterruptedException<br />
{<br />
WorkingClass  b1 =new WorkingClass();<br />
Thread b = new Thread(b1);<br />
b.start();<br />
synchronized(b)<br />
{<br />
System.out.println(&#8220;1 Just about to call wait()&#8221; + b.getName());<br />
b.wait();<br />
System.out.println(&#8220;2 Just got notified&#8221;);}<br />
System.out.println(&#8220;3 Ended here&#8221;);}}</p>
<p>class WorkingClass implements Runnable<br />
{<br />
public void  run(){ synchronized (this){<br />
System.out.println(&#8220;4 Starting a 4 sec sleep, nighty night.&#8221;);<br />
try{ Thread.sleep(4000); }catch(Exception e){}<br />
System.out.println(&#8220;5 Finished sleeping and calling notification&#8221;);<br />
notify();<br />
}}}<br />
**********************************<br />
output is:<br />
1 Just about to call wait() Thread-0<br />
4 Starting delay<br />
5 Finished sleeping and calling notification<br />
2 Just got notified<br />
3 ended here</p>
<p>So, you have to synchronize your thread object and run() to get locks. Then the thread stops at the wait() stage and does nothing until notify() &#8211; after the task is finished. At which point it goes to the last stage in the program and finishes. &#8211; The task here is a 4 second sleep, but it could be getting data online.<br />
Try it in your terminal window &#8211; it works.</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=94&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2011/05/18/java-thread-wait-and-notify-for-right-handed-thinkers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Java Interfaces and Threads for Right Hand Thinkers</title>
		<link>http://rodsit.wordpress.com/2011/05/18/java-interfaces-and-threads-for-right-hand-thinkers/</link>
		<comments>http://rodsit.wordpress.com/2011/05/18/java-interfaces-and-threads-for-right-hand-thinkers/#comments</comments>
		<pubDate>Wed, 18 May 2011 15:54:29 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[easy interface example]]></category>
		<category><![CDATA[java interface example]]></category>
		<category><![CDATA[java interface tutorial]]></category>
		<category><![CDATA[java interfaces]]></category>
		<category><![CDATA[java runnable]]></category>
		<category><![CDATA[java start thread]]></category>
		<category><![CDATA[java Thread]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=86</guid>
		<description><![CDATA[How can a java interface gain you access to methods in classes that implement the same interface? How can a Thread use a start() method that is nowhere to be seen (its hiding in Thread). To solve these convoluted issues &#8230; <a href="http://rodsit.wordpress.com/2011/05/18/java-interfaces-and-threads-for-right-hand-thinkers/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=86&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>How can a java interface gain you access to methods in classes that implement the same interface?<br />
How can a Thread use a start() method that is nowhere to be seen (its hiding in Thread).</p>
<p>To solve these convoluted issues I have written a Thready class that is similar to java.lang.Thread and a Runnabley interface that is similar to java.lang.Runnable but just 4 or 5 lines so that you can then see exactly how its all working. Its hard to explain in words without being an annoying geek.</p>
<p>So, here&#8217;s some code to look at and run at home.<br />
 Thread becomes Thready and Runnable becomes Runnabley. The users class is called FakeThread:</p>
<p>************************************************<br />
package com.thready;</p>
<p>public class FakeThread implements Runnabley {</p>
<p>	 public static void main(String[] args){</p>
<p>        // or   Runnabley runnable = new FakeThread();<br />
        FakeThread runnable = new FakeThread();<br />
	Thready thready = new Thready(runnable);</p>
<p>       // or   Thready thready = new Thready(new FakeThread());<br />
		thready.start();<br />
		System.out.println(&#8221; running thread &#8220;+thready.getName()); </p>
<p>}<br />
      public 	void run(){<br />
	 	System.out.println(&#8221; running dummy thread from FakeThread &#8220;);<br />
	  }<br />
}<br />
********************************************************</p>
<p>Here is a fake Thready class (similar to the real Thread class)<br />
******************************************<br />
package com.thready;</p>
<p>public class Thready implements Runnabley {</p>
<p>	private Runnabley target; 	</p>
<p>		public Thready(Runnabley target){<br />
		this.target = target;<br />
	}</p>
<p>    public void run() {<br />
	        if (target != null) {<br />
	        target.run();<br />
	        }<br />
	       	System.out.println(&#8221; from run() in Thready but in this case NOT a real thread but a dummy one &#8220;);<br />
	        }<br />
	        public void start(){<br />
	        System.out.println(&#8221; from start() in Thready class &#8220;);<br />
	        run();<br />
	        }<br />
	        public final String getName() {<br />
	        return &#8220;FredTheThread&#8221;;<br />
	        }<br />
	}<br />
*********************************</p>
<p>Here is Runnabley, similar to java.lang.Runnable:<br />
**************************<br />
package com.thready;</p>
<p>public interface Runnabley {    </p>
<p>	public abstract void run();</p>
<p>}<br />
***********************************</p>
<p>If you want to do a real Thread and Runnable, then here is your tester class:<br />
***********************************<br />
package com.thready;</p>
<p>public class Test2 implements Runnable {</p>
<p>	 public static void main(String[] args){</p>
<p>		 Runnable runnable = new Test2();</p>
<p>		Thread thread = new Thread(runnable);</p>
<p>		thread.start();<br />
		System.out.println(&#8221; running thread &#8220;+thread.getName()); </p>
<p>}</p>
<p>                public  void run(){<br />
	 	System.out.println(&#8221; running thread in run test2 class &#8220;);<br />
	}</p>
<p>}<br />
***********************************************************</p>
<p>If you like words here are some: If your class implements an interface, then when you make an object it automatically becomes an object of the interface as well. Then all classes that implement the same interface can use each other&#8217;s methods if they want. See how we make a thread object that takes an interface in its constructor, pass it our class object and then we get access to methods in Thread. Run() in Thread runs because something in Thread tells it to run, &#8211; target.run()  &#8211; not because it is overwritten. </p>
<p>Its best to play around with the code I have given you answering the questions:<br />
1) How can run() in your class be called?<br />
2) How is start() in Thread called?<br />
3) If Thread had no constructor that took a Runnable, how would things change.</p>
<p>Like I said it IS convoluted, so all the best.</p>
<p>Answer to 3)<br />
The class thread needs to call run() in our users class. Therefore it needs to know<br />
the name of our user classes object so it can call it. That object gets into Thread via its constructor.<br />
(I repeat its not overwriting the run() method, its actually being called form Thread. </p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=86&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2011/05/18/java-interfaces-and-threads-for-right-hand-thinkers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Android Graphics &amp; Applications</title>
		<link>http://rodsit.wordpress.com/2010/12/01/android-graphics/</link>
		<comments>http://rodsit.wordpress.com/2010/12/01/android-graphics/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 20:00:45 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[free graphics]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=62</guid>
		<description><![CDATA[Feel free to help yourself &#8211; I am not claiming any copyright on these images. Android on a Wall Radioactive Android Through-the-Glass Android Night-Time Android Friendly Android Alpha Cut-Out Android<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=62&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Feel free to help yourself &#8211; I am not claiming any copyright on these images.<br />
<strong>Android on a Wall<br />
<a href="http://rodsit.files.wordpress.com/2010/12/bigandroid7.png"><img src="http://rodsit.files.wordpress.com/2010/12/bigandroid7.png?w=300&#038;h=300" alt="" title="Brick Walled Android" width="300" height="300" class="alignnone size-medium wp-image-63" /></a><br />
Radioactive Android<br />
<a href="http://rodsit.files.wordpress.com/2010/12/bigandroid8.png"><img src="http://rodsit.files.wordpress.com/2010/12/bigandroid8.png?w=300&#038;h=300" alt="" title="Radioactive Android" width="300" height="300" class="alignnone size-medium wp-image-65" /></a><br />
Through-the-Glass Android<br />
<a href="http://rodsit.files.wordpress.com/2010/12/bigandroid6.png"><img src="http://rodsit.files.wordpress.com/2010/12/bigandroid6.png?w=300&#038;h=300" alt="" title="Through-the-Glass Android" width="300" height="300" class="alignnone size-medium wp-image-66" /></a><br />
Night-Time Android<br />
<a href="http://rodsit.files.wordpress.com/2010/12/bigandroid9.png"><img src="http://rodsit.files.wordpress.com/2010/12/bigandroid9.png?w=300&#038;h=300" alt="" title="BigAndroid9" width="300" height="300" class="alignnone size-medium wp-image-68" /></a><br />
Friendly Android<br />
<a href="http://rodsit.files.wordpress.com/2010/12/bigandroid5.png"><img src="http://rodsit.files.wordpress.com/2010/12/bigandroid5.png?w=300&#038;h=300" alt="" title="BigAndroid5" width="300" height="300" class="alignnone size-medium wp-image-69" /></a><br />
Alpha Cut-Out Android<br />
<a href="http://rodsit.files.wordpress.com/2010/12/android-alpha.png"><img src="http://rodsit.files.wordpress.com/2010/12/android-alpha.png?w=260&#038;h=300" alt="" title="Android-alpha" width="260" height="300" class="alignnone size-medium wp-image-70" /></a></p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=62&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2010/12/01/android-graphics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/12/bigandroid7.png?w=300" medium="image">
			<media:title type="html">Brick Walled Android</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/12/bigandroid8.png?w=300" medium="image">
			<media:title type="html">Radioactive Android</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/12/bigandroid6.png?w=300" medium="image">
			<media:title type="html">Through-the-Glass Android</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/12/bigandroid9.png?w=300" medium="image">
			<media:title type="html">BigAndroid9</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/12/bigandroid5.png?w=300" medium="image">
			<media:title type="html">BigAndroid5</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/12/android-alpha.png?w=260" medium="image">
			<media:title type="html">Android-alpha</media:title>
		</media:content>
	</item>
		<item>
		<title>Android File I/O &amp; Language</title>
		<link>http://rodsit.wordpress.com/2010/12/01/android-file-writing/</link>
		<comments>http://rodsit.wordpress.com/2010/12/01/android-file-writing/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 11:17:08 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=43</guid>
		<description><![CDATA[Android file writing using a variety of paradigms. Note it is best to add a BufferedReader buffer size &#8211; or the default is 8K. package com.readwriter; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; &#8230; <a href="http://rodsit.wordpress.com/2010/12/01/android-file-writing/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=43&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Android file writing using a variety of paradigms. Note it is best to add a BufferedReader buffer size &#8211; or the default is 8K.</p>
<p>package com.readwriter;  </p>
<p>import java.io.BufferedReader;<br />
import java.io.FileInputStream;<br />
import java.io.FileNotFoundException;<br />
import java.io.FileOutputStream;<br />
import java.io.IOException;<br />
import java.io.InputStream;<br />
import java.io.InputStreamReader;<br />
import java.io.OutputStream;<br />
import java.io.OutputStreamWriter;<br />
import java.io.Writer;<br />
import java.util.ArrayList;<br />
import java.util.HashSet;<br />
import java.util.Random;</p>
<p>public class CheckFileForRepeats2 {<br />
	OutputStream outputStream;<br />
	static ArrayList  ar = new ArrayList();<br />
	static ArrayList  br = new ArrayList();<br />
	String endOfVerb, endOfVerb_1, theAnswer;<br />
private static String x;<br />
static	String newy;<br />
	public static void main(String[] args) {<br />
		CheckFileForRepeats2 neu = new CheckFileForRepeats2();<br />
		for(int i = 2;i&lt;92316;i++){ // i must be 1 more than lines in  file<br />
			x = neu.readLines(&quot;RepeatsCheck.txt&quot;,i);<br />
			if(ar.contains(x)){<br />
		  	System.out.println(&quot; contain &quot; + x);<br />
			}<br />
			ar.add(neu.findWord(&quot;RepeatsCheck.txt&quot;, x));<br />
		}</p>
<p>	} // end of main<br />
	public static void writeIt(String sentence_to_write, String file) throws Exception {<br />
		  OutputStream  outputStream;<br />
	      outputStream = new FileOutputStream(&quot;res/raw/&quot;+file,true);<br />
		  Writer   writer   = new OutputStreamWriter(outputStream);<br />
		  try {<br />
			writer.write(sentence_to_write + &quot;\n&quot;);<br />
		} catch (IOException e) {<br />
			}<br />
		  try {<br />
			writer.close();<br />
		} catch (IOException e) {<br />
		}<br />
	  } // end of writeIt method<br />
	   String findWord(String file, String theWord){  // machtes theWord to one in<br />
	    	Random generator = new Random();<br />
	        int numy = generator.nextInt(f_tot) + 1;<br />
	        InputStream in = this.getResources().openRawResource(R.raw.wordlist);<br />
		    InputStream   in;<br />
			 try{<br />
				    in = new FileInputStream(&quot;/&quot;+file); // on the effing c drive<br />
			 } catch(Exception e) {<br />
			     try {<br />
				  in = new FileInputStream(&quot;/&quot;+file);<br />
			     } catch(Exception e2){ return &quot;didntread_1&quot;;  }<br />
			 }<br />
	        StringBuffer inLine = new StringBuffer();<br />
			InputStreamReader isr = new InputStreamReader(in);<br />
			BufferedReader inRd = new BufferedReader(isr);<br />
			String text = &quot;&quot;;<br />
			String one_line = &quot;&quot;;<br />
			try {<br />
				int county = 0;<br />
				while ((text = inRd.readLine()) != null) {<br />
					county += 1;<br />
					if (text.equals(theWord)){<br />
				one_line = text;<br />
					}<br />
				}<br />
			} catch (IOException e) {<br />
				// TODO Auto-generated catch block<br />
						}<br />
			try {<br />
				in.close();<br />
			} catch (IOException e) {<br />
				// TODO Auto-generated catch block<br />
				}<br />
		return one_line.toLowerCase().trim();<br />
	    }</p>
<p>    String getWord(String file, int f_tot){ // gets one random word<br />
    	Random generator = new Random();<br />
        int numy = generator.nextInt(f_tot) + 1;<br />
	    InputStream   in;<br />
		 try{<br />
			    in = new FileInputStream(&quot;/&quot;+file);<br />
		 } catch(Exception e) {<br />
		     try {<br />
			  in = new FileInputStream(&quot;/&quot;+file);<br />
		     } catch(Exception e2){ return &quot;didntread_1&quot;;  }<br />
		 }<br />
        StringBuffer inLine = new StringBuffer();<br />
		InputStreamReader isr = new InputStreamReader(in);<br />
		BufferedReader inRd = new BufferedReader(isr);<br />
		String text = &quot;&quot;;<br />
		String one_line = &quot;&quot;;<br />
		try {<br />
			int county = 0;<br />
			while ((text = inRd.readLine()) != null) {<br />
				county += 1;<br />
				inLine.append(county + &quot; &quot; + text);<br />
				inLine.append(&quot;\n&quot;);<br />
				if (county==numy){<br />
				one_line = text + &quot; &quot; + String.valueOf(county);}<br />
			}<br />
		} catch (IOException e) {<br />
			// TODO Auto-generated catch block<br />
					}<br />
		try {<br />
			in.close();<br />
		} catch (IOException e) {<br />
			// TODO Auto-generated catch block<br />
			}<br />
	return one_line.toLowerCase().trim();<br />
    }<br />
	   String readLines(String file, int lineNumber){<br />
;<br />
			    InputStream   in;<br />
				 try{<br />
					    in = new FileInputStream(&quot;/&quot;+file); // on the effing c drive<br />
				 } catch(Exception e) {<br />
				     try {<br />
					  in = new FileInputStream(&quot;/&quot;+file);<br />
				     } catch(Exception e2){ return &quot;didntread_1&quot;;  }<br />
				 }<br />
		        StringBuffer inLine = new StringBuffer();<br />
				InputStreamReader isr = new InputStreamReader(in);<br />
				BufferedReader inRd = new BufferedReader(isr);<br />
				String text = &quot;&quot;;<br />
				String one_line = &quot;&quot;;<br />
				try {<br />
					int county = 0;<br />
					while ((text = inRd.readLine()) != null) {<br />
						county += 1;<br />
						if (lineNumber==county){<br />
					one_line = text;<br />
						}<br />
					}<br />
				} catch (IOException e) {<br />
					// TODO must handle this<br />
							}<br />
				try {<br />
					in.close();</p>
<p>				} catch (IOException e) {<br />
					// TODO Auto-generated catch block<br />
					}<br />
			return one_line;<br />
		    }</p>
<p>	    void writeIds(String ids) throws IOException{<br />
		try {<br />
		outputStream = new FileOutputStream(&quot;sdcard/Android/data/billtododo&quot;,true); // append is true<br />
		} catch (FileNotFoundException e) {<br />
	     try{  // does not write 44 if it finds previous and writes<br />
		 outputStream = new FileOutputStream(&quot;sdcard/billtododo&quot;);<br />
	     } catch (IOException e2) {   }  }<br />
		  Writer   writer   = new OutputStreamWriter(outputStream);<br />
		  try {<br />
		  writer.write(&quot;p&quot;+ids);<br />
		} catch (IOException e) {  	}<br />
		  writer.close();<br />
	  } </p>
<p>		   private String readLines() throws FileNotFoundException{<br />
				String one_line2 = &quot;&quot;;<br />
			    InputStream   in2;<br />
			 try{<br />
				    in2 = new FileInputStream(&quot;sdcard/Android/data/billtododo&quot;);<br />
			 } catch(Exception e) {<br />
			     try {<br />
				  in2 = new FileInputStream(&quot;sdcard/billtododo&quot;);<br />
			     } catch(Exception e2){ return &quot;didntread_1&quot;;  }<br />
			 }<br />
				InputStreamReader isr2 = new InputStreamReader(in2);<br />
				BufferedReader inRd2 = new BufferedReader(isr2);<br />
				String text2 = &quot;&quot;;<br />
				try {<br />
					while ((text2 = inRd2.readLine()) != null) {<br />
						one_line2 = text2;<br />
					}<br />
				} catch (IOException e) {<br />
			    	return &quot;didntread_3&quot;;<br />
							}<br />
				try {<br />
					in2.close();<br />
				} catch (IOException e) {<br />
			    	return &quot;didntread_4&quot;;<br />
					}<br />
		    	return one_line2;<br />
		    }</p>
<p>}</p>
<p>package com.umba;<br />
command line <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
import java.io.BufferedReader;<br />
import java.io.FileInputStream;<br />
import java.io.IOException;<br />
import java.io.InputStream;<br />
import java.io.InputStreamReader;<br />
import java.io.OutputStream;<br />
import java.util.ArrayList;</p>
<p>public class MakeFileRegGerunds {<br />
	OutputStream outputStream;<br />
	static ArrayList  ar = new ArrayList();<br />
	String endOfVerb, endOfVerb_1, theAnswer;<br />
	private static String x;	</p>
<p>	public static void main(String[] args) {<br />
		MakeFileRegGerunds ma = new MakeFileRegGerunds();<br />
		System.out.println(ma.pastParticiple(&#8220;taste&#8221;));  // debugging<br />
		for(int i = 1;i&lt;621;i++){ // i must be 1 more than lines in  file, go thro whole file<br />
			x = ma.readLines(&quot;MakeFileRegSimplePast.txt&quot;,i);<br />
			System.out.println(ma.gerund(x));<br />
		}</p>
<p>	}<br />
	   String readLines(String file, int lineNumber){<br />
		    	Random generator = new Random();<br />
		        int numy = generator.nextInt(f_tot) + 1;<br />
		       InputStream in = this.getResources().openRawResource(R.raw.wordlist);<br />
			    InputStream   in;<br />
				 try{<br />
					    in = new FileInputStream(&quot;/&quot;+file); // on the effing c drive<br />
				 } catch(Exception e) {<br />
				     try {<br />
					  in = new FileInputStream(&quot;/&quot;+file);<br />
				     } catch(Exception e2){ return &quot;didntread_1&quot;;  }<br />
				 }<br />
		        StringBuffer inLine = new StringBuffer();<br />
				InputStreamReader isr = new InputStreamReader(in);<br />
				BufferedReader inRd = new BufferedReader(isr);<br />
				String text = &quot;&quot;;<br />
				String one_line = &quot;&quot;;<br />
				try {<br />
					int county = 0;<br />
					while ((text = inRd.readLine()) != null) {<br />
						county += 1;<br />
						if (lineNumber==county){<br />
						//	if(!text.equals(&quot;&quot;)){ // takes care of lines with no word?<br />
						one_line = text;<br />
					//	}<br />
						}<br />
					}<br />
				} catch (IOException e) {<br />
					// TODO Auto-generated catch block<br />
							}<br />
				try {<br />
					in.close();<br />
			//		textview02.setText(one_line.toString());<br />
				} catch (IOException e) {<br />
					// TODO Auto-generated catch block<br />
					}<br />
			return one_line.toLowerCase().trim();<br />
		    }	</p>
<p>	// begin gerunds from regular verb</p>
<p>	    private String gerund(String verb_infinitive){<br />
	        endOfVerb  = verb_infinitive.substring(verb_infinitive.length()-1); // need this in cases<br />
	        endOfVerb_1 = verb_infinitive.substring(verb_infinitive.length()-2,verb_infinitive.length()-1);<br />
	    	if(endOfVerb.equals(&quot;e&quot;)){<br />
	    		theAnswer = verb_infinitive.substring(0, verb_infinitive.length()-1) + &quot;ing&quot;;</p>
<p>	    	         } else {<br />
	    	         theAnswer = verb_infinitive + &quot;ing&quot;;<br />
	    	         }</p>
<p>	    	    if(endOfVerb.equals(&quot;t&quot;)){<br />
	    		 if(endOfVerb_1.equals(&quot;a&quot;) || endOfVerb_1.equals(&quot;e&quot;)|| endOfVerb_1.equals(&quot;i&quot;)|| endOfVerb_1.equals(&quot;o&quot;)|| endOfVerb_1.equals(&quot;u&quot;)){<br />
	    	  theAnswer = verb_infinitive + &quot;ting&quot;;<br />
	    	   }  else {<br />
	    	  theAnswer = verb_infinitive.substring(0, verb_infinitive.length()) + &quot;ing&quot;;<br />
	    	   }   }  </p>
<p>	    	    if(endOfVerb.equals(&quot;b&quot;)){<br />
	    	   	 if(endOfVerb_1.equals(&quot;a&quot;) || endOfVerb_1.equals(&quot;e&quot;)|| endOfVerb_1.equals(&quot;i&quot;)|| endOfVerb_1.equals(&quot;o&quot;)|| endOfVerb_1.equals(&quot;u&quot;)){<br />
	    	     theAnswer = verb_infinitive + &quot;bing&quot;;<br />
	    	      }  else {<br />
	    	     theAnswer = verb_infinitive.substring(0, verb_infinitive.length()) + &quot;ing&quot;;<br />
	    	      }   }  </p>
<p>	    	    if(endOfVerb.equals(&quot;g&quot;)){<br />
	    	   	 if(endOfVerb_1.equals(&quot;a&quot;) || endOfVerb_1.equals(&quot;e&quot;)|| endOfVerb_1.equals(&quot;i&quot;)|| endOfVerb_1.equals(&quot;o&quot;)|| endOfVerb_1.equals(&quot;u&quot;)){<br />
	    	     theAnswer = verb_infinitive + &quot;ging&quot;;<br />
	    	      }  else {<br />
	    	     theAnswer = verb_infinitive.substring(0, verb_infinitive.length()) + &quot;ing&quot;;<br />
	    	      }   } </p>
<p>	    	    if(endOfVerb.equals(&quot;p&quot;)){<br />
	    	      	 if(endOfVerb_1.equals(&quot;a&quot;) || endOfVerb_1.equals(&quot;e&quot;)|| endOfVerb_1.equals(&quot;i&quot;)|| endOfVerb_1.equals(&quot;o&quot;)|| endOfVerb_1.equals(&quot;u&quot;)){<br />
	    	        theAnswer = verb_infinitive + &quot;ping&quot;;<br />
	    	         }  else {<br />
	    	        theAnswer = verb_infinitive.substring(0, verb_infinitive.length()) + &quot;ing&quot;;<br />
	    	         }   }    </p>
<p>	    	// catch t ending weirdos<br />
	    	   if(verb_infinitive.equals(&quot;cheat&quot;) || verb_infinitive.equals(&quot;float&quot;) ||<br />
	    		verb_infinitive.equals(&quot;greet&quot;) || verb_infinitive.equals(&quot;heat&quot;) ||<br />
	    		verb_infinitive.equals(&quot;sprout&quot;)|| verb_infinitive.equals(&quot;repeat&quot;) ||<br />
	    		verb_infinitive.equals(&quot;visit&quot;) || verb_infinitive.equals(&quot;treat&quot;) ||<br />
	    		verb_infinitive.equals(&quot;agree&quot;) || verb_infinitive.equals(&quot;suit&quot;) ){<br />
	    	    theAnswer =  verb_infinitive +&quot;ing&quot;; }        </p>
<p>	    	         // catch m ending weirdos<br />
	    	   if(verb_infinitive.equals(&quot;jam&quot;) || verb_infinitive.equals(&quot;program&quot;) ||<br />
	    		verb_infinitive.equals(&quot;hum&quot;) || verb_infinitive.equals(&quot;drum&quot;) ||<br />
	    		verb_infinitive.equals(&quot;dam&quot;) ){<br />
	    		theAnswer =  verb_infinitive +&quot;ming&quot;;<br />
	    	   }</p>
<p>	    	   // weirdos ending in e<br />
	    	   if(verb_infinitive.equals(&quot;agree&quot;) || verb_infinitive.equals(&quot;disagree&quot;) ||<br />
	    				verb_infinitive.equals(&quot;guarantee&quot;) || verb_infinitive.equals(&quot;lie&quot;) ||<br />
	    				verb_infinitive.equals(&quot;queue&quot;)|| verb_infinitive.equals(&quot;tie&quot;) ){<br />
	    				theAnswer =  verb_infinitive +&quot;ing&quot;;</p>
<p>	    	   }   </p>
<p>	    	   // weirdos ending in p<br />
	    	   if(verb_infinitive.equals(&quot;develop&quot;) || verb_infinitive.equals(&quot;heap&quot;) ||<br />
	    				verb_infinitive.equals(&quot;peep&quot;)){<br />
	    				theAnswer =  verb_infinitive +&quot;ing&quot;;<br />
	    			   } </p>
<p>	    	   // weirdos ending in n<br />
	    	    if(verb_infinitive.equals(&quot;ban&quot;) || verb_infinitive.equals(&quot;grin&quot;) || verb_infinitive.equals(&quot;man&quot;) || verb_infinitive.equals(&quot;plan&quot;) || verb_infinitive.equals(&quot;sin&quot;) ){<br />
	    		   theAnswer =  verb_infinitive +&quot;ning&quot;;<br />
	    	   }<br />
	    	// just weird<br />
	    	     if(verb_infinitive.equals(&quot;stir&quot;) || verb_infinitive.equals(&quot;star&quot;)){<br />
	    	 			theAnswer =  verb_infinitive +&quot;ring&quot;;</p>
<p>	    	    } </p>
<p>	    	     if(verb_infinitive.equals(&quot;glue&quot;) ){<br />
	    	 			theAnswer =  verb_infinitive +&quot;ing&quot;;</p>
<p>	    	    }  </p>
<p>	    		   return theAnswer;<br />
	    	 } // end of method gerund<br />
}</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=43&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2010/12/01/android-file-writing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Android NDK</title>
		<link>http://rodsit.wordpress.com/2010/12/01/android-ndk/</link>
		<comments>http://rodsit.wordpress.com/2010/12/01/android-ndk/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 11:06:23 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[jni]]></category>
		<category><![CDATA[ndk]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=21</guid>
		<description><![CDATA[Write c through the java jni (java native interface). Below is a file write example using native c. #include #include #include jstring Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, jobject thiz ) { FILE* file = fopen(&#8220;textexample&#8221;,&#8221;w+&#8221;); if (file != NULL) { fputs(&#8220;text example!\n&#8221;, &#8230; <a href="http://rodsit.wordpress.com/2010/12/01/android-ndk/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=21&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Write c through the java jni (java native interface).</p>
<p>Below is a file write example using native c.</p>
<p>#include<br />
#include<br />
#include </p>
<p>jstring<br />
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,<br />
                                              jobject thiz )<br />
{<br />
    FILE* file = fopen(&#8220;textexample&#8221;,&#8221;w+&#8221;);</p>
<p>    if (file != NULL)<br />
    {<br />
        fputs(&#8220;text example!\n&#8221;, file);<br />
        fflush(file);<br />
        fclose(file);<br />
    }</p>
<p>    return (*env)-&gt;NewStringUTF(env, &#8220;JNI (with file io)!&#8221;);<br />
}</p>
<p>The java activity to drive this c interface is:</p>
<p>package com.example.hellojni;</p>
<p>import android.app.Activity;<br />
import android.widget.TextView;<br />
import android.os.Bundle;</p>
<p>public class HelloJni extends Activity<br />
{<br />
    @Override<br />
    public void onCreate(Bundle savedInstanceState)<br />
    {<br />
        super.onCreate(savedInstanceState);<br />
        TextView  tv = new TextView(this);<br />
        tv.setText( stringFromJNI() );<br />
        setContentView(tv);<br />
    }<br />
    public native String  stringFromJNI();<br />
    public native String  unimplementedStringFromJNI();<br />
    static {<br />
        System.loadLibrary(&#8220;hello-jni&#8221;);<br />
    }<br />
}</p>
<p>The android.mk file is:</p>
<p>LOCAL_PATH := $(call my-dir)</p>
<p>include $(CLEAR_VARS)</p>
<p>LOCAL_MODULE    := hello-jni<br />
LOCAL_SRC_FILES := hello-jni.c</p>
<p>include $(BUILD_SHARED_LIBRARY)</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=21&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2010/12/01/android-ndk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>
	</item>
		<item>
		<title>Android ASE and Python</title>
		<link>http://rodsit.wordpress.com/2010/07/14/android-ase-and-python/</link>
		<comments>http://rodsit.wordpress.com/2010/07/14/android-ase-and-python/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 09:03:15 +0000</pubDate>
		<dc:creator>rodsit</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android-scripting]]></category>
		<category><![CDATA[ase]]></category>
		<category><![CDATA[Froyo]]></category>
		<category><![CDATA[Nexus One]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://rodsit.wordpress.com/?p=22</guid>
		<description><![CDATA[My phone is a Nexus One Froyo but these scripts will run on most phones (time of writing this: 14 July 2010). ASE is a way of running python scripts on an Android phone. Its very easy to set it &#8230; <a href="http://rodsit.wordpress.com/2010/07/14/android-ase-and-python/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=22&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>My phone is a Nexus One Froyo but these scripts will run on most phones (time of writing this: 14 July 2010).</p>
<p>ASE is a way of running python scripts on an Android phone. Its very easy to set it up (<a href="http://code.google.com/p/android-scripting/" rel="nofollow">http://code.google.com/p/android-scripting/</a>  &#8211; just download the python apk &#8211; it installs like an ordinary App) and the libraries have twitter and json already there. You can edit on the phone itself.</p>
<p>My phone is a Nexus One Froyo but these scripts will run on most phones.</p>
<p>Script 1 (as simple as you can get!)<br />
*****************<br />
</strong><font color="red"><br />
print &#8220;python test&#8221;<br />
</font><strong><br />
*****************</p>
<p>Script 2 (make Toast label thingy)<br />
*****************<br />
</strong><font color="red"><br />
import android<br />
droid = android.Android()<br />
droid.makeToast(&#8216;Hello, Android!&#8217;)<br />
</font><strong><br />
******************</p>
<p>Script 3 (alert dialogue)<br />
*****************<br />
</strong><font color="red"><br />
import android<br />
droid = android.Android()<br />
droid.dialogCreateAlert(&#8216;my title&#8217;, &#8216;my message bla bla&#8217;)<br />
droid.dialogShow()<br />
</font><strong><br />
******************</p>
<p>Script 4 (post a twitter update, libraries already there)<br />
******************<br />
</strong><font color="red"><br />
import android<br />
import twitter<br />
droid = android.Android()<br />
twitter_name = droid.getInput(&#8221;,&#8217;Twitter name?&#8217;).result<br />
twitter_password = droid.getInput(&#8221;,&#8217;Twitter password?&#8217;).result<br />
twitter_update = droid.getInput(&#8221;,&#8217;Update message?&#8217;).result<br />
t = twitter.Api(username=twitter_name, password=twitter_password)<br />
update = t.PostUpdate(twitter_update)<br />
print update.text<br />
#print twitter_password<br />
#print twitter_update<br />
print &#8216; \n\n done it &#8216;<br />
</font><strong><br />
*************************</p>
<p>Script 5 (posts to twitter your phone location)<br />
***********************<br />
</strong><font color="red"></p>
<p>import android<br />
import twitter</p>
<p>droid = android.Android()<br />
# Login to twitter account.<br />
twitter_name = droid.getInput(&#8221;,&#8217;Twitter name?&#8217;).result<br />
twitter_password = droid.getInput(&#8221;,&#8217;Twitter password?&#8217;).result<br />
t = twitter.Api(username=twitter_name, password=twitter_password)<br />
# get phones location data<br />
location = droid.getLastKnownLocation().result<br />
# print a bit of interesting data<br />
print str(location.keys())<br />
print &#8216;latitude is &#8216; + str(location.values()[0]['latitude'])<br />
print &#8216;longitude is &#8216; + str(location.values()[0]['longitude'])<br />
# update twitter<br />
update = t.PostUpdate(&#8216;My location is: <a href="http://maps.google.com/maps?q=&#8217;+str(location.values()%5B0%5D%5B&#039;latitude&#039;%5D)+&#038;#8217" rel="nofollow">http://maps.google.com/maps?q=&#8217;+str(location.values()%5B0%5D%5B&#039;latitude&#039;%5D)+&#038;#8217</a>;,'+str(location.values()[0]['longitude'])+&#8221;)<br />
# if no errors this will print<br />
print &#8216;\n\nDone it&#8217;<br />
droid.makeToast(&#8216;done it&#8217;)<br />
</font><strong><br />
**************************</p>
<p>Script 5 (speaks text)<br />
*************************<br />
</strong><font color="red"><br />
import android</p>
<p>droid = android.Android()<br />
say_it = droid.getInput(&#8221;,&#8217;Say what?&#8217;).result<br />
if say_it:<br />
  droid.ttsSpeak(say_it)<br />
else:<br />
  droid.ttsSpeak(&#8216;You forgot to enter something in the previous text box.&#8217;)<br />
</font><strong><br />
********************************</p>
<p>Script 6 (sends an email, user must confirm)<br />
********************************<br />
</strong><font color="red"><br />
import android</p>
<p>recipientAddress = &#8216;blabla@gmail.com&#8217;<br />
subject = &#8216;test from android&#8217;<br />
body = &#8216;testing&#8230;&#8217;<br />
droid = android.Android()<br />
droid.sendEmail(recipientAddress,subject,body)<br />
</font><strong><br />
*******************************</p>
<p>Script 7 (takes photo and puts in gallery folder)<br />
*******************************<br />
</strong><font color="red"><br />
import android</p>
<p>droid = android.Android()<br />
fileName = droid.getInput(&#8221;,&#8217;Photo name?&#8217;).result<br />
if fileName:<br />
  droid.cameraCapturePicture(&#8216;/sdcard/DCIM/Camera/&#8217; + fileName + &#8216;.jpg&#8217;)<br />
else:<br />
  fileName = &#8216;billpic&#8217;<br />
  droid.cameraCapturePicture(&#8216;/sdcard/DCIM/Camera/&#8217; + fileName + &#8216;.jpg&#8217;)<br />
  print &#8216;you called it billpic&#8217;</p>
<p>print &#8216;you called it: &#8216; + fileName<br />
</font><strong><br />
***********************************</p>
<p><div id="attachment_23" class="wp-caption alignnone" style="width: 310px"><a href="http://rodsit.files.wordpress.com/2010/07/ase-scripts-screen.jpg"><img src="http://rodsit.files.wordpress.com/2010/07/ase-scripts-screen.jpg?w=300&#038;h=229" alt="ASE-scripts-screen" title="ASE-scripts-screen" width="300" height="229" class="size-medium wp-image-23" /></a><p class="wp-caption-text">List of my scripts</p></div><br />
<div id="attachment_25" class="wp-caption alignnone" style="width: 310px"><a href="http://rodsit.files.wordpress.com/2010/07/ase-scripts-screen-21.jpg"><img src="http://rodsit.files.wordpress.com/2010/07/ase-scripts-screen-21.jpg?w=300&#038;h=227" alt="ASE-scripts-screen-2" title="ASE-scripts-screen-2" width="300" height="227" class="size-medium wp-image-25" /></a><p class="wp-caption-text">Shell command line</p></div><br />
<div id="attachment_26" class="wp-caption alignnone" style="width: 310px"><a href="http://rodsit.files.wordpress.com/2010/07/ase-scanbarcode.jpg"><img src="http://rodsit.files.wordpress.com/2010/07/ase-scanbarcode.jpg?w=300&#038;h=223" alt="scanbarcode python or shell choice menu on the phone" title="ASE-scanbarcode" width="300" height="223" class="size-medium wp-image-26" /></a><p class="wp-caption-text">scanbarcode gets smallish scripts that are in the 2D code!</p></div></p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodsit.wordpress.com&#038;blog=12990735&#038;post=22&#038;subd=rodsit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodsit.wordpress.com/2010/07/14/android-ase-and-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d06ad8d71532e203192422786806ff19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodsit</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/07/ase-scripts-screen.jpg?w=300" medium="image">
			<media:title type="html">ASE-scripts-screen</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/07/ase-scripts-screen-21.jpg?w=300" medium="image">
			<media:title type="html">ASE-scripts-screen-2</media:title>
		</media:content>

		<media:content url="http://rodsit.files.wordpress.com/2010/07/ase-scanbarcode.jpg?w=300" medium="image">
			<media:title type="html">ASE-scanbarcode</media:title>
		</media:content>
	</item>
	</channel>
</rss>
