<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Codetuts Java</title>
	
	<link>http://java.codetuts.com</link>
	<description />
	<pubDate>Thu, 25 Aug 2011 16:01:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodetutsJava" /><feedburner:info uri="codetutsjava" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Save image to media library</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/PgtQvZg0Gs4/save-image-to-media-library.php</link>
		<comments>http://java.codetuts.com/save-image-to-media-library.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 16:01:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/save-image-to-media-library.php</guid>
		<description><![CDATA[&#160;
Uri saveMediaEntry(String imagePath,String title,String description,long dateTaken,int orientation,Location loc) {   &#160;&#160;&#160; ContentValues v = new ContentValues();    &#160;&#160;&#160; v.put(Images.Media.TITLE, title);    &#160;&#160;&#160; v.put(Images.Media.DISPLAY_NAME, displayName);    &#160;&#160;&#160; v.put(Images.Media.DESCRIPTION, description);    &#160;&#160;&#160; v.put(Images.Media.DATE_ADDED, dateTaken);    &#160;&#160;&#160; v.put(Images.Media.DATE_TAKEN, dateTaken);    &#160;&#160;&#160; v.put(Images.Media.DATE_MODIFIED, dateTaken) ;  [...]


Related posts:<ol><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li><li><a href='http://java.codetuts.com/insert-a-contact.php' rel='bookmark' title='Permanent Link: Insert a contact'>Insert a contact</a> <small>&#160; private Uri insertContact(Context context, String name, String phone) {...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Uri saveMediaEntry(String imagePath,String title,String description,long dateTaken,int orientation,Location loc) {   <br />&#160;&#160;&#160; ContentValues v = new ContentValues();    <br />&#160;&#160;&#160; v.put(Images.Media.TITLE, title);    <br />&#160;&#160;&#160; v.put(Images.Media.DISPLAY_NAME, displayName);    <br />&#160;&#160;&#160; v.put(Images.Media.DESCRIPTION, description);    <br />&#160;&#160;&#160; v.put(Images.Media.DATE_ADDED, dateTaken);    <br />&#160;&#160;&#160; v.put(Images.Media.DATE_TAKEN, dateTaken);    <br />&#160;&#160;&#160; v.put(Images.Media.DATE_MODIFIED, dateTaken) ;    <br />&#160;&#160;&#160; v.put(Images.Media.MIME_TYPE, &quot;image/jpeg&quot;);    <br />&#160;&#160;&#160; v.put(Images.Media.ORIENTATION, orientation);</p>
<p>&#160;&#160;&#160; File f = new File(imagePath) ;   <br />&#160;&#160;&#160; File parent = f.getParentFile() ;    <br />&#160;&#160;&#160; String path = parent.toString().toLowerCase() ;    <br />&#160;&#160;&#160; String name = parent.getName().toLowerCase() ;    <br />&#160;&#160;&#160; v.put(Images.ImageColumns.BUCKET_ID, path.hashCode());    <br />&#160;&#160;&#160; v.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, name);    <br />&#160;&#160;&#160; v.put(Images.Media.SIZE,f.length()) ;    <br />&#160;&#160;&#160; f = null ;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; if( targ_loc != null ) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; v.put(Images.Media.LATITUDE, loc.getLatitude());    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; v.put(Images.Media.LONGITUDE, loc.getLongitude());    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; v.put(&quot;_data&quot;,imagePath) ;    <br />&#160;&#160;&#160; ContentResolver c = getContentResolver() ;    <br />&#160;&#160;&#160; return c.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, v);    <br />}</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li><li><a href='http://java.codetuts.com/insert-a-contact.php' rel='bookmark' title='Permanent Link: Insert a contact'>Insert a contact</a> <small>&#160; private Uri insertContact(Context context, String name, String phone) {...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/PgtQvZg0Gs4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/save-image-to-media-library.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/save-image-to-media-library.php</feedburner:origLink></item>
		<item>
		<title>Handling shake events</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/pBkh0aKgMSo/handling-shake-events.php</link>
		<comments>http://java.codetuts.com/handling-shake-events.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 16:00:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/handling-shake-events.php</guid>
		<description><![CDATA[&#160;
package com.gedankentank.android.sensor;
import java.util.List;
import android.hardware.Sensor;   import android.hardware.SensorEvent;    import android.hardware.SensorEventListener;    import android.hardware.SensorManager;    import android.util.Log;
public class AccelerometerListener implements SensorEventListener {   &#160;&#160;&#160; &#160;&#160;&#160; private SensorManager sensorManager;    &#160;&#160;&#160; private List&#60;Sensor&#62; sensors;    &#160;&#160;&#160; private Sensor sensor;    &#160;&#160;&#160; private long [...]


Related posts:<ol><li><a href='http://java.codetuts.com/playing-a-mp3-using-service.php' rel='bookmark' title='Permanent Link: playing a mp3 using service'>playing a mp3 using service</a> <small>&#160; //MyService.java package com.v3; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer;...</small></li><li><a href='http://java.codetuts.com/insert-a-contact.php' rel='bookmark' title='Permanent Link: Insert a contact'>Insert a contact</a> <small>&#160; private Uri insertContact(Context context, String name, String phone) {...</small></li><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>package com.gedankentank.android.sensor;</p>
<p>import java.util.List;</p>
<p>import android.hardware.Sensor;   <br />import android.hardware.SensorEvent;    <br />import android.hardware.SensorEventListener;    <br />import android.hardware.SensorManager;    <br />import android.util.Log;</p>
<p>public class AccelerometerListener implements SensorEventListener {   <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; private SensorManager sensorManager;    <br />&#160;&#160;&#160; private List&lt;Sensor&gt; sensors;    <br />&#160;&#160;&#160; private Sensor sensor;    <br />&#160;&#160;&#160; private long lastUpdate = -1;    <br />&#160;&#160;&#160; private long currentTime = -1;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; private float last_x, last_y, last_z;    <br />&#160;&#160;&#160; private float current_x, current_y, current_z, currenForce;    <br />&#160;&#160;&#160; private static final int FORCE_THRESHOLD = 900;    <br />&#160;&#160;&#160; private final int DATA_X = SensorManager.DATA_X;    <br />&#160;&#160;&#160; private final int DATA_Y = SensorManager.DATA_Y;    <br />&#160;&#160;&#160; private final int DATA_Z = SensorManager.DATA_Z;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; public AccelerometerListener(Activity parent) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; SensorManager sensorService = (SensorManager) parent.getSystemService(Context.SENSOR_SERVICE);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.sensorManager = sensorManager;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.subscriber = subscriber;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.sensors = sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (sensors.size() &gt; 0) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sensor = sensors.get(0);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; public void start () {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (sensor!=null)&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_GAME);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; public void stop () {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sensorManager.unregisterListener(this);    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; public void onAccuracyChanged(Sensor s, int valu) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; public void onSensorChanged(SensorEvent event) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER || event.values.length &lt; 3)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; currentTime = System.currentTimeMillis();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ((currentTime - lastUpdate) &gt; 100) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; long diffTime = (currentTime - lastUpdate);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lastUpdate = currentTime;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; current_x = event.values[DATA_X];    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; current_y = event.values[DATA_Y];    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; current_z = event.values[DATA_Z];    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; currenForce = Math.abs(current_x+current_y+current_z - last_x - last_y - last_z) / diffTime * 10000;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (currenForce &gt; FORCE_THRESHOLD) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Device has been shaken now go on and do something    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // you could now inform the parent activity &#8230;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; last_x = current_x;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; last_y = current_y;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; last_z = current_z;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }   <br />&#160;&#160;&#160; }</p>
<p>}</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/playing-a-mp3-using-service.php' rel='bookmark' title='Permanent Link: playing a mp3 using service'>playing a mp3 using service</a> <small>&#160; //MyService.java package com.v3; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer;...</small></li><li><a href='http://java.codetuts.com/insert-a-contact.php' rel='bookmark' title='Permanent Link: Insert a contact'>Insert a contact</a> <small>&#160; private Uri insertContact(Context context, String name, String phone) {...</small></li><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/pBkh0aKgMSo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/handling-shake-events.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/handling-shake-events.php</feedburner:origLink></item>
		<item>
		<title>Copy to clipboard</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/tDOz1CDfHyw/copy-to-clipboard.php</link>
		<comments>http://java.codetuts.com/copy-to-clipboard.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:58:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[System]]></category>

		<category><![CDATA[clipboard]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/copy-to-clipboard.php</guid>
		<description><![CDATA[&#160;
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();   &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ImageTransferable imageTrans = new ImageTransferable(bufferImage);    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; clip.setContents(imageTrans, null);


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ImageTransferable imageTrans = new ImageTransferable(bufferImage);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; clip.setContents(imageTrans, null);</p>


<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/tDOz1CDfHyw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/copy-to-clipboard.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/copy-to-clipboard.php</feedburner:origLink></item>
		<item>
		<title>Check for leap year</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/5ug6tgUOlfI/check-for-leap-year.php</link>
		<comments>http://java.codetuts.com/check-for-leap-year.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:57:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Date and Time]]></category>

		<category><![CDATA[leap year]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/check-for-leap-year.php</guid>
		<description><![CDATA[&#160;
public boolean isLeapYear(){   &#160;&#160;&#160; boolean leapYear;    &#160;&#160;&#160; int divideByFour = year % 4;    &#160;&#160;&#160; int divideBy100 = year % 100;    &#160;&#160;&#160; int divideBy400 = year % 400;    &#160;&#160;&#160; if (divideBy400 == 0){    &#160;&#160;&#160;&#160;&#160;&#160;&#160; leapYear = true;   [...]


Related posts:<ol><li><a href='http://java.codetuts.com/file-read-and-write-example.php' rel='bookmark' title='Permanent Link: File read and write example'>File read and write example</a> <small>&#160; import java.util.Vector; import java.io.*; public class FileUtility { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/delete-a-directory.php' rel='bookmark' title='Permanent Link: Delete a directory'>Delete a directory</a> <small>&#160; public static boolean deleteDir(File dir) { &#160;&#160;&#160;&#160; if (dir.isDirectory())...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>public boolean isLeapYear(){   <br />&#160;&#160;&#160; boolean leapYear;    <br />&#160;&#160;&#160; int divideByFour = year % 4;    <br />&#160;&#160;&#160; int divideBy100 = year % 100;    <br />&#160;&#160;&#160; int divideBy400 = year % 400;    <br />&#160;&#160;&#160; if (divideBy400 == 0){    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; leapYear = true;    <br />&#160;&#160;&#160; } else if (divideBy100 == 0){    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; leapYear = false;    <br />&#160;&#160;&#160; } else if (divideByFour == 0){    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; leapYear = true;    <br />&#160;&#160;&#160; } else {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; leapYear = false;    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; return leapYear;    <br />}    </p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/file-read-and-write-example.php' rel='bookmark' title='Permanent Link: File read and write example'>File read and write example</a> <small>&#160; import java.util.Vector; import java.io.*; public class FileUtility { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/delete-a-directory.php' rel='bookmark' title='Permanent Link: Delete a directory'>Delete a directory</a> <small>&#160; public static boolean deleteDir(File dir) { &#160;&#160;&#160;&#160; if (dir.isDirectory())...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/5ug6tgUOlfI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/check-for-leap-year.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/check-for-leap-year.php</feedburner:origLink></item>
		<item>
		<title>Send email using Intent</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/NtWujyb5oCA/send-email-using-intent.php</link>
		<comments>http://java.codetuts.com/send-email-using-intent.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:56:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/send-email-using-intent.php</guid>
		<description><![CDATA[&#160;
Intent i = new Intent(Intent.ACTION_SEND);&#160; //i.setType(&#34;text/plain&#34;); //use this line for testing in the emulator&#160; i.setType(&#34;message/rfc822&#34;) ; // use from live device    i.putExtra(Intent.EXTRA_EMAIL, new String[]{&#34;test@gmail.com&#34;});&#160; i.putExtra(Intent.EXTRA_SUBJECT,&#34;subject goes here&#34;);&#160; i.putExtra(Intent.EXTRA_TEXT,&#34;body goes here&#34;);&#160; startActivity(Intent.createChooser(i, &#34;Select email application.&#34;));


Related posts:Start a phone call &#160; try { &#160;&#160; Intent intent = new Intent(Intent.ACTION_CALL); &#160;&#160;...Dialog box &#160; AlertDialog.Builder alertbox [...]


Related posts:<ol><li><a href='http://java.codetuts.com/start-a-phone-call.php' rel='bookmark' title='Permanent Link: Start a phone call'>Start a phone call</a> <small>&#160; try { &#160;&#160; Intent intent = new Intent(Intent.ACTION_CALL); &#160;&#160;...</small></li><li><a href='http://java.codetuts.com/dialog-box.php' rel='bookmark' title='Permanent Link: Dialog box'>Dialog box</a> <small>&#160; AlertDialog.Builder alertbox = new AlertDialog.Builder(ActivityA.this); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alertbox.setTitle(&quot;Demo&quot;); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alertbox.setMessage(message);...</small></li><li><a href='http://java.codetuts.com/send-sms-using-smsmatrix.php' rel='bookmark' title='Permanent Link: Send SMS using SMSMatrix'>Send SMS using SMSMatrix</a> <small>&#160; try { String MATRIXURL = &quot;http://www.smsmatrix.com/matrix&quot;; String PHONE =...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Intent i = new Intent(Intent.ACTION_SEND);&#160; <br />//i.setType(&quot;text/plain&quot;); //use this line for testing in the emulator&#160; <br />i.setType(&quot;message/rfc822&quot;) ; // use from live device    <br />i.putExtra(Intent.EXTRA_EMAIL, new String[]{&quot;test@gmail.com&quot;});&#160; <br />i.putExtra(Intent.EXTRA_SUBJECT,&quot;subject goes here&quot;);&#160; <br />i.putExtra(Intent.EXTRA_TEXT,&quot;body goes here&quot;);&#160; <br />startActivity(Intent.createChooser(i, &quot;Select email application.&quot;));</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/start-a-phone-call.php' rel='bookmark' title='Permanent Link: Start a phone call'>Start a phone call</a> <small>&#160; try { &#160;&#160; Intent intent = new Intent(Intent.ACTION_CALL); &#160;&#160;...</small></li><li><a href='http://java.codetuts.com/dialog-box.php' rel='bookmark' title='Permanent Link: Dialog box'>Dialog box</a> <small>&#160; AlertDialog.Builder alertbox = new AlertDialog.Builder(ActivityA.this); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alertbox.setTitle(&quot;Demo&quot;); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alertbox.setMessage(message);...</small></li><li><a href='http://java.codetuts.com/send-sms-using-smsmatrix.php' rel='bookmark' title='Permanent Link: Send SMS using SMSMatrix'>Send SMS using SMSMatrix</a> <small>&#160; try { String MATRIXURL = &quot;http://www.smsmatrix.com/matrix&quot;; String PHONE =...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/NtWujyb5oCA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/send-email-using-intent.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/send-email-using-intent.php</feedburner:origLink></item>
		<item>
		<title>Keyboard input</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/aIYbQqAs8TE/keyboard-input.php</link>
		<comments>http://java.codetuts.com/keyboard-input.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:43:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/keyboard-input.php</guid>
		<description><![CDATA[&#160;
import java.io.*;
public class ReadString {
&#160;&#160; public static void main (String[] args) {
&#160;&#160;&#160;&#160;&#160; //&#160; prompt the user to enter their name   &#160;&#160;&#160;&#160;&#160; System.out.print(&#34;Enter your name: &#34;);
&#160;&#160;&#160;&#160;&#160; //&#160; open up standard input   &#160;&#160;&#160;&#160;&#160; BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
&#160;&#160;&#160;&#160;&#160; String userName = null;
&#160;&#160;&#160;&#160;&#160; //&#160; read the username from the command-line; need to use [...]


Related posts:<ol><li><a href='http://java.codetuts.com/send-sms-using-smsmatrix.php' rel='bookmark' title='Permanent Link: Send SMS using SMSMatrix'>Send SMS using SMSMatrix</a> <small>&#160; try { String MATRIXURL = &quot;http://www.smsmatrix.com/matrix&quot;; String PHONE =...</small></li><li><a href='http://java.codetuts.com/read-a-file.php' rel='bookmark' title='Permanent Link: Read a file'>Read a file</a> <small>&#160; import java.net.*; import java.io.*; public class URLReader { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/download-a-forex-quote.php' rel='bookmark' title='Permanent Link: Download a forex quote'>Download a forex quote</a> <small>&#160; import java.net.*; import java.io.*; public class ForexTest { &#160;&#160;&#160;...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>import java.io.*;</p>
<p>public class ReadString {</p>
<p>&#160;&#160; public static void main (String[] args) {</p>
<p>&#160;&#160;&#160;&#160;&#160; //&#160; prompt the user to enter their name   <br />&#160;&#160;&#160;&#160;&#160; System.out.print(&quot;Enter your name: &quot;);</p>
<p>&#160;&#160;&#160;&#160;&#160; //&#160; open up standard input   <br />&#160;&#160;&#160;&#160;&#160; BufferedReader br = new BufferedReader(new InputStreamReader(System.in));</p>
<p>&#160;&#160;&#160;&#160;&#160; String userName = null;</p>
<p>&#160;&#160;&#160;&#160;&#160; //&#160; read the username from the command-line; need to use try/catch with the   <br />&#160;&#160;&#160;&#160;&#160; //&#160; readLine() method    <br />&#160;&#160;&#160;&#160;&#160; try {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; userName = br.readLine();    <br />&#160;&#160;&#160;&#160;&#160; } catch (IOException ioe) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(&quot;IO error trying to read your name!&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.exit(1);    <br />&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160; System.out.println(&quot;Thanks for the name, &quot; + userName);</p>
<p>&#160;&#160; }</p>
<p>}&#160; // end of ReadString class</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/send-sms-using-smsmatrix.php' rel='bookmark' title='Permanent Link: Send SMS using SMSMatrix'>Send SMS using SMSMatrix</a> <small>&#160; try { String MATRIXURL = &quot;http://www.smsmatrix.com/matrix&quot;; String PHONE =...</small></li><li><a href='http://java.codetuts.com/read-a-file.php' rel='bookmark' title='Permanent Link: Read a file'>Read a file</a> <small>&#160; import java.net.*; import java.io.*; public class URLReader { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/download-a-forex-quote.php' rel='bookmark' title='Permanent Link: Download a forex quote'>Download a forex quote</a> <small>&#160; import java.net.*; import java.io.*; public class ForexTest { &#160;&#160;&#160;...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/aIYbQqAs8TE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/keyboard-input.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/keyboard-input.php</feedburner:origLink></item>
		<item>
		<title>JDBC and MySQL</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/1fa-wQwtxQ0/jdbc-and-mysql.php</link>
		<comments>http://java.codetuts.com/jdbc-and-mysql.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:30:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[JDBC]]></category>

		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/jdbc-and-mysql.php</guid>
		<description><![CDATA[&#160;
import java.util.logging.Level;   import java.util.logging.Logger;
// import com.mysql.jdbc.*;   import java.sql.*;
/*    * To change this template, choose Tools &#124; Templates     * and open the template in the editor.     */    /**     *     * [...]


Related posts:<ol><li><a href='http://java.codetuts.com/file-read-and-write-example.php' rel='bookmark' title='Permanent Link: File read and write example'>File read and write example</a> <small>&#160; import java.util.Vector; import java.io.*; public class FileUtility { &#160;&#160;&#160;...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>import java.util.logging.Level;   <br />import java.util.logging.Logger;</p>
<p>// import com.mysql.jdbc.*;   <br />import java.sql.*;</p>
<p>/*   <br /> * To change this template, choose Tools | Templates    <br /> * and open the template in the editor.    <br /> */    <br />/**    <br /> *    <br /> * @author sukanta    <br /> */    <br />public class Main {</p>
<p>&#160;&#160;&#160; public static void main(String[] args) throws SQLException {   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Class.forName(&quot;com.mysql.jdbc.Driver&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (ClassNotFoundException ex) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Connection con = null;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Statement stmt = null;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ResultSet rs = null;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; con = DriverManager.getConnection(&quot;jdbc:mysql://datanase name&quot;, &quot;username&quot;, &quot;password&quot;);   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; stmt = con.createStatement();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ResultSet result = stmt.executeQuery(&quot;SELECT * FROM table1&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; while (result.next())    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(result.getString(1) + &quot; &quot; + result.getString(2));    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; result.close();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; con.close();    <br />&#160;&#160;&#160; }    <br />}</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/file-read-and-write-example.php' rel='bookmark' title='Permanent Link: File read and write example'>File read and write example</a> <small>&#160; import java.util.Vector; import java.io.*; public class FileUtility { &#160;&#160;&#160;...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/1fa-wQwtxQ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/jdbc-and-mysql.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/jdbc-and-mysql.php</feedburner:origLink></item>
		<item>
		<title>Download a forex quote</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/X1Lxca3lR7w/download-a-forex-quote.php</link>
		<comments>http://java.codetuts.com/download-a-forex-quote.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:28:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/download-a-forex-quote.php</guid>
		<description><![CDATA[&#160;
import java.net.*;   import java.io.*;
public class ForexTest {    &#160;&#160;&#160; public void getRate() {    &#160;&#160;&#160;&#160;&#160;&#160;&#160; try {    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; URL url = new URL(&#34;http://finance.yahoo.com/d/quotes.csv?e=.csv&#38;f=sl1d1t1&#38;s=EURUSD=X&#34;);    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; URLConnection urlc = url.openConnection();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BufferedReader reader = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String line;   &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StringBuffer sb = new [...]


Related posts:<ol><li><a href='http://java.codetuts.com/download-a-web-page.php' rel='bookmark' title='Permanent Link: Download a web page'>Download a web page</a> <small>&#160; import java.io.BufferedInputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import...</small></li><li><a href='http://java.codetuts.com/read-a-file.php' rel='bookmark' title='Permanent Link: Read a file'>Read a file</a> <small>&#160; import java.net.*; import java.io.*; public class URLReader { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/read-a-file-2.php' rel='bookmark' title='Permanent Link: Read a file'>Read a file</a> <small>&#160; File multiUserFile = new File(&quot;test.txt&quot;); String line = &quot;&quot;;...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>import java.net.*;   <br />import java.io.*;</p>
<p>public class ForexTest {    <br />&#160;&#160;&#160; public void getRate() {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; URL url = new URL(&quot;<a href="http://finance.yahoo.com/d/quotes.csv?e=.csv&amp;f=sl1d1t1&amp;s=EURUSD=X&quot;);">http://finance.yahoo.com/d/quotes.csv?e=.csv&amp;f=sl1d1t1&amp;s=EURUSD=X&quot;);</a>    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; URLConnection urlc = url.openConnection();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BufferedReader reader = new BufferedReader(new InputStreamReader(urlc.getInputStream()));</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String line;   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StringBuffer sb = new StringBuffer();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; while ((line = reader.readLine()) != null) {   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sb.append(line);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(sb);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (MalformedURLException ex) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ex.printStackTrace();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (IOException ex) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ex.printStackTrace();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; public static void main(String[] args) throws Exception {   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ForexTest ft = new ForexTest();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; while (true) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ft.getRate();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Thread.sleep(10000);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; }   <br />}</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/download-a-web-page.php' rel='bookmark' title='Permanent Link: Download a web page'>Download a web page</a> <small>&#160; import java.io.BufferedInputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import...</small></li><li><a href='http://java.codetuts.com/read-a-file.php' rel='bookmark' title='Permanent Link: Read a file'>Read a file</a> <small>&#160; import java.net.*; import java.io.*; public class URLReader { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/read-a-file-2.php' rel='bookmark' title='Permanent Link: Read a file'>Read a file</a> <small>&#160; File multiUserFile = new File(&quot;test.txt&quot;); String line = &quot;&quot;;...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/X1Lxca3lR7w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/download-a-forex-quote.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/download-a-forex-quote.php</feedburner:origLink></item>
		<item>
		<title>Download a web page</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/mFYQDHVYmEQ/download-a-web-page.php</link>
		<comments>http://java.codetuts.com/download-a-web-page.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:27:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/download-a-web-page.php</guid>
		<description><![CDATA[&#160;
import java.io.BufferedInputStream;   import java.io.IOException;    import java.net.MalformedURLException;    import java.net.URL;    import java.net.URLConnection;
/**    * Main.java     *     * @author www.javadb.com     */    public class Main {    &#160;&#160;&#160; &#160;&#160;&#160; [...]


Related posts:<ol><li><a href='http://java.codetuts.com/download-a-forex-quote.php' rel='bookmark' title='Permanent Link: Download a forex quote'>Download a forex quote</a> <small>&#160; import java.net.*; import java.io.*; public class ForexTest { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li><li><a href='http://java.codetuts.com/read-a-file-to-a-string.php' rel='bookmark' title='Permanent Link: Read a file to a string'>Read a file to a string</a> <small>&#160; private String readFile(String pathname) throws IOException { &#160;&#160;&#160; StringBuilder...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>import java.io.BufferedInputStream;   <br />import java.io.IOException;    <br />import java.net.MalformedURLException;    <br />import java.net.URL;    <br />import java.net.URLConnection;</p>
<p>/**   <br /> * Main.java    <br /> *    <br /> * @author www.javadb.com    <br /> */    <br />public class Main {    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; /**    <br />&#160;&#160;&#160;&#160; * Reads a web page into a StringBuilder object    <br />&#160;&#160;&#160;&#160; * and prints it out to console along with the    <br />&#160;&#160;&#160;&#160; * size of the page.    <br />&#160;&#160;&#160;&#160; */    <br />&#160;&#160;&#160; public void getWebSite() {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; URL url = new URL(&quot;<a href="http://www.google.com&quot;);">http://www.google.com&quot;);</a>    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; URLConnection urlc = url.openConnection();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BufferedInputStream buffer = new BufferedInputStream(urlc.getInputStream());    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StringBuilder builder = new StringBuilder();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int byteRead;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; while ((byteRead = buffer.read()) != -1)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; builder.append((char) byteRead);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; buffer.close();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(builder.toString());    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(&quot;The size of the web page is &quot; + builder.length() + &quot; bytes.&quot;);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (MalformedURLException ex) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ex.printStackTrace();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (IOException ex) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ex.printStackTrace();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; /**    <br />&#160;&#160;&#160;&#160; * Starts the program    <br />&#160;&#160;&#160;&#160; *    <br />&#160;&#160;&#160;&#160; * @param args the command line arguments    <br />&#160;&#160;&#160;&#160; */    <br />&#160;&#160;&#160; public static void main(String[] args) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; new Main().getWebSite();    <br />&#160;&#160;&#160; }    <br />}</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/download-a-forex-quote.php' rel='bookmark' title='Permanent Link: Download a forex quote'>Download a forex quote</a> <small>&#160; import java.net.*; import java.io.*; public class ForexTest { &#160;&#160;&#160;...</small></li><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li><li><a href='http://java.codetuts.com/read-a-file-to-a-string.php' rel='bookmark' title='Permanent Link: Read a file to a string'>Read a file to a string</a> <small>&#160; private String readFile(String pathname) throws IOException { &#160;&#160;&#160; StringBuilder...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/mFYQDHVYmEQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/download-a-web-page.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/download-a-web-page.php</feedburner:origLink></item>
		<item>
		<title>Open a url in browser</title>
		<link>http://feedproxy.google.com/~r/CodetutsJava/~3/gxvtL5oe0vs/open-a-url-in-browser.php</link>
		<comments>http://java.codetuts.com/open-a-url-in-browser.php#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:25:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://java.codetuts.com/open-a-url-in-browser.php</guid>
		<description><![CDATA[&#160;
Intent viewIntent = new Intent(&#34;android.intent.action.VIEW&#34;,Uri.parse(&#34;http://java.codentuts.com&#34;));&#160; startActivity(viewIntent);


Related posts:Start a phone call &#160; try { &#160;&#160; Intent intent = new Intent(Intent.ACTION_CALL); &#160;&#160;...playing a mp3 using service &#160; //MyService.java package com.v3; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer;...Download an image from the internet &#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...
Related posts brought to you by Yet [...]


Related posts:<ol><li><a href='http://java.codetuts.com/start-a-phone-call.php' rel='bookmark' title='Permanent Link: Start a phone call'>Start a phone call</a> <small>&#160; try { &#160;&#160; Intent intent = new Intent(Intent.ACTION_CALL); &#160;&#160;...</small></li><li><a href='http://java.codetuts.com/playing-a-mp3-using-service.php' rel='bookmark' title='Permanent Link: playing a mp3 using service'>playing a mp3 using service</a> <small>&#160; //MyService.java package com.v3; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer;...</small></li><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Intent viewIntent = new Intent(&quot;android.intent.action.VIEW&quot;,Uri.parse(&quot;<a href="http://java.codentuts.com&quot;));">http://java.codentuts.com&quot;));</a>&#160; <br />startActivity(viewIntent);</p>


<p>Related posts:<ol><li><a href='http://java.codetuts.com/start-a-phone-call.php' rel='bookmark' title='Permanent Link: Start a phone call'>Start a phone call</a> <small>&#160; try { &#160;&#160; Intent intent = new Intent(Intent.ACTION_CALL); &#160;&#160;...</small></li><li><a href='http://java.codetuts.com/playing-a-mp3-using-service.php' rel='bookmark' title='Permanent Link: playing a mp3 using service'>playing a mp3 using service</a> <small>&#160; //MyService.java package com.v3; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer;...</small></li><li><a href='http://java.codetuts.com/download-an-image-from-the-internet.php' rel='bookmark' title='Permanent Link: Download an image from the internet'>Download an image from the internet</a> <small>&#160; //MainActivity.java package com.v3; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection;...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><img src="http://feeds.feedburner.com/~r/CodetutsJava/~4/gxvtL5oe0vs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://java.codetuts.com/open-a-url-in-browser.php/feed</wfw:commentRss>
		<feedburner:origLink>http://java.codetuts.com/open-a-url-in-browser.php</feedburner:origLink></item>
	</channel>
</rss>

