<?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>neo&#039;s Weblog</title>
	<atom:link href="http://mebeingneo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mebeingneo.wordpress.com</link>
	<description>Just got to be lucky to read me.......</description>
	<lastBuildDate>Wed, 29 Jun 2011 03:44:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mebeingneo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>neo&#039;s Weblog</title>
		<link>http://mebeingneo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mebeingneo.wordpress.com/osd.xml" title="neo&#039;s Weblog" />
	<atom:link rel='hub' href='http://mebeingneo.wordpress.com/?pushpress=hub'/>
		<item>
		<title>EMMA code coverage of Android</title>
		<link>http://mebeingneo.wordpress.com/2011/05/19/emma-code-coverage-of-android-2/</link>
		<comments>http://mebeingneo.wordpress.com/2011/05/19/emma-code-coverage-of-android-2/#comments</comments>
		<pubDate>Thu, 19 May 2011 06:43:11 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[andoid]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[coverage]]></category>
		<category><![CDATA[Emma]]></category>
		<category><![CDATA[emma code coverage]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=58</guid>
		<description><![CDATA[Here are some basic steps How to get Emma code coverage of Android. Before doing these steps, you need to get full source code of Android After that, go to root folder of Android source code and do extractly this instruction below. A. Generating code coverage using runtest script  1. First, you need to add the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=58&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p id="post-body-1429184431070808351">Here are some basic steps How to get Emma code coverage of Android.</p>
<p>Before doing these steps, you need to get full source code of Android</p>
<p>After that, go to root folder of Android source code and do extractly this instruction below.</p>
<p><strong>A. Generating code coverage using runtest script </strong></p>
<p><strong>1. </strong>First, you need to add the target <em>system/framework/emma.jar</em> to the device&#8217;s boot classpath. So that, modify the BOOTCLASSPATH variable in <em>/system/core/rootdir/init.rc</em> .</p>
<div style="padding-left:30px;">a. Open <em>/system/core/rootdir/init.rc</em></div>
<div style="padding-left:30px;">b. The <em>system/framework/emma.jar<strong> </strong></em>entry needs to be added in the exact position shown below:</div>
<div style="padding-left:30px;">
<blockquote><p>export BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:</p>
<p><strong>/system/framework/emma.jar:</strong>/system/framework/framework.jar:</p>
<p>/system/framework/android.policy.jar:/system/framework/services.jar</p></blockquote>
<p>c. Save and close <em>init.rc</em> file</p>
</div>
<div><strong>2. </strong>Since EMMA will save the coverage result into SDCard, you need to ensure that the SDCard can be mounted properly. So that,</div>
<div style="padding-left:30px;">a. Open this file: <em>build/core/main.mk</em>b. Ensure that these lines have already added (around line number 212 to 219), if not, do it by yourself!</div>
<div>
<blockquote><p># Install a vold.conf file is one&#8217;s not already being installed.<br />
ifeq (,$(filter %:system/etc/vold.conf, $(PRODUCT_COPY_FILES)))<br />
PRODUCT_COPY_FILES += \<br />
development/data/etc/vold.conf:system/etc/vold.conf<br />
ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)<br />
$(warning implicitly installing vold.conf)<br />
endif<br />
endif</p></blockquote>
<div><strong>3.</strong> Build the bootimage to pick up the init.rc changes</div>
<blockquote><p>make bootimage</p></blockquote>
<p><strong>4.</strong> Build a full system image</p>
<blockquote><p>make -j4</p></blockquote>
<p><strong>5. </strong>Make EMMA</p>
<blockquote><p>export EMMA_INSTRUMENT=true</p>
<p>make emma</p></blockquote>
<p><strong>6. </strong>Start emulator</p>
<blockquote><p>[path_to_SDK_tools]/emulator -sdcard [path_to_your_sdcard]</p></blockquote>
<p><strong>7. </strong>Next, use the <em>runtest.py</em> script. Runtest will do all the necessary steps to instrument your test and target package, run the test, and generate the code coverage report.</p>
<blockquote><p>cd [path_to_android_source_code]</p>
<p>python development/testrunner/runtest.py &#8211;coverage [Test_package]</p></blockquote>
<p>[Test_package] can be: <em>apidemos, core, music, email&#8230;</em> (Leave this option null to see the list).</p>
<p><strong>8.</strong> After finish this script, the coverage report will be generated and saved into <em></em></p>
<p style="padding-left:30px;"><em>[path_to_Android_source_code]/out/emma/</em></p>
<p>folder. You can find a html report of EMMA code coverage for [Test_package] there.</p>
<p>=========================================================</p>
<p><strong>B. Generating code coverage for your own test </strong></p>
<p>If you want to running code coverage for your own test, please follow steps as described above, but skip step 6 to 8, continue with step 9 (after step 5) shown below:</p>
<p><strong>9. </strong>Setting the environment and additional bash commands. (like <em>m,mm,mmm, choosecombo</em>etc) Notice the space after the dot!</p>
<blockquote><p>. build/envsetup.sh</p></blockquote>
<p><strong>10.</strong> Set the ANDROID_PRODUCT_OUT directory for the emulator to know the image location</p>
<blockquote><p>export ANDROID_PRODUCT_OUT=[path_to_Android_source_code]/out/target/product/generic</p></blockquote>
<p>This step is important. The emulator will know where are the images it need to be synchronized with.</p>
<p><strong>11. </strong>Set EMMA_INSTRUMENTATION to true</p>
<blockquote><p>export EMMA_INSTRUMENT=true</p></blockquote>
<p><strong>12. </strong>Compile the Application would like to instrument</p>
<blockquote><p>mmm development/samples/[your_project]</p></blockquote>
<p>(You can use <em>apidemos</em> for example)</p>
<p>After run this step, new images can be generated and saved into ANDROID_PRODUCT_OUT (in step 10)</p>
<p><strong>13.</strong> Run emulator</p>
<blockquote><p>[path_to_SDK_tools]/emulator -sdcard [path_to_your_sdcard]</p></blockquote>
<p><strong>14. </strong>Remount the drive &#8211; it is needed to have a writable drive. without that sync wont work</p>
<blockquote><p>adb remount</p></blockquote>
<p><strong>15. </strong>Synchronize the local content (new images) with the emulator</p>
<blockquote><p>adb sync</p></blockquote>
<p><strong>16. </strong>Run instrumentation</p>
<blockquote><p>adb shell am instrument -w -e coverage true [source_code_of_test]</p></blockquote>
<p>Here is example for <em>apidemos</em></p>
<blockquote><p>adb shell am instrument -w -e coverage true com.example.android.apis.tests/android.test.InstrumentationTestRunner</p></blockquote>
<p>See <a href="http://developer.android.com/reference/android/test/InstrumentationTestRunner.html" target="_blank">this</a> for more details of InstrumentationTestRunner options.</p>
<p><strong>17. </strong>This command will dump a runtime coverage data file at <em>/sdcard/coverage.ec</em> on the device.</p>
<p>Extract it to local host</p>
<blockquote><p>adb pull /sdcard/coverage.ec coverage.ec</p></blockquote>
<p><strong>18. </strong>Now generate a coverage report. You&#8217;ll need to pass in the path to the coverage metadata generated at build time.</p>
<blockquote><p>java -cp external/emma/lib/emma.jar emma report -r html -in coverage.ec -sp [path_to_your_project_source_code] -in out/target/common/obj/APPS/[your_project]_intermediates/coverage.em</p></blockquote>
<p>Here is example for <em>apidemos</em>:</p>
<blockquote><p>java -cp external/emma/lib/emma.jar emma report -r html -in coverage.ec -sp development/samples/ApiDemos/src -in out/target/common/obj/APPS/ApiDemos_intermediates/coverage.em</p></blockquote>
<p><strong>19. </strong>Now, you will get the HTML report of EMMA code coverage for your own project.</p>
<p>Check it out!<br />
<img src="http://mebeingneo.files.wordpress.com/2011/05/emma-coverage-report.png?w=600" alt="Emma Code Coverage" /><br />
<strong>Notes:</strong> In the first time running instrumentation (step 7 or 16) the Android system may be crashed. But, don&#8217;t worry, it will automatically restart. Then, you can run the instrumentation again successfully!</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=58&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2011/05/19/emma-code-coverage-of-android-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>

		<media:content url="http://mebeingneo.files.wordpress.com/2011/05/emma-coverage-report.png" medium="image">
			<media:title type="html">Emma Code Coverage</media:title>
		</media:content>
	</item>
		<item>
		<title>Customize your CTS</title>
		<link>http://mebeingneo.wordpress.com/2011/05/12/customize-your-cts/</link>
		<comments>http://mebeingneo.wordpress.com/2011/05/12/customize-your-cts/#comments</comments>
		<pubDate>Thu, 12 May 2011 14:47:01 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[Compatibility]]></category>
		<category><![CDATA[CTS]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[Suite]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testcases]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=52</guid>
		<description><![CDATA[If we check Android source code, we can find some test packages within Android applications. We can either run these test packages in Android device or we can combine them with Android CTS. Here is an example from Music application. I will create a test plan MusicTests and test package MusicTestCases in CTS. First of all, add test package [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=52&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If we check Android source code, we can find some test packages within Android applications. We can either run these test packages in Android device or we can combine them with Android CTS. Here is an example from Music application. I will create a test plan MusicTests and test package MusicTestCases in CTS.</p>
<p>First of all, add test package source code to cts folder</p>
<pre>$ cp -a $ANDROOT/packages/apps/Music/tests $ANDROOT/cts/tests/tests/MusicTests</pre>
<p>Modify test package name in Android.mk to avoid redundant name</p>
<pre>$ cat $ANDROOT/cts/tests/tests/MusicTests/Android.mk

LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)

# We only want this apk build for tests.LOCAL_MODULE_TAGS := tests

LOCAL_JAVA_LIBRARIES := android.test.runner

# Include all test java files.LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := MusicTestsCases

LOCAL_INSTRUMENTATION_FOR := Music

include $(BUILD_PACKAGE)</pre>
<p>Add one test case to CTS_TEST_CASE_LIST in cts/CtsTestCaseList.mk</p>
<p>Add test plan ‘MusicTests’ in cts/tools/utils/buildCts.py</p>
<pre>def GenerateTestPlans(self):</pre>
<pre style="padding-left:30px;">.....</pre>
<pre style="padding-left:30px;">plan = tools.TestPlan(packages)</pre>
<pre style="padding-left:30px;">plan.Include(r'android.MusicTests')</pre>
<pre style="padding-left:30px;">self.__WritePlan(plan, 'MusicTests')</pre>
<p>Make sure that the Folder name &#8220;MusicTests&#8221; matches with the latter part of &#8216;android.<strong>MusicTests</strong>&#8216;. Otherwise while running the Testplan you would encounter errors such as &#8220;No valid packages found in test plan&#8221;.</p>
<p>Then to build CTS, perform:</p>
<pre>$ cd &lt;Android Root&gt;
$ . build/envsetup.sh
$ make cts</pre>
<p>CTS binaries will be created within &#8220;out/host/linux-x86/cts/&#8221; folder with a file named &#8220;android-cts.zip&#8221;</p>
<p>Copy this zip file to another location suitable for you.</p>
<p>Extract the files.</p>
<p>You will find a file named &#8220;startcts.sh&#8221; within the folder &#8220;android-cts/tools/&#8221;.</p>
<p>Edit this file to set SDK_ROOT variable from &#8220;NOT_CONFIGURED&#8221; to the root of your Android SDK installation path.</p>
<p>Then to run CTS, perform:</p>
<pre>$ cd &lt;path to android-cts/tools/&gt;
$ ./startcts
cts_host &gt; start --plan MusicTests
start test plan MusicTests
==============================================================
Test package: android.MusicTests
com.android.music.tests.stress.AlbumsPlaybackStress#testAlbumPlay…..(pass)
com.android.music.tests.stress.AlbumsPlaybackStress#testActivityTestCaseSetUpProperly….(pass)
com.android.music.tests.stress.MusicPlaybackStress#testPlayAllSongs….(pass)
com.android.music.tests.stress.MusicPlaybackStress#testActivityTestCaseSetUpProperly….(pass)
com.android.music.tests.functional.TestPlaylist#testDeletePlaylist….(pass)
com.android.music.tests.functional.TestPlaylist#testRenamePlaylist….(pass)
com.android.music.tests.functional.TestPlaylist#testActivityTestCaseSetUpProperly….(pass)
com.android.music.tests.functional.TestSongs#testAddPlaylist…..(pass)
com.android.music.tests.functional.TestSongs#testSetRingtone…..(pass)
com.android.music.tests.functional.TestSongs#testDeleteSong…..(pass)
com.android.music.tests.functional.TestSongs#testActivityTestCaseSetUpProperly….(pass)
com.android.music.tests.MusicPlayerStability#testPlay30sMP3….(pass)
com.android.music.tests.MusicPlayerStability#testLaunchMusicPlayer….(pass)
==============================================================
Test summary: pass=13 fail=0 timeOut=0 notExecuted=0 Total=13
Time: 150.780s</pre>
<p>Reports will be generated within the &#8220;android-cts/repository/results/&#8221; folder</p>
<p>You&#8217;re Done !!!! Cheers&#8230; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=52&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2011/05/12/customize-your-cts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Android: Supporting the new music Voice Action</title>
		<link>http://mebeingneo.wordpress.com/2010/09/16/android-supporting-the-new-music-voice-action/</link>
		<comments>http://mebeingneo.wordpress.com/2010/09/16/android-supporting-the-new-music-voice-action/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 13:51:59 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[intent]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[Voice]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=38</guid>
		<description><![CDATA[We recently launched Voice Actions in the new Google Voice Search for Android — an awesome new way to search, control, and communicate on your phone faster than ever before, by using your voice. One of these new Voice Actions lets users find and automatically play music. By speaking something like “listen to They Might [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=38&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We recently launched Voice Actions in the new Google Voice Search for Android — an awesome new way to search, control, and communicate on your phone faster than ever before, by using your voice.</p>
<p>One of these new Voice Actions lets users find and automatically play music. By speaking something like “listen to They Might Be Giants” into the new Voice Search, users can quickly find the music they want online and play it, using any number of different apps. (Pandora, Last.fm, Spotify, mSpot, and Rdio are among the first apps to support this.)</p>
<p>To do this, we leveraged a very common little piece of Android magic: a new Intent. If you develop a music app that supports open-ended music search, you can make it work with users speaking “listen to” Voice Actions simply by registering for the new intent we’ve defined. This new intent isn’t defined as a constant in the SDK yet, but we wanted to make sure music app developers had all the information needed to use it right away.</p>
<p>Here’s all you should need to know:</p>
<p>In your AndroidManifest.xml, just register one of your activities for the new intent android.media.action.MEDIA_PLAY_FROM_SEARCH:</p>
<p><code><br />
&lt;application android:label="@string/app_name" android:icon="@drawable/icon"&gt;<br />
&lt;activity android:name="MusicActivity" android:label="@string/app_name"&gt;<br />
&lt;intent-filter&gt;<br />
&lt;action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" /&gt;<br />
&lt;category android:name="android.intent.category.DEFAULT" /&gt;<br />
&lt;/intent-filter&gt;<br />
&lt;/activity&gt;<br />
&lt;/application&gt;</code></p>
<p><code> </code></p>
<p>When your activity receives this intent, you can find the user’s search query inside the SearchManager.QUERY string extra:<br />
<code>import android.app.Activity;<br />
import android.app.SearchManager;</code></p>
<p><code> </code></p>
<p><code>public class MusicActivity extends Activity {<br />
@Override<br />
public void onCreate(Bundle savedInstanceState) {<br />
super.onCreate(savedInstanceState);<br />
String query = getIntent().getStringExtra(SearchManager.QUERY);<br />
// Do something with query...<br />
}<br />
}</code></p>
<p>This will represent everything the user spoke after “listen to”. This is totally open-ended voice recognition, and it expects very flexible search — so, for example, the string could be the name of any artist (“they might be giants”), an album (“factory showroom”), a song (“metal detector”), or a combination of any of these (“metal detector by they might be giants”).<br />
A few subtle details worth understanding about this intent:</p>
<p>Your app should do its best to quickly find and automatically play music corresponding to the user’s search query. The intention here is to get users to their desired result as fast as possible, and in this case, that means playing music quickly.<br />
This will really only work well for music apps that can find music across a very large corpus of options. Because our voice recognition doesn’t currently support any way to provide a list of specific songs to be recognized, trying to use it against a small set of music choices will work poorly — things which are not in the set will be over-recognized, and things which are in the set may not be recognized well. So if you’re not the developer of a large-scale cloud music application, this intent is probably not for you.<br />
We think you’ll find this new intent can greatly enhance your music app’s experience for users. And we hope you enjoy our new Voice Actions as much as we do!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=38&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2010/09/16/android-supporting-the-new-music-voice-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Track EditText data&#8230;.</title>
		<link>http://mebeingneo.wordpress.com/2010/01/28/track-edittext-data/</link>
		<comments>http://mebeingneo.wordpress.com/2010/01/28/track-edittext-data/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 13:21:14 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[EditText]]></category>
		<category><![CDATA[getvalue]]></category>
		<category><![CDATA[onSaveInstanceState]]></category>
		<category><![CDATA[onTextChanged]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[TextWatcher]]></category>
		<category><![CDATA[udpate]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=33</guid>
		<description><![CDATA[I came across a strange behavior of EditText while using it in one of the apps i develop. On Changing the orientation, if i try to perform getText() or try to get the length or size of the string inside the Edit text, i would get zero. After many iterations, i got a solution for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=33&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I came across a strange behavior of EditText while using it in one of the apps i develop. On Changing the orientation, if i try to perform getText() or try to get the length or size of the string inside the Edit text, i would get zero. After many iterations, i got a solution for this&#8230;.<br />
Save Edit text data before the orientation changes&#8230; I did this using onSaveInstanceState(). Save data in this call and Since this call is called before finishing the activity you&#8217;ll be sure of your data will be saved. Then Retrieve this data in onCreate() call which is called while the activity gets re-initialized while Orientation change.</p>
<blockquote><p>@Override<br />
protected void onSaveInstanceState(Bundle outState) {<br />
super.onSaveInstanceState(outState);<br />
try {<br />
Settings.System.putString(getContentResolver(), YOUR_KEY, YOUR_VALUE);<br />
} catch(Exception e) {<br />
//DO Nothing<br />
}<br />
}</p></blockquote>
<p>Retrieve this value in onCreate by,</p>
<blockquote><p>try {<br />
String value = Settings.System.getString(getContentResolver(), YOUR_KEY);<br />
if(value != null) {<br />
mEditText.setText(value);<br />
Settings.System.putString(getContentResolver(), YOUR_KEY,null);<br />
}<br />
} catch(NullPointerException npe) {<br />
Log.d(TAG, &#8220;npe&#8221;);<br />
}</p></blockquote>
<p>along with this if you want to trace the text change in EditText, following is the solution for that&#8230;</p>
<blockquote><p>private void setTextWatcherforValue() {<br />
txtWtchr = new TextWatcher() {</p>
<p>public void onTextChanged(CharSequence s, int start, int before, int count) {<br />
String value = mEditText.getText().toString();<br />
if(value.length() &gt; 0) {<br />
// Do your Stuff<br />
} else if(value.length() &lt;= 0) {<br />
//Do your stuff<br />
} else if(value.equals(null)) {<br />
Log.d(TAG, &#8220;value length is zero&#8221;);<br />
}<br />
}</p>
<p>public void beforeTextChanged(CharSequence s, int start, int count,<br />
int after) {<br />
}</p>
<p>public void afterTextChanged(Editable s) {<br />
}<br />
};<br />
}</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=33&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2010/01/28/track-edittext-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Sound Solutions for Ubuntu 9.04 (Jaunty) Users</title>
		<link>http://mebeingneo.wordpress.com/2009/12/30/sound-solutions-for-ubuntu-9-04-jaunty-users/</link>
		<comments>http://mebeingneo.wordpress.com/2009/12/30/sound-solutions-for-ubuntu-9-04-jaunty-users/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 13:38:30 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[audio problem]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[UBUNTU]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=29</guid>
		<description><![CDATA[The sound scheme in Jaunty has some important changes that you need to be aware of. Alsa 1.0.18 and Pulseaudio 0.9.14 are implemented in Jaunty. The new ALSA provides more support and greater functionality for more sound devices than previous versions. Pulseaudio 0.9.14 does some of the same on the sound server side. The first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=29&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The sound scheme in Jaunty has some important changes that you need to be aware of. Alsa 1.0.18 and Pulseaudio 0.9.14 are implemented in Jaunty. The new ALSA provides more support and greater functionality for more sound devices than previous versions. Pulseaudio 0.9.14 does some of the same on the sound server side.</p>
<p>The first thing you should check is the volume control on the panel. It has a new Sound Theme tab. You can set the theme for your system sounds there. If you wish to disable system sounds set Sound Theme: No Sounds.</p>
<p>Next, check out System/Preferences/Sound. It has only two tabs, Devices and Sounds. The Devices tab is where you choose the device to play your sounds. We will return to this later. In the Sounds tab there are numerous sound preferences that can be set for everything from button clicks to email alerts. You can change the default sound or disable it by double clicking on Default.</p>
<p><strong>Necessary Packages</strong></p>
<p>As with Hardy and Intrepid, some important packages necessary for optimal sound set up are missing. Open System/Adminstration/Synaptic package manager and search pulse. This is the easiest way to find and install all the packages we need. Select the following packages</p>
<p>padevchooser -this will pull in all the pulseaudio guis and their dependencies</p>
<p>if you plan on using vlc or xmms2 or 32 bit or libao apps etc, you can get those packages now too. If you are not constrained on diskspace it is a good idea to get all of the following</p>
<p>vlc-plugin-pulse -this also pulls in a lot of libs that vlc will need</p>
<p>xmms2-plugin-pulse -this also pulls in the xmms2 core</p>
<p>pulseaudio-module-lirc &#8211; this is to use lirc and your infrared remote with pulse</p>
<p>libsdl1.2debian-all &#8211; this will replace the alsa version with all available drivers</p>
<p>lib32asound2-plugins &#8211; this is the 32 bit plugins for 32 bit apps</p>
<p>libao2 &#8211; you need this for apps using the libao cross platform library</p>
<p>asoundconf-gtk &#8211; applet for default alsa sound card</p>
<p>audacious-plugins-extra &#8211; plugins for audacious for many codecs like mp3, aac, FLAC, WMA, etc</p>
<p>The gnome-volume-control-pulse is somewhat broken so I do not recommend installing or using it yet.</p>
<p>Search alsa and select the following</p>
<p>gnome-alsamixer &#8211; this mixer is far easier to use than the alsamixer</p>
<p>alsa-oss &#8211; this is the alsa wrapper for oss apps</p>
<p>Click apply and the packages will download and install themselves</p>
<p>Also select the following</p>
<p>ubuntu-restricted-extras</p>
<p>Click apply. This download may take a while, the ubuntu-restricted-extras package is quite large but installs almost all the codecs and java and flash 10.0.22.87 and a bunch of other stuff that you will be needing. It also updates the gstreamer packages and some other stuff.</p>
<p>A window will pop up during the installation asking you to agree to the sun-java6-jre license terms, click the little box and then Forward.</p>
<p>In System/Adminstration/Users and Groups check that your users and root are members of the following groups<br />
<code><br />
pulse<br />
pulse-access<br />
pulse-rt<br />
</code><br />
Reboot your system</p>
<p><strong>Setup</strong></p>
<p>System/Preferences/Sound, change everything to PulseAudio Sound Server except Default Mixer tracks which you should change to you hardware playback device like Playback: HDA ATI SB ALC888 Analog….. or something like that. Default Mixer tracks is where you set what your multimedia keys control.</p>
<p>Click Applications/Sound and Video/PulseAudio Device Chooser.(padevchooser) The icon should appear in the panel. Click on it, choose Preferences/Start Applet on session login so it stays in your panel when you reboot. Choose it again, click Volume Control.</p>
<p>In Playback you will notice System Sounds. You can set the volume of your system sounds here or mute them with the mute button. In the Output Devices tab you will see your sound device(s). if you right click on the volume bars you can make it the default. if you have already opened and application and it plays on another device this will have no effect and you will need to move the stream manually next time you open it.</p>
<p>Lets’ play something. Start Rythmbox and play one of the radio stations. Rythmbox should show up in the Playback tab with the volume bar moving with the sound. Click Output Devices, you should see the same thing in your output device. You can adjust the volume or mute the individual stream in Playback or the entire device in Output Devices</p>
<p>If you have more than one device and rythmbox is playing in the wrong one go back to the playback tab, right click on the volume bars and choose move stream to move it to the correct device. You can also go back to the padevchooser and open Configure Local Sound Server/Simultaneous Output and check to box. That will create a new Simultaneous output…. Virtual Stream in Output Devices. You can move any playing stream to the new device and have sound everywhere all at once.</p>
<p>Lets check if we can record. Leave rythmbox playing.</p>
<p>Open Applications/Sound and Video/Sound Recorder. Click the record button. In the PA volume control recording tab you should now see</p>
<p>gnome-sound-recorder: Record Stream.</p>
<p>right click on the volume bar and choose move stream and move it to the monitor of the output device you are using. Click stop in sound recorder and then record. Sound recorder should now be recording from rythmbox. Click stop. Change to the playback tab in the pavolume control. click the speaker on the rythmbox stream to mute it. click play on sound recorder. You should now see stream recorder in playback and hear what you just recorded.</p>
<p>Let’s try recording from the microphone. Go back to the recording tab. click record on stream recorder and move the stream to the device instead of the monitor. Click stop. Click record again and make some noise into the microphone. You should see the volume bars move. Congratulations, you are now a recording genius.</p>
<p>You can make a device or monitor the default for new applications by right clicking on it like with playback.</p>
<p>If your microphone does not seem to be working Open the Volume Control from your panel ( the little speaker icon) and check that it is set to the proper device (your hardware). Click Preferences and make sure that the boxes for Microphone Capture and Mic Boost Capture are checked, close the box. In the Volume Control/ Switches check the Mic Boost Capture box. In /Recording make sure the Microphone is not muted (no red x on the mic icon) and turned up. (Some devices do not have a mic boost option)</p>
<p>Try recording again. If it still does not work check for any other mic switches or controls and play around with them.</p>
<p>Remember, it is the capture/recording settings that are important for recording. Playback settings get your mic to your speakers.</p>
<p>If you are still having problems with your mic it is most likely a problem with the alsa driver. This is a very common issue for laptop users and fixes are very hardware specific. You should search the forums or google for your specific make and model of machine for a solution.</p>
<p>Now you know how to use all the basic tools. There will be some updates along shortly so if your sound stops working after an update, check the basics, like the volume controls and switches and stream locations first before taking any more drastic steps.</p>
<p><strong>Some more tips</strong></p>
<p>1) If you have problem with sound in flash install the following packages</p>
<blockquote><p>sudo apt-get install libgstreamer-plugins-base0.10-dev</p></blockquote>
<p>2) If you have HP 6730s and was only getting sound from the headphone jack, not the internal speakers use the following solutions</p>
<p>edit the /etc/modprobe.d/alsa-base file</p>
<blockquote><p>sudo gedit /etc/modprobe.d/alsa-base</p></blockquote>
<p>add the following line</p>
<blockquote><p>options snd-hda-intel model=laptop enable=1 index=0</p></blockquote>
<p>Save abd exit the file.</p>
<p>If you want more sound solutions check <a href="http://www.ubuntugeek.com/simple-guide-to-sound-solutions-for-hardyintrepid-and-jaunty-jackalope-users.html" target="_blank">here</a> and if you want to remove pulse audio try <a href="http://www.ubuntugeek.com/how-to-remove-pulse-audio-ubuntu-810-intrepid-ibex.html" target="_blank">this</a>.</p>
<p>Article Credit goes <a href="http://ubuntuforums.org/showthread.php?t=1130384" target="_blank">here </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=29&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2009/12/30/sound-solutions-for-ubuntu-9-04-jaunty-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Hashtable Vs Hashmap, Vector Vs ArrayList</title>
		<link>http://mebeingneo.wordpress.com/2009/11/11/hashtable-vs-hashmap-vector-vs-arraylist/</link>
		<comments>http://mebeingneo.wordpress.com/2009/11/11/hashtable-vs-hashmap-vector-vs-arraylist/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:21:12 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=24</guid>
		<description><![CDATA[A Map is a class that stores key-value pairs and provides a way to locate a value based on the key. The Hashtable class is a synchronized implementation of the Map interface. The HashMap is better in terms performance because the hashing algorithm it uses. The Hashtable is synchronized so performance is slightly worse. As [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=24&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A Map is a class that stores key-value pairs and provides a way to locate a value based on the key.  The Hashtable class is a synchronized implementation of the Map interface.  The HashMap is better in terms performance because the hashing algorithm it uses. The Hashtable is synchronized so performance is slightly worse.</p>
<p>As to the difference between a Vector and an ArrayList:</p>
<p>I. Synchronization</p>
<p>Vectors are synchronized. Any method that touches the Vector&#8217;s contents is thread safe. ArrayList, on the other hand, is unsynchronized, making them, therefore, not thread safe. With that difference in mind, using synchronization will incur a performance hit. So if you don&#8217;t need a thread-safe collection, use the ArrayList. Why pay the price of synchronization unnecessarily?</p>
<p>II. Data growth</p>
<p>Internally, both the ArrayList and Vector hold onto their contents using an Array. You need to keep this fact in mind while using either in your programs. When you insert an element into an ArrayList or a Vector, the object will need to expand its internal array if it runs out of room. A Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent. Depending on how you use these classes, you could end up taking a large performance hit while adding new elements. It&#8217;s always best to set the object&#8217;s initial capacity to the largest capacity that your program will need. By carefully setting the capacity, you can avoid paying the penalty needed to resize the internal array later. If you don&#8217;t know how much data you&#8217;ll have, but you do know the rate at which it grows, Vector does possess a slight advantage since you can set the increment value.</p>
<p>III. Usage patterns</p>
<p>Both the ArrayList and Vector are good for retrieving elements from a specific position in the container or for adding and removing elements from the end of the container. All of these operations can be performed in constant time &#8212; O(1). However, adding and removing elements from any other position proves more expensive &#8212; linear to be exact: O(n-i), where n is the number of elements and i is the index of the element added or removed. These operations are more expensive because you have to shift all elements at index i and higher over by one element. So what does this all mean? It means that if you want to index elements or add and remove elements at the end of the array, use either a Vector or an ArrayList. If you want to do anything else to the contents, go find yourself another container class. For example, the LinkedList can add or remove an element at any position in constant time &#8212; O(1). However, indexing an element is a bit slower &#8212; O(i) where i is the index of the element. Traversing an ArrayList is also easier since you can simply use an index instead of having to create an iterator. The LinkedList also creates an internal object for each element inserted. So you have to be aware of the extra garbage being created.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=24&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2009/11/11/hashtable-vs-hashmap-vector-vs-arraylist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Steps to build Donut sdk for Eclipse</title>
		<link>http://mebeingneo.wordpress.com/2009/11/06/steps-to-build-donut-sdk-for-eclipse/</link>
		<comments>http://mebeingneo.wordpress.com/2009/11/06/steps-to-build-donut-sdk-for-eclipse/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 05:36:43 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=21</guid>
		<description><![CDATA[With Donut source code, additional steps (steps 2 &#38; 3 as shown below) are needed to build SDK if it is to be used with Eclipse: 1)    cd &#60;donut_src&#62; 2)    . build/envsetup.sh         #(note the leading dot) 3)    lunch sdk-eng 4)    make sdk<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=21&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Donut source code, additional steps (steps 2 &amp; 3 as shown below) are needed to build SDK if it is to be used with Eclipse:</p>
<blockquote><p>1)    cd &lt;donut_src&gt;<br />
2)    . build/envsetup.sh         #(note the leading dot)<br />
3)    lunch sdk-eng<br />
4)    make sdk</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=21&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2009/11/06/steps-to-build-donut-sdk-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Resolve OutOfMemory with Eclipse when source base is huge</title>
		<link>http://mebeingneo.wordpress.com/2009/09/24/resolve-outofmemory-with-eclipse/</link>
		<comments>http://mebeingneo.wordpress.com/2009/09/24/resolve-outofmemory-with-eclipse/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 11:58:39 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=12</guid>
		<description><![CDATA[When the source base is large enough that Eclipse&#8217;s Java VM sometimes runs out of memory while compiling it. Avoid this problem by editing the the eclipse.ini file. On Apple OSX the eclipse.ini file is located at /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini Memory-related defaults (as of Eclipse 3.4) -Xms40m -Xmx256m -XX:MaxPermSize=256m Recommended settings for such development -Xms128m -Xmx512m -XX:MaxPermSize=256m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=12&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When the source base is large enough that Eclipse&#8217;s Java VM sometimes runs out of memory while compiling it. Avoid this problem by editing the the <code>eclipse.ini</code> file. On Apple OSX the <code>eclipse.ini</code> file is located at <code>/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini</code></p>
<p>Memory-related defaults (as of Eclipse 3.4)</p>
<pre style="margin-left:40px;">-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
</pre>
<p>Recommended settings for such development</p>
<pre style="margin-left:40px;">-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
</pre>
<p>These settings set Eclipse&#8217;s minimum Java heap size to 128MB, set the maximum Java heap size to 512MB, and keep the maximum permanent generation size at the default of 256MB.</p>
<p>Now start Eclipse:</p>
<pre style="margin-left:40px;">eclipse  # from terminal, or you can start from the eclipse location
</pre>
<p>Now create a project :</p>
<ol>
<li> If Eclipse asks you for a workspace location, choose the default.</li>
<li> If you have a &#8220;Welcome&#8221; screen, close it to reveal the Java perspective.</li>
<li> File &gt; New &gt; Java Project</li>
<li> Pick a project name anything you like.</li>
<li> Select &#8220;Create project from existing source&#8221;, enter the path to       your source root directory, and click Finish.</li>
<li> Wait while it sets up the project.  (You&#8217;ll see a subtle progress meter      in the lower right corner.)</li>
</ol>
<p>Once the project workspace is created, Eclipse should start building. In theory, it should build with no errors and you should be set to go.  If  necessary, uncheck and re-check Project &gt; Build Automatically to force a  rebuild.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=12&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2009/09/24/resolve-outofmemory-with-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
		<item>
		<title>Working with JNI- Java Native Interface in Ubuntu</title>
		<link>http://mebeingneo.wordpress.com/2009/08/10/working-with-jni-java-native-interface-in-ubuntu/</link>
		<comments>http://mebeingneo.wordpress.com/2009/08/10/working-with-jni-java-native-interface-in-ubuntu/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 09:56:06 +0000</pubDate>
		<dc:creator>Vishwanath Kamath</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[javac]]></category>
		<category><![CDATA[javah]]></category>
		<category><![CDATA[JNI]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[UBUNTU]]></category>

		<guid isPermaLink="false">http://mebeingneo.wordpress.com/?p=3</guid>
		<description><![CDATA[To work with JNI we need certain essential tools. They are: A Java Compiler “javac” which ships with the SDK A Java Virtual Machine “java” which ships with the SDK A native method c header file generator “javah” which ships with the SDK. A C/C++ compiler “cc” that can create shared library. Essential steps to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=3&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">To work with JNI we need certain essential tools. They are:</p>
<ol style="text-align:justify;">
<li> A Java Compiler “javac” which ships with the SDK</li>
<li> A Java Virtual Machine “java” which ships with the SDK</li>
<li> A native method c header file generator “javah” which ships with the SDK.</li>
<li> A C/C++ compiler “cc” that can create shared library.</li>
</ol>
<p style="text-align:justify;">Essential steps to be followed to call C/C++ from the java code</p>
<h3 style="text-align:justify;"><strong>1. Write a java code. (Example as mentioned below) (filename:JNIDemo.java)</strong></h3>
<pre style="margin-left:40px;">public class JNIDemo
{
public native void display();
static
{
System.loadLibrary("JNIDemo");
}
public static void main(String args[])
{
try
{
JNIDemo jdo = new JNIDemo();
jdo.display();
}catch(Exception e)
{
System.out.println("Alert Alert Alert: " + e.getMessage());
}
}
}</pre>
<h3 style="text-align:justify;">2. Compile the java code. (Change the current folder to point to Source folder using Chage directory command in terminal window)  (compilation as mentioned below)</h3>
<pre style="margin-left:40px;">javac JNIDemo.java</pre>
<p style="text-align:justify;">This will create a JNIDemo.Class file in the same folder level as of JNIDemo.java file.</p>
<p style="text-align:justify;">
<h3 style="text-align:justify;">3.Create C/C++ header file. (Compilation as mentioned below)</h3>
<p style="text-align:justify;">(Use the Java class file name without the “.class” extention. It would look as below in 	terminal)</p>
<pre style="margin-left:40px;">javah JNIDemo</pre>
<p style="text-align:justify;">This would create a C/C++ header file with the native function signatures that we want to 	call.</p>
<p style="text-align:justify;">The JNIDemo.h file would look as below.</p>
<pre style="margin-left:40px;">/* DO NOT EDIT THIS FILE - it is machine generated */
#include
/* Header for class JNIDemo */

#ifndef _Included_JNIDemo
#define _Included_JNIDemo
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class:     JNIDemo
* Method:    display
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_JNIDemo_display (JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif</pre>
<p style="text-align:justify;">
<h3 style="text-align:justify;">4.Write a C/C++ source code with the implementation. (Implementation example as mentioned below)(filename:JNIDemo.c)</h3>
<pre style="margin-left:40px;">#include "JNIDemo.h"
JNIEXPORT void JNICALL Java_JNIDemo_display(JNIEnv *env, jobject obj)
{
char name[30];
printf("What is your name?\n");
scanf("%s",name);
printf("Hello %s, you are running JNIDemo\n", name);
}
int main()
{
return  0;
}
</pre>
<p style="text-align:justify;">
<h3 style="text-align:justify;">5.Create a shared library file using the C/C++ file created using terminal.</h3>
<pre style="margin-left:40px;">cc -o libJNIDemo.so -shared -I/JDK/include -I/JDK/include/linux JNIDemo.c</pre>
<p style="text-align:justify;">libJNIDemo.so &#8211;&gt; This could be considered as the shared library file name you need/want 	to create. Template of the same could be considered as .so</p>
<p style="text-align:justify;">/JDK &#8211;&gt; This represents the JDK installation path</p>
<p style="text-align:justify;">
<h3 style="text-align:justify;">6.Check the LD_LIBRARY_PATH using the command:</h3>
<pre style="margin-left:40px;">echo $LD_LIBRARY_PATH</pre>
<p style="text-align:justify;">In Ubuntu, this path is not set to any location. Hence this would return empty.</p>
<p style="text-align:justify;">Set LD_LIBRARY_PATH to the shared library created by you (libJNIDemo.so) using the 	command</p>
<pre style="margin-left:40px;">export LD_LIBRARY_PATH='[Folder path of the shared library file]'</pre>
<p style="text-align:justify;">
<h3 style="text-align:justify;">7.Run the java program .</h3>
<pre style="margin-left:40px;">java JNIDemo</pre>
<p style="text-align:justify;">Output would be:<br />
<code>What is your name?<br />
neo<br />
Hello neo, you are running JNIDemo</code><span id="more-3"></span><!--more--></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mebeingneo.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mebeingneo.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mebeingneo.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mebeingneo.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mebeingneo.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mebeingneo.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mebeingneo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mebeingneo.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mebeingneo.wordpress.com&amp;blog=4831627&amp;post=3&amp;subd=mebeingneo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mebeingneo.wordpress.com/2009/08/10/working-with-jni-java-native-interface-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c27403f45d563830a205f9cfc6520fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mebeingneo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
