<?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>Sihan's Blog</title>
	<atom:link href="http://sihantech.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sihantech.wordpress.com</link>
	<description>Tech Talks</description>
	<lastBuildDate>Fri, 02 Dec 2011 17:28:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sihantech.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sihan's Blog</title>
		<link>http://sihantech.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sihantech.wordpress.com/osd.xml" title="Sihan&#039;s Blog" />
	<atom:link rel='hub' href='http://sihantech.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Displaying map from Open Street Map (OSM) inside google map api</title>
		<link>http://sihantech.wordpress.com/2009/01/06/displaying-map-from-open-street-map-osm-inside-google-map-api/</link>
		<comments>http://sihantech.wordpress.com/2009/01/06/displaying-map-from-open-street-map-osm-inside-google-map-api/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 22:34:13 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[google map api]]></category>
		<category><![CDATA[custom map type in google map api]]></category>
		<category><![CDATA[osm in google map]]></category>
		<category><![CDATA[osm integration]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=87</guid>
		<description><![CDATA[In many countries google&#8217;s map data is inadequate; it lacks street level data in many countries. In these cases Open Street Map is a good solution. Most of the applications written using google map api use google map data for displaying map. In this cases one should find a solution to integrate OSM inside google [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=87&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">In many countries google&#8217;s map data is inadequate; it lacks street level data in many countries.</p>
<p class="MsoNormal">In these cases Open Street Map is a good solution. Most of the applications written using google map api use google map data for displaying map. In this cases one should find a solution to integrate OSM inside google map api.</p>
<p class="MsoNormal">After some RnD on google map api and OSM I found out a solution to this. Google map api has a nice provision to add custom map types. And I used this feature to implement the solution. I added a custom map type in my google map and fetch the desired tiles from osm server. Here is the JavaScript code snippet:</p>
<p><code><br />
</code></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span> </span>var map = new GMap(document.getElementById(&#8220;map&#8221;));</p>
<p class="MsoNormal"><span> </span><span> </span>map.addControl(new GScaleControl());</p>
<p class="MsoNormal"><span> </span>map.addControl(new GLargeMapControl());</p>
<p class="MsoNormal"><span> </span>map.addControl(new GMapTypeControl());</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span>//Custom function for fetchng tiles from OSM server<span> </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span>CustomGetTileUrl=function(a,b){<span> </span></p>
<p class="MsoNormal"><span> </span>return &#8216;http://a.tile.openstreetmap.org/&#8217;+b+&#8217;/'+a.x+&#8217;/'+a.y+&#8217;.png&#8217;;<span> </span><span> </span></p>
<p class="MsoNormal"><span> </span>}</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span>var copyright = new GCopyright(1,</p>
<p class="MsoNormal"><span> </span>new GLatLngBounds(new GLatLng(53.8136257,-3.0981445),</p>
<p class="MsoNormal"><span> </span><span> </span>new GLatLng(53.8654855,-2.9663944) ),</p>
<p class="MsoNormal"><span> </span>17, &#8220;&#8221;);</p>
<p class="MsoNormal">
<p class="MsoNormal"><span> </span>var copyrightCollection = new GCopyrightCollection(&#8221;);</p>
<p class="MsoNormal"><span> </span>copyrightCollection.addCopyright(copyright);</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span> </span>var tilelayers = [new GTileLayer(copyrightCollection,1,17)];</p>
<p class="MsoNormal"><span> </span>tilelayers[0].getTileUrl = CustomGetTileUrl;</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span>var osmmap = new GMapType(tilelayers, G_SATELLITE_MAP.getProjection(), &#8220;O.S.M.&#8221;);</p>
<p class="MsoNormal"><span> </span>map.addMapType(osmmap);</p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span>map.setCenter(new GLatLng(34.6891,33.0182), 14, osmmap);</p>
<p class="MsoNormal">
<p class="MsoNormal">This will create an extra map type labeled &#8220;O. S.M.&#8221; besides the standard map types of google map api.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=87&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2009/01/06/displaying-map-from-open-street-map-osm-inside-google-map-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Load Balancing Tomcat with Apache</title>
		<link>http://sihantech.wordpress.com/2008/12/25/load-balancing-tomcat-with-apache/</link>
		<comments>http://sihantech.wordpress.com/2008/12/25/load-balancing-tomcat-with-apache/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 19:34:44 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[J2ee]]></category>
		<category><![CDATA[Knowledge Base]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Server Scalability]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[clustering and load balancing]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[server scalablility]]></category>
		<category><![CDATA[tomcat server performance increase]]></category>
		<category><![CDATA[Tomcat with Apache]]></category>
		<category><![CDATA[using mod_proxy and mod_proxy_balancer in apache]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=79</guid>
		<description><![CDATA[Increase tomcat server scalability using load balancer at the front.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=79&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on server scalability issue of one of my projects. So I had to went through some RnD on load balancing and finally was able to configure it. I used tomcat as servlet container and apache as load balancer. I used mod_proxy and mod_proxy_balancer module of apache for load balancing between two tomcat instances running on port 8080 and 3333.</p>
<p>Here is the details:</p>
<p><strong>Server used</strong>:<br />
Tomcat 6.0.16 as servlet container x 2<br />
Apache 2.2.6 as load balancer x 1</p>
<p><strong>Testing Tool:</strong></p>
<p>Jakarta JMeter 2.6.1</p>
<p><strong>Apache Configuration:</strong></p>
<p>Here, I created a cluster named <em>mycluster</em> using 2 tomcat server and sticksession named as <em>JSESSIONID</em>. My test application <em>myapp</em> was running on both of the tomcat server.</p>
<p>I used loadfactor 50 on both of the tomcat server (meaning both of them will be sharing equal load). I</p>
<p>1. Enable mod_proxy: In httpd.conf enable/add</p>
<p><code>LoadModule proxy_module modules/mod_proxy.so</code></p>
<p>2. Enable mod_proxy_balancer: In httpd.conf</p>
<p><code>LoadModule proxy_balancer_module modules/mod_proxy_balancer.so</code></p>
<p>3. Configure the load balancer on the cluster and balancer manager:</p>
<p>In httpd.conf add these lines:</p>
<p style="padding-left:30px;"><code>ProxyPass /myapp balancer://mycluster stickysession=JSESSIONID</code></p>
<p style="padding-left:30px;"><code>&lt;Proxy balancer://mycluster&gt;<br />
</code></p>
<p style="padding-left:30px;"><code> BalancerMember http://localhost:8080/myapp route=tomcat1 loadfactor=50<br />
BalancerMember http://localhost:3333/myapp route=tomcat2 loadfactor=50</code></p>
<p style="padding-left:30px;"><code>&lt;/Proxy&gt;</code></p>
<p style="padding-left:30px;"><code>&lt;Location /balancer-manager&gt;<br />
SetHandler balancer-manager<br />
&lt;/Location&gt;</code></p>
<p>After restarting the server and hitting <em>http://localhost/balancer-manager</em> in a browser it showed me the configurations of the cluster.</p>
<p><strong>Tomcat Configuration</strong>:</p>
<p>1. In server.xml file of tomcat running on 8080 port I configured the jvm route as tomcat1 as :</p>
<p><code>&lt;Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"&gt;</code></p>
<p>By editing the engine tag.</p>
<p>2. In server.xml file of tomcat running on 3333 port I configured the jvm route as tomcat1 the same way:</p>
<p><code>&lt;Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2"&gt;</code></p>
<p><strong>The testing application:</strong></p>
<p>I used a single servlet for the test application <em>myapp</em>.</p>
<p>Here is the code snippet of the servlet named <em>myservlet</em>:</p>
<p style="padding-left:30px;"><code>ServletContext sc = this.getServletContext();<br />
String servername = sc.getInitParameter(</code><code>"</code><code>servername</code><code>"</code><code>);<br />
out.print(</code><code>"</code><code>This is from ::</code><code>"</code><code> + servername);</code></p>
<p>In web.xml of the application I added a context parameter named <em>servername </em>which value was server1 while deploying into tomcat1(on port 8080) and <em>server2 </em>on tomcat2(running on 3333 port).</p>
<p><strong>Testing:</strong></p>
<p>With JMeter I created a script for hiitting the url http://localhost/myapp/myservlet using 400 concurrent thread in 20 loops to see the effect.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=79&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/12/25/load-balancing-tomcat-with-apache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Links of toturials for mysql performance tuning</title>
		<link>http://sihantech.wordpress.com/2008/08/14/links-of-toturials-for-mysql-performance-tuning/</link>
		<comments>http://sihantech.wordpress.com/2008/08/14/links-of-toturials-for-mysql-performance-tuning/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 22:44:00 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Resource Links]]></category>
		<category><![CDATA[database optimisation]]></category>
		<category><![CDATA[database performance tuning]]></category>
		<category><![CDATA[mysql tutorial]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=66</guid>
		<description><![CDATA[Here is some tutorials&#8217; links for mysql performance tuning: Optimizing MySQL: Queries and Indexes Using Fulltext Indexes in MySQL &#8211; Part 1 Using Fulltext Indexes in MySQL &#8211; Part 2, Boolean searches<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=66&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is some tutorials&#8217; links for mysql performance tuning:</p>
<ol>
<li><a href="http://www.databasejournal.com/features/mysql/article.php/10897_1382791">Optimizing MySQL: Queries and Indexes</a></li>
<li><a href="http://www.databasejournal.com/features/mysql/article.php/1578331">Using Fulltext Indexes in MySQL &#8211; Part 1</a></li>
<li><a href="http://www.databasejournal.com/features/mysql/article.php/1587371">Using Fulltext Indexes in MySQL &#8211; Part 2, Boolean searches</a></li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=66&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/08/14/links-of-toturials-for-mysql-performance-tuning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending array in GET method in Java Servlet</title>
		<link>http://sihantech.wordpress.com/2008/08/14/sending-array-in-get-method-in-java-servlet/</link>
		<comments>http://sihantech.wordpress.com/2008/08/14/sending-array-in-get-method-in-java-servlet/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 21:18:09 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[J2ee]]></category>
		<category><![CDATA[J2me]]></category>
		<category><![CDATA[Knowledge Base]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[GET method]]></category>
		<category><![CDATA[java servlet]]></category>
		<category><![CDATA[Sending Array to servlet]]></category>
		<category><![CDATA[servlet]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=61</guid>
		<description><![CDATA[Suppose I want to send an array of names from any http client in get method to a servlet like, name[0] = &#8220;sihan&#8221; name[1] = &#8220;rasel&#8221; name[2] = &#8220;siam&#8221; name[3] = &#8220;shamim&#8221; All I have to do build the query string like this : http://server_url:server_port/servletname?name=sihan&#38;name=rasel&#38;name=siam&#38;name=shamim And in the servlet we can get the array like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=61&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Suppose I want to send an array of names from any http client in get method to a servlet like,</p>
<p>name[0] = &#8220;sihan&#8221;</p>
<p>name[1] = &#8220;rasel&#8221;</p>
<p>name[2] = &#8220;siam&#8221;</p>
<p>name[3] = &#8220;shamim&#8221;</p>
<p>All I have to do build the query  string like this :</p>
<p><strong><code>http://server_url:server_port/servletname?name=sihan&amp;name=rasel&amp;name=siam&amp;name=shamim</code></strong></p>
<p>And in the servlet we can get the array like this:</p>
<p><strong><code>String[] names = request.getParameterValues("name");</code></strong></p>
<p>Then <em>&#8216;<strong>names</strong>&#8216; </em>array will contain all the four values passed in &#8216;<em><strong>name</strong></em>&#8216; parameter.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=61&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/08/14/sending-array-in-get-method-in-java-servlet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>MMAPI workarounds in different mobile devices: part 2</title>
		<link>http://sihantech.wordpress.com/2008/08/07/mmapi-workarounds-in-different-mobile-devices-part-2/</link>
		<comments>http://sihantech.wordpress.com/2008/08/07/mmapi-workarounds-in-different-mobile-devices-part-2/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 11:33:29 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[J2me]]></category>
		<category><![CDATA[image capturing in j2me]]></category>
		<category><![CDATA[j2me mmapi]]></category>
		<category><![CDATA[mmapi]]></category>
		<category><![CDATA[mmapi in samsung u700]]></category>
		<category><![CDATA[mmapi options]]></category>
		<category><![CDATA[video capturing in java]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=48</guid>
		<description><![CDATA[Today, I was working with &#8220;Samsung SGH-U700&#8221; device and found some interesting things. I found the following result after some benchmark test: microedition.media.version :: 1.1 supports.mixing :: false supports.audio.capture :: true supports.video.capture :: false supports.recording :: true audio.encodings :: encoding=audio/amr video.encodings :: encoding=video/H263 video.snapshot.encodings :: encoding=jpeg encoding-png streamable.contents :: video.mpeg And previously I found (source [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=48&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, I was working with &#8220;<strong>Samsung SGH-U700</strong>&#8221; device and found some interesting things. I found the following result after some benchmark test:</p>
<ul>
<li>microedition.media.version :: 1.1</li>
<li>supports.mixing :: false</li>
<li>supports.audio.capture :: true</li>
<li><span style="color:#ff0000;">supports.video.capture :: false</span></li>
<li><span style="color:#ff0000;">supports.recording :: true</span></li>
<li><span style="color:#ff0000;"><span style="color:#000000;">audio.encodings :: encoding=audio/amr</span></span></li>
<li><span style="color:#ff0000;"><span>video.encodings :: encoding=video/H263</span></span></li>
<li><span style="color:#ff0000;">video.snapshot.encodings :: encoding=jpeg encoding-png</span></li>
<li><span style="color:#ff0000;"><span style="color:#000000;">streamable.contents :: video.mpeg</span></span></li>
</ul>
<p>And previously I found (source <a href="http://developers.sun.com/mobility/apis/articles/mmapioptions/" target="_blank">http://developers.sun.com/mobility/apis/articles/mmapioptions/</a> ):</p>
<ul>
<li><code>microedition.media.version</code> returns a string representing the version of MMAPI implemented, <code>"1.0"</code> or <code>"1.1"</code> if MMAPI is supported, or <code>null</code> if it isn&#8217;t.</li>
<li><code>supports.mixing</code> returns <code>true</code> if mixing is supported, <code>false</code> if it isn&#8217;t.</li>
<li><code>supports.audio.capture</code> returns <code>true</code> if audio capture is supported, <code>false</code> if it isn&#8217;t.</li>
<li><span style="color:#ff0000;"><code>supports.video.capture</code> returns <code>true</code> if video capture is supported, <code>false</code> if it isn&#8217;t. </span></li>
<li><span style="color:#ff0000;"><code>supports.recording</code> returns <code>true</code> if recording is supported, <code>false</code> if it isn&#8217;t. </span></li>
<li><code>audio.encodings</code> returns a string representing the supported audio capture formats, or <code>null</code> if audio capture isn&#8217;t supported.</li>
<li><span style="color:#ff0000;"><code>video.encodings</code> returns a string representing the supported video capture formats, or <code>null</code> if video capture isn&#8217;t supported. </span></li>
<li><span style="color:#ff0000;"><code>video.snapshot.encodings</code> returns a string representing the supported image capture formats, or <code>null</code> if video snapshot isn&#8217;t supported. </span></li>
<li><code>streamable.contents</code> returns a string representing the supported streamable content types, in MIME syntax.</li>
</ul>
<p>Now have a look at my benchmark result:</p>
<ol>
<li>it shows &#8220;<span style="color:#ff0000;">supports.video.capture</span>&#8221; as &#8220;<span style="color:#ff0000;">false</span>&#8221; meaning that it does not support video capture but shows &#8220;<span style="color:#ff0000;">encoding=video/H263</span>&#8221; <span style="color:#ff0000;"><code><span style="color:#000000;">as</span> <span style="color:#000000;">"</span>video.encodings<span style="color:#000000;">", </span></code></span><span style="color:#ff0000;"><span style="color:#000000;">representing the supported video capture format as <span style="color:#ff0000;">video/H263</span>. Also it shows &#8220;</span></span><span style="color:#ff0000;">video.snapshot.encodings</span>&#8221; as &#8220;<span style="color:#ff0000;">encoding=jpeg encoding-png<span style="color:#000000;">&#8221; which means its </span></span><span style="color:#ff0000;">supported image capture formats</span><span style="color:#ff0000;"> are &#8220;jpeg&#8221; and &#8220;png&#8221;. <span style="color:#000000;">These things are self cotradictory. Ideally </span></span><span style="color:#ff0000;"><code>video.encodings,</code></span><span style="color:#ff0000;">video.snapshot.encodings</span><span style="color:#ff0000;"><code><span style="color:#000000;"> </span></code></span><span style="color:#ff0000;"><span style="color:#000000;">should be null<span style="color:#000000;">.<br />
</span></span></span></li>
<li><span style="color:#ff0000;"><span style="color:#000000;"><span style="color:#000000;">In my benchmark I found </span></span></span><span style="color:#ff0000;"><span style="color:#000000;">&#8220;</span>supports.recording<span style="color:#000000;">&#8220;</span> as <span style="color:#000000;">&#8220;</span>true<span style="color:#000000;">&#8221; meaning that recording is supported. At first glance I was astonished thinking that &#8220;this handset</span> <span style="color:#000000;">does not support video capture but supports recording !(I was thinking of video recording as recording)  &#8220;</span> <span style="color:#000000;">.</span> <span style="color:#000000;">After some googling I came to know that</span></span></li>
</ol>
<blockquote><p><em>You may encounter some confusion when trying to reconcile some of the property values mentioned above with what you observe                         on a real device. For example: the Nokia 3230 and the Nokia 6600 both return <code>true</code> for both the <code>supports.video.capture</code> and the <code>supports.recording</code> properties. So it seems that both devices will support video recording. But there is a catch. If <code>supports.recording</code> returns <code>true</code>, you can record media using at least one player type &#8212; at least <em>one,</em> but not necessarily <em>all.</em> The Nokia 6600 supports the recording of audio, but not the recording of video. But the Nokia 3230 also supports video recording.</em>
</p></blockquote>
<p>(source : <a href="http://www.javaworld.com/javaworld/jw-09-2007/jw-09-mobilevideo1.html?page=2" target="_blank">http://www.javaworld.com/javaworld/jw-09-2007/jw-09-mobilevideo1.html?page=2</a>)</p>
<p>The case is the same for Nokia-6600 and Samsung-SGH-U700 handsets.</p>
<p>And running my video/image capturing program I always get &#8220;javax.microedition.media.MediaException:Not Support Camera&#8221;. Then I became sure that Neither video recording nor snap shot is possible on this device with MMAPI.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=48&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/08/07/mmapi-workarounds-in-different-mobile-devices-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple RSS reader using PHP</title>
		<link>http://sihantech.wordpress.com/2008/08/06/simple-rss-reader-using-php/</link>
		<comments>http://sihantech.wordpress.com/2008/08/06/simple-rss-reader-using-php/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 12:36:39 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[Xml]]></category>
		<category><![CDATA[rss reader]]></category>
		<category><![CDATA[simple xml]]></category>
		<category><![CDATA[syndication]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=38</guid>
		<description><![CDATA[RSS is a basic XML format for publishing syndicated content. The root element of the document is rss, which contains a single channel element. The channel element contains metadata about the feed, including its title, language, and URL. It also contains various stories enclosed in item elements. Each item has a link element containing a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=38&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>RSS</em> is a basic XML    format for publishing syndicated content. The root element of the document is    <code>rss</code>, which contains a single <code>channel</code> element. The <code>channel</code> element contains metadata about    the feed, including its title, language, and URL. It also contains various stories    enclosed in <code>item</code> elements. Each <code>item</code> has a    <code>link</code> element containing a URL and either a    <code>title</code> or a <code>description</code> (usually both) that contain plain text.<br />
Here is an example feed from <a title="google news rss feed" href="http://news.google.com/?ned=us&amp;topic=t&amp;output=rss" target="_blank">google news</a>:</p>
<p><code><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
<strong>&lt;rss version="2.0"&gt;</strong><br />
<strong>&lt;channel&gt;</strong><br />
<strong> &lt;generator&gt;</strong>NFE/1.0<strong>&lt;/generator&gt;</strong><br />
<strong>&lt;title&gt;</strong>Google News - Sci/Tech<strong>&lt;/title&gt;</strong><br />
<strong>&lt;link&gt;</strong>http://news.google.com/?ned=us&amp;amp;topic=t<strong>&lt;/link&gt;</strong><br />
<strong>&lt;language&gt;</strong>en<strong>&lt;/language&gt;</strong><br />
<strong>&lt;webMaster&gt;</strong>news-feedback@google.com<strong>&lt;/webMaster&gt;</strong><br />
<strong>&lt;copyright&gt;</strong>&amp;amp;copy;2008 Google<strong>&lt;/copyright&gt;</strong><br />
<strong>&lt;pubDate&gt;</strong>Wed, 06 Aug 2008 07:13:30 GMT<strong>&lt;/pubDate&gt;</strong><br />
<strong>&lt;lastBuildDate&gt;</strong>Wed, 06 Aug 2008 07:13:30 GMT<strong>&lt;/lastBuildDate&gt;</strong><br />
<strong>&lt;image&gt;</strong><br />
<strong>&lt;title&gt;</strong>Google News<strong>&lt;/title&gt;</strong><br />
<strong>&lt;url&gt;</strong>http://news.google.com/intl/en_us/images/news_res.gif<strong>&lt;/url&gt;</strong><br />
<strong>&lt;link&gt;</strong>http://news.google.com/<strong>&lt;/link&gt;</strong><br />
<strong>&lt;/image&gt;</strong><br />
<strong>&lt;item&gt;</strong><br />
<strong>&lt;title&gt;</strong>Delta to Offer Wi-Fi on US Flights - New York Times<strong>&lt;/title&gt;</strong><br />
<strong>&lt;link&gt;</strong>http://news.google.com/news/url?sa=T&amp;amp;ct=us/0-0&amp;amp;fd=R&amp;amp;url=http://www.nytimes.com/2008/08/06/technology/06delta.html%3Fref%3Dbusiness&amp;amp;cid=1233786045&amp;amp;ei=Gk-ZSLbVI4PGlgS_94jVBA&amp;amp;usg=AFQjCNHnUSPm9sCPP4k2gWPBDboZAiYtCw</code><code><strong>&lt;/link&gt;</strong><br />
<strong>&lt;guid</strong> isPermaLink="false"&gt;tag:news.google.com,2005:cluster=498a14bd<br />
<strong>&lt;/guid&gt;</strong><br />
<strong>&lt;pubDate&gt;</strong>Wed, 06 Aug 2008 01:10:42 GMT<strong>&lt;/pubDate&gt;</strong><br />
<strong>&lt;description&gt;</strong>&amp;lt;table border=0 width= valign=top cellpadding=2 cellspacing=7&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td width=80 align=center valign=top&amp;gt;&amp;lt;font style=&amp;quot;font-size:85%;font-family:arial,sans-serif&amp;quot;&amp;gt;&amp;lt;a  href=&amp;quot;http://news.google.com/news/url?sa=T&amp;amp;ct=us/0i-0&amp;amp;fd=R&amp;amp;url=http://www.geekzone.co.nz/content.asp%3Fcontentid%3D7864&amp;amp;cid=1233786045&amp;amp;ei=Gk-ZSLbVI4PGlgS_94jVBA&amp;amp;usg=AFQjCNF4sPd1YWYzXRyLVYtIYVl_ndmW4g&amp;quot;&amp;gt; .......<br />
<strong> &lt;/description&gt;</strong></code></p>
<p><code><strong>&lt;/item&gt;</strong></code><br />
<code><strong>&lt;item&gt;</strong><br />
<strong>&lt;title&gt;</strong>LiMo lands seven new phones - Register&lt;/title&gt;<br />
<strong>&lt;link&gt;</strong>http://news.google.com/news/url?sa=T&amp;amp;ct=us/19-0&amp;amp;fd=R&amp;amp;url=http://www.theregister.co.uk/2008/08/05/limo_lands_seven_new_phones/&amp;amp;cid=1233302260&amp;amp;ei=Gk-ZSLbVI4PGlgS_94jVBA&amp;amp;usg=AFQjCNEILOMvAvv5fwcFWpYLWWJVs7vc5Q&lt;/link&gt;<br />
<strong>&lt;guid</strong> isPermaLink="false"&gt;tag:news.google.com,2005:cluster=4982b2f4<br />
<strong>&lt;/guid&gt;</strong><br />
<strong>&lt;pubDate&gt;</strong>Tue, 05 Aug 2008 01:00:06 GMT<strong>&lt;/pubDate&gt;</strong><br />
<strong>&lt;description&gt;</strong>&amp;lt;table border=0 width= valign=top cellpadding=2 cellspacing=7&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td width=80 align=center valign=top&amp;gt;&amp;lt;font style=&amp;quot;font-size:85%;limo-platform/&amp;amp;cid=1233302260&amp;amp;ei=Gk-ZSLbVI4PGlgS_94jVBA&amp;amp;usg=AFQjCNHS1CWmT1jipl0N-Q-VEOnxM-TmRg&amp;quot;&amp;gt;&amp;lt;img src=http://news.google.com/news?imgefp=hOtr_7v_dyoJ&amp;amp;....<strong>&lt;/description&gt;</strong><br />
<strong>&lt;/item&gt;</strong><br />
<strong>&lt;/channel&gt;</strong><br />
<strong> &lt;/rss&gt;</strong></code></p>
<p>Using PHP&#8217;s SimpleXML(introduced in PHP5) api it is very easy to access different nodes of the xml above. Like, if we want to get the title of the rss at google news we can write,<br />
<code><br />
$url = "http://news.google.com/?ned=us&amp;topic=t&amp;output=rss"; // url of google news<br />
$xml = simplexml_load_file($url); //loading the document<br />
$title = $xml-&gt;channel-&gt;title; //gets the title of the document.<br />
</code></p>
<p>The beauty of the function <code>"simplexml_load_file()"</code> is : it does not only load and parse the document but also points to the root element of the document (which is <code>'rss'</code> here).</p>
<p>Using &#8216;Simple XML api&#8217; the following code snippet prints news from google news rss :<br />
<code><br />
&lt;?php<br />
$url = "http://news.google.com/?ned=us&amp;topic=t&amp;output=rss";<br />
$rss = simplexml_load_file($url);<br />
if($rss)<br />
{<br />
echo '&lt;h1&gt;'.$rss-&gt;channel-&gt;title.'&lt;/h1&gt;';<br />
echo '&lt;li&gt;'.$rss-&gt;channel-&gt;pubDate.'&lt;/li&gt;';<br />
$items = $rss-&gt;channel-&gt;item;<br />
foreach($items as $item)<br />
{<br />
$title = $item-&gt;title;<br />
$link = $item-&gt;link;<br />
$published_on = $item-&gt;pubDate;<br />
$description = $item-&gt;description;<br />
echo '&lt;h3&gt;&lt;a href="'.$link.'"&gt;'.$title.'&lt;/a&gt;&lt;/h3&gt;';<br />
echo '&lt;span&gt;('.$published_on.')&lt;/span&gt;';<br />
echo '&lt;p&gt;'.$description.'&lt;/p&gt;';<br />
}<br />
}<br />
?&gt;<br />
</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=38&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/08/06/simple-rss-reader-using-php/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>MMAPI workarounds in different mobile devices : part 1</title>
		<link>http://sihantech.wordpress.com/2008/07/17/mmapi-workarounds-in-different-mobile-devices/</link>
		<comments>http://sihantech.wordpress.com/2008/07/17/mmapi-workarounds-in-different-mobile-devices/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 12:03:24 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[J2me]]></category>
		<category><![CDATA[capturing media in mobile]]></category>
		<category><![CDATA[j2me mmapi]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[set porting issues]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=25</guid>
		<description><![CDATA[I have been working with mmapi in j2me for the last few days and found some interesting things on different devices. Set: Nokia-6300 1. Locator string for capturing should be different for capturing image and video For image it should be, &#8220;capture://image&#8221; For video it should be, &#8220;capture://video&#8221; 2. Shows device(camera) unavailable when battery charge [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=25&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been working with mmapi in j2me for the last few days and found some interesting things on different devices.</p>
<p><strong>Set: Nokia-6300</strong></p>
<p>1. Locator string for capturing should be different for capturing image and video</p>
<p>For image it should be,</p>
<p><span> </span>&#8220;capture://image&#8221;</p>
<p>For video it should be,</p>
<p><span> </span>&#8220;capture://video&#8221;</p>
<p>2. Shows device(camera) unavailable when battery charge is low.</p>
<p>3. png encoding in getSnapShot() method is not supported. Using null as parameter works fine.</p>
<p><strong>Set: Sony Ericsson W850i</strong></p>
<p>1. Problem: Got black screen while capturing more than one time(in canvas).</p>
<p>Solution: Probably caused by paint overwrite problem in this device. Used form display to show camera and it solved the problem.</p>
<p>2. Locator string for capturing is &#8220;capture://audio_video&#8221; for capturing image and video</p>
<p>3. &#8220;png&#8221; encoding in getSnapShot() method is not supported. Also custom height, width parameter does not work. Using null as parameter works fine.</p>
<p>4. Video rotates 90 degree counter clockwise after capturing: yet to find a solution.</p>
<p>Note:</p>
<p>1. null in the getSnapShot() method means default parameter of the set which is &#8220;encoding=png&#8221; and &#8220;dimension=480&#215;640&#8243; in case of SE 850i</p>
<p>2. In Other sets of Nokia N series(95,93,90,82,76,73,70) the locator string &#8220;capture://video&#8221; works fine; also png encoding and custom dimensions works fine.</p>
<p>Here is some important system properties to check while working with MMAPI:</p>
<ul>
<li> &#8220;microedition.amms.version&#8221;</li>
<li> &#8220;microedition.media.version&#8221;</li>
<li> &#8220;supports.mixing&#8221;</li>
<li> &#8220;supports.audio.capture&#8221;</li>
<li> &#8220;supports.video.capture&#8221;</li>
<li> &#8220;supports.recording&#8221;</li>
<li> &#8220;audio.encodings&#8221;</li>
<li> &#8220;video.encodings&#8221;</li>
<li> &#8220;video.snapshot.encodings&#8221;</li>
<li> &#8220;streamable.contents&#8221;</li>
</ul>
<div>The value of these properties can be found calling System.getProperty() method.</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=25&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/07/17/mmapi-workarounds-in-different-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Encoding URL in j2me</title>
		<link>http://sihantech.wordpress.com/2008/07/16/encoding-url-in-j2me/</link>
		<comments>http://sihantech.wordpress.com/2008/07/16/encoding-url-in-j2me/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 13:20:30 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[J2me]]></category>
		<category><![CDATA[client server programming]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=17</guid>
		<description><![CDATA[In j2se we can use built-in URLEncoder for encoding urls. But j2me has no built-in URLEncoder support. We need to implement our own method to encode url. Here is a sample code for such an URLEncoder: public class URLEncoder { public static String encode(String s, String enc) throws IOException { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DataOutputStream dOut [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=17&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In j2se we can use built-in URLEncoder for encoding urls. But j2me has no built-in URLEncoder support. We need to implement our own method to encode url.</p>
<p>Here is a sample code for such an URLEncoder:<br />
<code><br />
public class URLEncoder {<br />
public static String encode(String s, String enc) throws IOException {<br />
ByteArrayOutputStream bOut = new ByteArrayOutputStream();<br />
DataOutputStream dOut = new DataOutputStream(bOut);<br />
StringBuffer ret = new StringBuffer(); //return value<br />
dOut.writeUTF(s);<br />
ByteArrayInputStream bIn = new ByteArrayInputStream(bOut.toByteArray());<br />
bIn.read();<br />
bIn.read();<br />
int c = bIn.read();<br />
while (c &gt;= 0) {<br />
if ((c &gt;= 'a' &amp;&amp; c &lt;= 'z') || (c &gt;= 'A' &amp;&amp; c &lt;= 'Z') || (c &gt;= '0' &amp;&amp; c &lt;= '9') || c == '.' || c == '-' || c == '*' || c == '_') {<br />
ret.append((char) c);<br />
} else if (c == ' ') {<br />
ret.append('+');<br />
} else {<br />
if (c &lt; 128 ) {<br />
appendHex(c, ret);<br />
} else if (c &lt; 224) {<br />
appendHex(c, ret);<br />
appendHex(bIn.read(), ret);<br />
} else if (c &lt; 240) {<br />
appendHex(c, ret);<br />
appendHex(bIn.read(), ret);<br />
appendHex(bIn.read(), ret);<br />
}<br />
}<br />
c = bIn.read();<br />
}<br />
return ret.toString();<br />
}<br />
private static void appendHex(int arg0, StringBuffer buff) {<br />
buff.append('%');<br />
if (arg0 &lt; 16) {<br />
buff.append('0');<br />
}<br />
buff.append(Integer.toHexString(arg0));<br />
}<br />
}<br />
</code><br />
Note:</p>
<p>Encode each parameter name and its value with the encoder not the whole URL.</p>
<p>Like, to encode the parameter &#8220;user name=j2me &amp; test|&#8221; use:</p>
<p>URLEncoder.encode(&#8220;user name&#8221;) as parameter and URLEncoder.encode(&#8220;j2me &amp; test|&#8221;) and thus build the whole query string.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=17&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/07/16/encoding-url-in-j2me/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Jad/Jar installing problem from server on Mobile device</title>
		<link>http://sihantech.wordpress.com/2008/07/16/jadjar-installing-problem-from-server-on-mobile-device/</link>
		<comments>http://sihantech.wordpress.com/2008/07/16/jadjar-installing-problem-from-server-on-mobile-device/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 10:17:03 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[J2ee]]></category>
		<category><![CDATA[J2me]]></category>
		<category><![CDATA[server configuration]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=13</guid>
		<description><![CDATA[I had to face a strange problem while downloading jad/jar from my server into mobile device. It was not installing by downloading from the server but I could install and run the same jad/jar transferring by bluetooth device. After some googling I came to know that the problem was in my server mime type settings for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=13&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had to face a strange problem while downloading jad/jar from my server into mobile device. It was not installing by downloading from the server but I could install and run the same jad/jar transferring by bluetooth device. After some googling I came to know that the problem was in my server mime type settings for .jad extension and I could solve this thing. I had no mime type defined in my server for the extension and mobile browser could not recognize the .jad file.</p>
<p>So, I added the following line in my Apache server&#8217;s &#8216;mime.types&#8217; configuaration file:</p>
<p>text/vnd.sun.j2me.app-descriptor                jad</p>
<p>And it worked like a charm.</p>
<p>For apache tomcat server it should be added in the &#8220;web.xml&#8221; file like this:</p>
<blockquote><p>  &lt;mime-mapping&gt;</p>
<p>        &lt;extension&gt;jad&lt;/extension&gt;</p>
<p>        &lt;mime-type&gt;text/vnd.sun.j2me.app-descriptor&lt;/mime-type&gt;</p>
<p>  &lt;/mime-mapping&gt;</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=13&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/07/16/jadjar-installing-problem-from-server-on-mobile-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
		<item>
		<title>Capturing website thumbnail</title>
		<link>http://sihantech.wordpress.com/2008/07/16/capturing-website-thumbnail/</link>
		<comments>http://sihantech.wordpress.com/2008/07/16/capturing-website-thumbnail/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 09:24:34 +0000</pubDate>
		<dc:creator>sihan</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[knowledge base]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://sihantech.wordpress.com/?p=9</guid>
		<description><![CDATA[Some months before I had to capture and show the thumbnail of website dynamically and I found an excellent tool named &#8216;IECapt&#8217;. It is a sourceforge project. &#8220;IECapt is a simple command line utility that uses the Internet Explorer rendering engine to render a web page into a GIF/JPEG/BMP/PNG image file&#8221; (Quoted from sourceforge.net).  It is a written [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=9&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some months before I had to capture and show the thumbnail of website dynamically and I found an excellent tool named &#8216;IECapt&#8217;. It is a <a href="http://sourceforge.net/" target="_blank">sourceforge</a> project.</p>
<p>&#8220;<em>IECapt is a simple command line utility that uses the Internet Explorer rendering engine to render a web page into a GIF/JPEG/BMP/PNG image file</em>&#8221; (Quoted from sourceforge.net). </p>
<p>It is a written in C++, licensed under GPL and runs in 32 Bit Windows XP/NT/2000. It can be found <a href="http://sourceforge.net/projects/iecapt/" target="_blank">here</a>.</p>
<p>Sample command:</p>
<p>From windows command line type the following command:</p>
<blockquote><p>IECapt.exe http://sihantech.wordpress.com thumb.png</p></blockquote>
<p>This will create an image &#8216;thumb.png&#8217; in local disk by capturing a screenshot of the given url.</p>
<p>Now we can execute this by PHP using exec() function or by java using Runtime.getRuntime().exec() method.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sihantech.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sihantech.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sihantech.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sihantech.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sihantech.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sihantech.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sihantech.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sihantech.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sihantech.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sihantech.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sihantech.wordpress.com&amp;blog=4212020&amp;post=9&amp;subd=sihantech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sihantech.wordpress.com/2008/07/16/capturing-website-thumbnail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6666c8dc8002e4cb22c0a131853ac1f?s=96&#38;d=monsterid" medium="image">
			<media:title type="html">sihan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
