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

<channel>
	<title>Waves &#187; java</title>
	<atom:link href="http://www.aswinanand.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aswinanand.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 02:48:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<cloud domain='www.aswinanand.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Free SMS Web Service Updated &#8211; 2</title>
		<link>http://www.aswinanand.com/2009/12/free-sms-web-service-updated-2/</link>
		<comments>http://www.aswinanand.com/2009/12/free-sms-web-service-updated-2/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 20:04:52 +0000</pubDate>
		<dc:creator>Aswin Anand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.aswinanand.com/?p=586</guid>
		<description><![CDATA[Update: There seems to be some problem when the API is being accessed from my domain. Kindly try hosting the script in your own domains. The free SMS web service, that you have come to love and use, has been updated. You can download for the following languages here: Java PHP If you are accessing [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong><span style="color: #ff6600;">Update:</span> There seems to be some problem when the API is being accessed from my domain. <a title="Deploy the script in your own domain" href="http://www.aswinanand.com/2008/07/send-free-sms-web-service/#deploy">Kindly try hosting the script in your own domains</a>.</strong></em></p>
<p>The free SMS web service, that you have come to love and use, has been updated. You can download for the following languages here:</p>
<ol>
<li><a title="Free SMS Java Library" href="http://www.aswinanand.com/2009/01/free-sms-web-service-java-library/">Java</a></li>
<li><a title="Send Free SMS" href="http://www.aswinanand.com/blog/2008/07/send-free-sms-web-service/">PHP</a></li>
</ol>
<p>If you are accessing the service through the <a title="Free SMS Web Service" href="http://www.aswinanand.com/blog/2008/07/send-free-sms-web-service/">URL mentioned here</a>, then be rest assured that it will continue to work. Download the latest versions and enjoy! <img src='http://www.aswinanand.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you are facing any problems, please do let me know in comments and I will try to address them at the earliest.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aswinanand.com/2009/12/free-sms-web-service-updated-2/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>HttpURLConnection.setFollowRedirects Bug</title>
		<link>http://www.aswinanand.com/2009/01/httpurlconnectionsetfollowredirects-bug/</link>
		<comments>http://www.aswinanand.com/2009/01/httpurlconnectionsetfollowredirects-bug/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 11:42:27 +0000</pubDate>
		<dc:creator>Aswin Anand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.aswinanand.com/blog/?p=250</guid>
		<description><![CDATA[HttpURLConnection in the JDK has a bizarre bug. When it receives a HTTP response code in the 3xx range, it performs redirection to the web page mentioned in the &#8220;Location&#8221; header. However, when it does this, it forgets to send all the cookies with the request. Therefore, if you are working with any of the [...]]]></description>
			<content:encoded><![CDATA[<p>HttpURLConnection in the JDK has a bizarre bug. When it receives a HTTP response code in the 3xx range, it performs redirection to the web page mentioned in the &#8220;Location&#8221; header. However, when it does this, it forgets to send all the cookies with the request. Therefore, if you are working with any of the web 2.0 APIs which perform redirection and require this authentication cookie with each request, you are doomed because the server will redirect to the login page thinking that this is an unauthenticated request.</p>
<p>The solution for this is pretty simple. If you have written code like below:</p>
<blockquote><p>URL u = new URL(&#8220;http://www.example.com&#8221;);</p>
<p>HttpURLConnection conn = (HttpURLConnection) u.openConnection();</p></blockquote>
<p>You have to add one more line that sets redirection to &#8220;FALSE&#8221; &amp; do the redirection yourself with the cookies, which becomes like:</p>
<blockquote><p>URL u = new URL(&#8220;http://www.example.com&#8221;);</p>
<p>HttpURLConnection conn = (HttpURLConnection) u.openConnection();</p>
<p><strong>conn.setInstanceFollowRedirects(false);</strong> // do not redirect</p>
<p><strong>String locHeader = conn.getHeaderField(&#8220;Location&#8221;); </strong>// get the location</p>
<p><strong>String cookies = conn.getHeaderField(&#8220;Set-Cookie&#8221;); </strong>// get the cookie</p>
<p>u = null; conn = null;</p>
<p>u = new URL(locHeader);</p>
<p>conn = (HttpURLConnection) u.openConnection();</p>
<p><strong>conn.setRequestProperty(&#8220;Cookie&#8221;, cookies);</strong> // set the cookie yourself</p>
<p>&#8230;.</p></blockquote>
<p>Done! That should solve the bug. If this seems too much to do, then you should consider using this excellent <a title="Apache HttpClient Library" href="http://hc.apache.org/" target="_blank">HttpClient library</a> from Apache.</p>
<p>I did the above mentioned stuff for this <a title="Free SMS Java Library" href="http://www.aswinanand.com/blog/2009/01/free-sms-web-service-java-library/">Free SMS Java Library</a> because:</p>
<ol>
<li>The library has to be very small because it is just one file.</li>
<li>Eliminate external dependencies that will bloat the library.</li>
</ol>
<div>There you go! Now, if you have encountered this bug you have the solution to squash it. Have fun!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.aswinanand.com/2009/01/httpurlconnectionsetfollowredirects-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free SMS Web Service India &#8211; Java Library</title>
		<link>http://www.aswinanand.com/2009/01/free-sms-web-service-java-library/</link>
		<comments>http://www.aswinanand.com/2009/01/free-sms-web-service-java-library/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 04:52:37 +0000</pubDate>
		<dc:creator>Aswin Anand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.aswinanand.com/blog/?p=249</guid>
		<description><![CDATA[If you have used the Free SMS web service already and craved a java version, it is here . You can now send SMS from within your program by calling a simple method. Just download this JAR file and include it in your class path. Java source code for the class file is present in [...]]]></description>
			<content:encoded><![CDATA[<p>If you have used the <a title="Free SMS Web Service" href="http://www.aswinanand.com/blog/2008/07/send-free-sms-web-service/">Free SMS web service</a> already and craved a java version, it is here <img src='http://www.aswinanand.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . You can now send SMS from within your program by calling a simple method. Just download <a title="Free SMS Java Library" href="http://www.aswinanand.com/downloads/sms.jar">this JAR file</a> and include it in your class path. Java source code for the class file is present in the JAR archive itself. So, if required you can browse through it.</p>
<p><span style="color: #ff6600;"><strong>How to use:</strong></span></p>
<p><em><strong>Please note that you need to create a free account at <a title="way2sms website" href="http://www.way2sms.com" target="_blank">www.way2sms.com</a> before attempting to use the library.</strong></em></p>
<p>Here&#8217;s a simple program on how to use the JAR.</p>
<blockquote><p>import com.aswinanand.sms;</p>
<p>public static void main(String&#8230; args) {</p>
<p>SMS.send(&#8220;9933445566&#8243;, &#8220;password&#8221;, &#8220;9001122334;9887712345&#8243;, &#8220;message&#8221;);</p>
<p>}</p></blockquote>
<p>SMS should be sent now. If there are any errors then an exception will be thrown.</p>
<p><strong><span style="color: #ff6600;">License:</span></strong></p>
<p>This Java source code, the class file and the archive is licensed under &#8220;Creative Commons Attribution-Noncommercial&#8221;. <a title="License Information" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank">License terms are here</a>. Downloading the files means you agree to the license terms.</p>
<p><strong><span style="color: #ff6600;">Download:</span></strong></p>
<p><a title="sms.jar Download" href="http://www.aswinanand.com/downloads/sms.jar">Download the sms.jar here</a>.</p>
<p><span style="color: #ff6600;"><strong>Improvements:</strong></span></p>
<p>Some immediate improvements are underway right now:</p>
<ol>
<li>Code cleanup.</li>
<li>Organize the code in methods. Right now everything is in one big method.</li>
<li>Invalid login notification.</li>
<li>Support for authenticated proxy servers.</li>
</ol>
<p><span style="color: #ff6600;"><strong>Change Log:</strong></span></p>
<p><strong>Version 0.2, 0.3:</strong></p>
<ol>
<li>Implemented the major changes that happened at way2sms. <a title="Free SMS Java Library" href="http://www.aswinanand.com/downloads/sms.jar" target="_blank">Download here</a>.</li>
</ol>
<p><strong>Version 0.1:</strong></p>
<ol>
<li>First release with working code base for sending SMS through way2sms.</li>
</ol>
<p>Please take it for a test drive and give feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aswinanand.com/2009/01/free-sms-web-service-java-library/feed/</wfw:commentRss>
		<slash:comments>154</slash:comments>
		</item>
		<item>
		<title>On a cleaning spree, Other updates</title>
		<link>http://www.aswinanand.com/2006/12/on-a-cleaning-spree-other-updates/</link>
		<comments>http://www.aswinanand.com/2006/12/on-a-cleaning-spree-other-updates/#comments</comments>
		<pubDate>Sun, 17 Dec 2006 10:34:00 +0000</pubDate>
		<dc:creator>Aswin Anand</dc:creator>
				<category><![CDATA[Casually Speaking ...]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[proto]]></category>
		<category><![CDATA[sun tech days]]></category>

		<guid isPermaLink="false">http://www.aswinanand.com/?p=115</guid>
		<description><![CDATA[Hey guys, after quite a long time, assume about 3 years, I have cleaned my small room over this weekend&#8230; much to the surprise of my mom ofcourse . It took about 5 hours of day one and another 3 hours of day two to complete it in all glory. Next on line is my [...]]]></description>
			<content:encoded><![CDATA[<p>Hey guys, after quite a long time, assume about 3 years, I have cleaned my small room over this weekend&#8230; much to the surprise of my mom ofcourse <img src='http://www.aswinanand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . It took about 5 hours of day one and another 3 hours of day two to complete it in all glory. Next on line is my blog, which wasn&#8217;t touched except for doing new posts. Have to get a nice new template soon. Any suggestions?</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p><a href="http://java.sun.com/javase/6" target="_new">Java SE 6</a> is out. The whole <a href="http://www.java.net" target="_new">Java community</a> is gaga over it. <a href="http://www.netbeans.org" target="_new">Netbeans 5.5</a> now supports Java SE 6 also. <a href="http://www.techcrunch.com/2006/11/15/lack-of-internal-talks-at-microsoft-google" target="_new">Reading this</a> yesterday, I feel Sun is committed to <em>not</em> making that mistake. The next <a href="http://developers.sun.com/events/techdays/" target="_new">Sun Tech Days</a> event is happening at <a href="http://www.sercononline.com/suntechdays07/ms/home.htm" target="_new">Hyderabad</a> on 21-23 Feb 2007. The talks look promising and the topics they pick everytime are exciting. They have also added a Java ME day this time. If you are a java freek, DON&#8217;T miss this event. <a href="http://www.reg-express.com/suntech07/register.jsp?count=1" target="_new">Register</a>.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p><a href="http://www.proto.in/" target="_new">Proto</a> has been going on great. The website now sports a new <strike>dress</strike> skin. If you are a startup company willing to showcase your product at Proto, nominate yourself. The nomination closes on 20th Dec 2006. Registration for other participants will be open soon. So, hang on! Read the <a href="http://www.proto.in/blog" target="_new">Proto blog</a> for more information.</p>
<p>Wow!! exciting times ahead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aswinanand.com/2006/12/on-a-cleaning-spree-other-updates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
