<?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>Katharnavas Tech Blog</title>
	<atom:link href="http://katharnavas.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://katharnavas.wordpress.com</link>
	<description>A Guide to Mobile and Web Technology(LAMP)</description>
	<lastBuildDate>Wed, 25 Jan 2012 06:57:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='katharnavas.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5c4c6a4af12ba7de883a06eb2e3e0924?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Katharnavas Tech Blog</title>
		<link>http://katharnavas.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://katharnavas.wordpress.com/osd.xml" title="Katharnavas Tech Blog" />
	<atom:link rel='hub' href='http://katharnavas.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Listening for outgoing sms or send sms in Android</title>
		<link>http://katharnavas.wordpress.com/2012/01/18/listening-for-outgoing-sms-or-send-sms-in-android/</link>
		<comments>http://katharnavas.wordpress.com/2012/01/18/listening-for-outgoing-sms-or-send-sms-in-android/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 13:48:48 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[content observer]]></category>
		<category><![CDATA[handler]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[observer]]></category>
		<category><![CDATA[outgoing]]></category>
		<category><![CDATA[send sms]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=146</guid>
		<description><![CDATA[The following code shows how to register and event and observe changes made to the sms folder for send sms. Most of the people states that the code may not work in future versions. Currently it works pretty with 2.1 and 2.2 and 2.3 To register the content observer the following code lines are essential<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=146&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code shows how to register and event and observe changes made to the sms folder for send sms.<br />
Most of the people states that the code may not work in future versions. Currently it works pretty with 2.1 and 2.2 and 2.3</p>
<p><pre class="brush: java;">
public class SmsObserver extends ContentObserver {
	
    private Context mContext;
    
    private String contactId = &quot;&quot;, contactName = &quot;&quot;;
    private String smsBodyStr = &quot;&quot;, phoneNoStr = &quot;&quot;;
    private long smsDatTime = System.currentTimeMillis();
    static final Uri SMS_STATUS_URI = Uri.parse(&quot;content://sms&quot;);
    
	public SmsObserver(Handler handler, Context ctx) {
		super(handler);
		mContext = ctx;
	}

	public boolean deliverSelfNotifications() {
		return true;
	}

	public void onChange(boolean selfChange) {
		try{
			Log.e(&quot;Info&quot;,&quot;Notification on SMS observer&quot;);
			Cursor sms_sent_cursor = mContext.getContentResolver().query(SMS_STATUS_URI, null, null, null, null);
			if (sms_sent_cursor != null) {
				if (sms_sent_cursor.moveToFirst()) {
					String protocol = sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;protocol&quot;));
					Log.e(&quot;Info&quot;,&quot;protocol : &quot; + protocol);
					//for send  protocol is null
					if(protocol == null){
						/*
						String[] colNames = sms_sent_cursor.getColumnNames();		        		
						if(colNames != null){
							for(int k=0; k&lt;colNames.length; k++){
								Log.e(&quot;Info&quot;,&quot;colNames[&quot;+k+&quot;] : &quot; + colNames[k]);
							}
						}
						*/
						int type = sms_sent_cursor.getInt(sms_sent_cursor.getColumnIndex(&quot;type&quot;));
						Log.e(&quot;Info&quot;,&quot;SMS Type : &quot; + type);
						// for actual state type=2
						if(type == 2){
							Log.e(&quot;Info&quot;,&quot;Id : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;_id&quot;)));
							Log.e(&quot;Info&quot;,&quot;Thread Id : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;thread_id&quot;)));
							Log.e(&quot;Info&quot;,&quot;Address : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;address&quot;)));
							Log.e(&quot;Info&quot;,&quot;Person : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;person&quot;)));
							Log.e(&quot;Info&quot;,&quot;Date : &quot; + sms_sent_cursor.getLong(sms_sent_cursor.getColumnIndex(&quot;date&quot;)));
							Log.e(&quot;Info&quot;,&quot;Read : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;read&quot;)));
							Log.e(&quot;Info&quot;,&quot;Status : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;status&quot;)));
							Log.e(&quot;Info&quot;,&quot;Type : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;type&quot;)));
							Log.e(&quot;Info&quot;,&quot;Rep Path Present : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;reply_path_present&quot;)));
							Log.e(&quot;Info&quot;,&quot;Subject : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;subject&quot;)));
							Log.e(&quot;Info&quot;,&quot;Body : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;body&quot;)));
							Log.e(&quot;Info&quot;,&quot;Err Code : &quot; + sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;error_code&quot;)));
							
							smsBodyStr = sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;body&quot;)).trim();
							phoneNoStr = sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex(&quot;address&quot;)).trim();
							smsDatTime = sms_sent_cursor.getLong(sms_sent_cursor.getColumnIndex(&quot;date&quot;));
							
							Log.e(&quot;Info&quot;,&quot;SMS Content : &quot;+smsBodyStr);
							Log.e(&quot;Info&quot;,&quot;SMS Phone No : &quot;+phoneNoStr);
							Log.e(&quot;Info&quot;,&quot;SMS Time : &quot;+smsDatTime);
						}
					}
				}
			}
			else
				Log.e(&quot;Info&quot;,&quot;Send Cursor is Empty&quot;);
		}
		catch(Exception sggh){
			Log.e(&quot;Error&quot;, &quot;Error on onChange : &quot;+sggh.toString());
		}
		super.onChange(selfChange);
	}//fn onChange
	
}//End of class SmsObserver

</pre></p>
<p>To register the content observer the following code lines are essential<br />
<pre class="brush: java;">
static final Uri SMS_STATUS_URI = Uri.parse(&quot;content://sms&quot;);
SmsObserver smsSentObserver = new SmsObserver(new Handler(), this);
this.getContentResolver().registerContentObserver(SMS_STATUS_URI, true, smsSentObserver);
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=146&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2012/01/18/listening-for-outgoing-sms-or-send-sms-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>12.332558 76.608233</georss:point>
		<geo:lat>12.332558</geo:lat>
		<geo:long>76.608233</geo:long>
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>How to search for a contact using phone number in Android</title>
		<link>http://katharnavas.wordpress.com/2012/01/18/how-to-search-for-a-contact-using-phone-number-in-android/</link>
		<comments>http://katharnavas.wordpress.com/2012/01/18/how-to-search-for-a-contact-using-phone-number-in-android/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 09:11:41 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[phone number]]></category>
		<category><![CDATA[phoneno]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=130</guid>
		<description><![CDATA[The following code allows to retrieve the contact details using phone number<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=130&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code allows to retrieve the contact details using phone number</p>
<p><pre class="brush: java;">
String contactId = &quot;&quot;;
String contactName = &quot;&quot;;

private void retrieveContactRecord(String phoneNo) {
	try{
		Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNo));
		String[] projection = new String[] { ContactsContract.PhoneLookup._ID, ContactsContract.PhoneLookup.DISPLAY_NAME };
		String selection = null;
		String[] selectionArgs = null;
		String sortOrder = ContactsContract.PhoneLookup.DISPLAY_NAME+ &quot; COLLATE LOCALIZED ASC&quot;;
		ContentResolver cr = mContext.getContentResolver();
		if(cr != null){
			Cursor resultCur = cr.query(uri, projection, selection, selectionArgs, sortOrder);
			if(resultCur != null){
				while (resultCur.moveToNext()) {
					contactId = resultCur.getString(resultCur.getColumnIndex(ContactsContract.PhoneLookup._ID));
					contactName = resultCur.getString(resultCur.getColumnIndexOrThrow(ContactsContract.PhoneLookup.DISPLAY_NAME));
					Log.e(&quot;Info&quot;,&quot;Contact Id : &quot;+contactId);
					Log.e(&quot;Info&quot;,&quot;Contact Display Name : &quot;+contactName);
					break;
				}
				resultCur.close();
			}
		}
	}
	catch(Exception sfg){
		Log.e(&quot;Error&quot;, &quot;Error in loadContactRecord : &quot;+sfg.toString());
	}
}//fn retrieveContactRecord
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=130&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2012/01/18/how-to-search-for-a-contact-using-phone-number-in-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>12.332558 76.608233</georss:point>
		<geo:lat>12.332558</geo:lat>
		<geo:long>76.608233</geo:long>
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>Listener for Incoming SMS in Android</title>
		<link>http://katharnavas.wordpress.com/2012/01/18/listener-for-incoming-sms-in-android/</link>
		<comments>http://katharnavas.wordpress.com/2012/01/18/listener-for-incoming-sms-in-android/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 08:58:34 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[incoming]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=125</guid>
		<description><![CDATA[The following code block allows you to listen for all the incoming sms in Android<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=125&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code block allows you to listen for all the incoming sms in Android</p>
<p><pre class="brush: java;">
public class SmsReceiver  extends BroadcastReceiver {
	
    private Context mContext;
    private Bundle mBundle;
    
    private String smsBodyStr = &quot;&quot;, phoneNoStr = &quot;&quot;;
    private long smsDatTime = System.currentTimeMillis();
    
    public void onReceive(Context context, Intent intent) {
		try{
			mContext = context;
			mBundle = intent.getExtras();  
			
		    if (mBundle != null){
		    	getSMSDetails();
		    }
		    else
		    	Log.e(&quot;Info&quot;,&quot;Bundle is Empty!&quot;);
		}
		catch(Exception sgh){
			Log.e(&quot;ERROR&quot;, &quot;Error in Init : &quot;+sgh.toString());
		}
	}//fn onReceive

	private void getSMSDetails(){	     
	    SmsMessage[] msgs = null;
		try{
			Object[] pdus = (Object[]) mBundle.get(&quot;pdus&quot;);
			if(pdus != null){
				msgs = new SmsMessage[pdus.length];
				Log.e(&quot;Info&quot;,&quot;pdus length : &quot;+pdus.length);
				for(int k=0; k&lt;msgs.length; k++){
					msgs[k] = SmsMessage.createFromPdu((byte[])pdus[k]);  
					
					Log.e(&quot;Info&quot;,&quot;getDisplayMessageBody : &quot;+msgs[k].getDisplayMessageBody());
					Log.e(&quot;Info&quot;,&quot;getDisplayOriginatingAddress : &quot;+msgs[k].getDisplayOriginatingAddress());
					Log.e(&quot;Info&quot;,&quot;getMessageBody : &quot;+msgs[k].getMessageBody());
					Log.e(&quot;Info&quot;,&quot;getOriginatingAddress : &quot;+msgs[k].getOriginatingAddress());
					Log.e(&quot;Info&quot;,&quot;getProtocolIdentifier : &quot;+msgs[k].getProtocolIdentifier());
					Log.e(&quot;Info&quot;,&quot;getStatus : &quot;+msgs[k].getStatus());
					Log.e(&quot;Info&quot;,&quot;getStatusOnIcc : &quot;+msgs[k].getStatusOnIcc());
					Log.e(&quot;Info&quot;,&quot;getStatusOnSim : &quot;+msgs[k].getStatusOnSim());
					
					smsBodyStr = msgs[k].getMessageBody().trim();
					phoneNoStr = msgs[k].getOriginatingAddress().trim();
					smsDatTime = msgs[k].getTimestampMillis();
					
					Log.e(&quot;Info&quot;,&quot;SMS Content : &quot;+smsBodyStr);
					Log.e(&quot;Info&quot;,&quot;SMS Phone No : &quot;+phoneNoStr);
					Log.e(&quot;Info&quot;,&quot;SMS Time : &quot;+smsDatTime);
				}
			}
		}
		catch(Exception sfgh){
			Log.e(&quot;ERROR&quot;, &quot;Error in getSMSDetails : &quot;+sfgh.toString());
		}
	}//fn getSMSDetails
	
}//End of class SmsReceiver
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=125&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2012/01/18/listener-for-incoming-sms-in-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>12.332558 76.608233</georss:point>
		<geo:lat>12.332558</geo:lat>
		<geo:long>76.608233</geo:long>
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>Android Interview Questions and Answers (Basic)</title>
		<link>http://katharnavas.wordpress.com/2011/05/09/android-interview-questions-and-answers-basic/</link>
		<comments>http://katharnavas.wordpress.com/2011/05/09/android-interview-questions-and-answers-basic/#comments</comments>
		<pubDate>Mon, 09 May 2011 13:33:14 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=115</guid>
		<description><![CDATA[What is Android? Android is a software stack for mobile devices that includes an operating system, middleware and key applications. Explain the Architecture of android ? Top -&#62; Applications (Contacts, Browser, Phone, etc) Below Applications -&#62; Application Framework(Activity Manager, Window Manager, Content Providers, View System, Package manager, Telephony manager, Resource, Notification, Location managers) Below Application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=115&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>What is Android?</strong><br />
Android is a software stack for mobile devices that includes an operating system, middleware and key applications.</p>
<p><strong>Explain the Architecture of android ?</strong><br />
Top -&gt; Applications (Contacts, Browser, Phone, etc)</p>
<p>Below Applications -&gt; Application Framework(Activity Manager, Window Manager, Content Providers, View System,  Package manager,<br />
Telephony manager, Resource, Notification, Location managers)</p>
<p>Below Application Framework -&gt; System Libraries(Like Sqlite, webkit, SSL, OpenGL, Media Framework etc) &amp; Android Runtime( Core Libraries and DVM)</p>
<p>Atlast Last -&gt; Linux Kernel (which composed of drivers like display, camera etc.)</p>
<p><strong>Describe the APK format.</strong><br />
The APK file is compressed the AndroidManifest.xml file, application code (.dex files), resource files, and other files.<br />
A project is compiled into a single .apk file.</p>
<p><strong>What is an action?</strong><br />
A description of something that an Intent sender desires.</p>
<p><strong>What is an activity?</strong><br />
A single screen in an application, with supporting Java code.<br />
An activity presents a visual user interface for one focused endeavor the user can undertake.<br />
For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions.<br />
Each one is implemented as a subclass of the Activity  base class. </p>
<p><strong>What is a service?</strong><br />
A service doesn&#8217;t have a visual user interface, but rather runs in the background for an indefinite period of time.<br />
For example, a service might play background music as the user attends to other matters, or it might fetch data over the network or calculate<br />
something and provide the result to activities that need it.<br />
Each service extends the Service  base class. </p>
<p><strong>What is a Broadcast receivers?</strong><br />
    A broadcast receiver is a component that does nothing but receive and react to broadcast announcements.<br />
    For example, announcements that the timezone has changed, that the battery is low or that the user changed a language preference.<br />
    All receivers extend the BroadcastReceiver  base class.<br />
    Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive,<br />
    or they may use the NotificationManager  to alert the user like(flashing the backlight, vibrating the device, playing a sound)</p>
<p><strong>What is a content provider?</strong><br />
    A content provider makes a specific set of the application&#8217;s data available to other applications.The content provider extends the ContentProvider<br />
base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls.<br />
However, applications do not call these methods directly. Rather they use a ContentResolver  object and call its methods instead.</p>
<p><strong>What is intent?</strong><br />
A class (Intent) describes what a caller desires to do. The caller sends this intent to Android&#8217;s intent resolver, which finds the most suitable activity for the intent.</p>
<p><strong>How is nine-patch image different from a regular bitmap?</strong><br />
It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes.</p>
<p><strong>What languages does Android support for application development?</strong><br />
Android applications are written using the Java programming language.</p>
<p><strong>What is a resource?</strong><br />
A user-supplied XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.</p>
<p><strong>What Virtual Machine Android runs on?</strong><br />
Dalvik virtual machine</p>
<p><strong>Android Latest Version?</strong><br />
Android 3.0</p>
<p><strong>How do you define the user interface?</strong><br />
XML Format is the best.</p>
<p><strong>Code Snippets:</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>How to start a browser instance with some url ?</strong><br />
<pre class="brush: java;">
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri u = Uri.parse(&quot;http://google.com&quot;);
intent.setData(u);
startActivity(intent);
</pre></p>
<p><strong>//Function called when return from a sub activity.</strong><br />
<pre class="brush: java;">
protected void onActivityResult(int requestCode, int resultCode, String data, Bundle extras) {
}
</pre></p>
<p><strong>//How to retrieve the device IMEI Number</strong><br />
<pre class="brush: java;">
TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
imei = mTelephonyMgr.getDeviceId(); 
</pre></p>
<p><strong>How to call a subactivity?</strong><br />
<pre class="brush: java;">
Intent intent = new Intent(this, SubActivity.class);
//to pass data
addintent.putExtra(name, value);
startActivityForResult(intent, int);
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=115&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2011/05/09/android-interview-questions-and-answers-basic/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>How to split a string in to array of strings in Blackberry</title>
		<link>http://katharnavas.wordpress.com/2011/03/09/how-to-split-a-string-in-to-array-of-strings-in-blackberry/</link>
		<comments>http://katharnavas.wordpress.com/2011/03/09/how-to-split-a-string-in-to-array-of-strings-in-blackberry/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 10:42:32 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=111</guid>
		<description><![CDATA[The following code block shows how to split a string in to array of strings in blackberry. To make the function call<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=111&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code block shows how to split a string in to array of strings in blackberry.</p>
<p><pre class="brush: java;">
private String[] split(String strString, String strDelimiter) {
        String[] strArray;
        int iOccurrences = 0;
        int iIndexOfInnerString = 0;
        int iIndexOfDelimiter = 0;
        int iCounter = 0;
    
        //Check for null input strings.
        if (strString == null) {
            throw new IllegalArgumentException(&quot;Input string cannot be null.&quot;);
        }
        //Check for null or empty delimiter strings.
        if (strDelimiter.length() &lt;= 0 || strDelimiter == null) {
            throw new IllegalArgumentException(&quot;Delimeter cannot be null or empty.&quot;);
        }
    
        if (strString.startsWith(strDelimiter)) {
            strString = strString.substring(strDelimiter.length());
        }
    
        //If strString does not end with the delimiter then add it
        //to the string in order to comply with the desired format.
        if (!strString.endsWith(strDelimiter)) {
            strString += strDelimiter;
        }
    
        //Count occurrences of the delimiter in the string.
        //Occurrences should be the same amount of inner strings.
        while((iIndexOfDelimiter = strString.indexOf(strDelimiter,
            iIndexOfInnerString)) != -1) {
            iOccurrences += 1;
            iIndexOfInnerString = iIndexOfDelimiter +
                strDelimiter.length();
        }
    
        //Declare the array with the correct size.
        strArray = new String[iOccurrences];
    
        //Reset the indices.
        iIndexOfInnerString = 0;
        iIndexOfDelimiter = 0;
    
        //Walk across the string again and this time add the
        //strings to the array.
        while((iIndexOfDelimiter = strString.indexOf(strDelimiter,
            iIndexOfInnerString)) != -1) {
    
            //Add string to array.
            strArray[iCounter] = strString.substring(iIndexOfInnerString,iIndexOfDelimiter);
    
            //Increment the index to the next character after
            //the next delimiter.
            iIndexOfInnerString = iIndexOfDelimiter +
                strDelimiter.length();
    
            //Inc the counter.
            iCounter += 1;
        }
    
        return strArray;
    }//fn split
</pre></p>
<p>To make the function call<br />
<pre class="brush: java;">
String delimit = &quot;,&quot;;
String mainStr = &quot;apple, banana, orange, pineapple, cherry&quot;;
String[] fruits = split(mainStr , delimit); 
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=111&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2011/03/09/how-to-split-a-string-in-to-array-of-strings-in-blackberry/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>How to convert a byte Array to Base64 String in Blackberry</title>
		<link>http://katharnavas.wordpress.com/2011/03/04/how-to-convert-a-byte-array-to-base64-string-in-blackberry/</link>
		<comments>http://katharnavas.wordpress.com/2011/03/04/how-to-convert-a-byte-array-to-base64-string-in-blackberry/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 14:50:58 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[decode]]></category>
		<category><![CDATA[encode]]></category>
		<category><![CDATA[j2me]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=107</guid>
		<description><![CDATA[The following code block shows how to convert a byte array in to base64 string The following code shows how how to convert base64 encoded string to bytes<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=107&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code block shows how to convert a byte array in to base64 string</p>
<p><pre class="brush: java;">
private String encodeBase64( byte[] toEncode, int offset, int length ) {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(length);
        Base64OutputStream base64OutputStream = new Base64OutputStream( byteArrayOutputStream );
        try{
            base64OutputStream.write( toEncode, offset, length );
            base64OutputStream.flush();
            base64OutputStream.close(); 
        }
        catch (IOException ioe){
            System.out.println(&quot;Error in encodeBase64() : &quot;+ioe.toString());
            return null;
        }
        return byteArrayOutputStream.toString();
}//fn encodeBase64
</pre></p>
<p>The following code shows how how to convert base64 encoded string to bytes<br />
<pre class="brush: java;">
byte[] decoded = Base64InputStream.decode(base64str);
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=107&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2011/03/04/how-to-convert-a-byte-array-to-base64-string-in-blackberry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>How to convert a Byte Array to Hex String</title>
		<link>http://katharnavas.wordpress.com/2011/03/04/how-to-convert-a-byte-array-to-hex-string/</link>
		<comments>http://katharnavas.wordpress.com/2011/03/04/how-to-convert-a-byte-array-to-hex-string/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 14:28:43 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[byte]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=104</guid>
		<description><![CDATA[The following code block helps you to convert a byte array to hex string format.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=104&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code block helps you to convert a byte array to hex string format.</p>
<p><pre class="brush: java;">
private String byteArrayToHexString(byte in[]){
        byte ch = 0x00;
        int i = 0;
        if (in == null || in.length &lt;= 0){
            return null;
        }
        String pseudo[] = {&quot;0&quot;, &quot;1&quot;, &quot;2&quot;,&quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;,&quot;9&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;F&quot;};
        StringBuffer out_str_buf = new StringBuffer(in.length * 2);
        while (i &lt; in.length){
            ch = (byte) (in[i] &amp; 0xF0); // Strip off high nibble
            ch = (byte) (ch &gt;&gt;&gt; 4);     // shift the bits down
            ch = (byte) (ch &amp; 0x0F);    // must do this is high order bit is on!
            out_str_buf.append(pseudo[ (int) ch]); // convert the nibble to a String Character
            ch = (byte) (in[i] &amp; 0x0F); // Strip off low nibble
            out_str_buf.append(pseudo[ (int) ch]); // convert the nibble to a String Character
            i++;
        }
        String rslt = new String(out_str_buf);
        return rslt;
    }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=104&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2011/03/04/how-to-convert-a-byte-array-to-hex-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>How to do file operations in BlackBerry</title>
		<link>http://katharnavas.wordpress.com/2011/03/01/how-to-do-file-operations-in-blackberry/</link>
		<comments>http://katharnavas.wordpress.com/2011/03/01/how-to-do-file-operations-in-blackberry/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 15:20:07 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[operations]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=100</guid>
		<description><![CDATA[Code to read data from a file Code to write data to a file This function allows you to write byte array to the file specified. Code to delete a file<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=100&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Code to read data from a file </strong></p>
<p><pre class="brush: java;">
byte[] fulldata = null;
//Assign the name of the file to read the contents with full path
String filename = &quot;/store/home/user/pictures/test.txt&quot;;
if (filename != null) {
    FileConnection file = (FileConnection) Connector.open(&quot;file://&quot; +filename, Connector.READ);
    //Get the file size
    int fileSize = (int) file.fileSize();
    if (fileSize &gt; 0) {
	fulldata = new byte[fileSize];
	InputStream input = file.openInputStream();    
	try{
	   input.read(fulldata);
	}
	catch(Exception sfg){
	    System.out.println(sfg.toString());
	}
	input.close();   
    }
    file.close();
}
</pre></p>
<p><strong>Code to write data to a file </strong></p>
<p>This function allows you to write byte array to the file specified.</p>
<p><pre class="brush: java;">
//data -&gt; byte array (Original data to be  written)
//filename -&gt; name of the file in which those data has to be written

public static void writeFileData(byte[] data, String filename) {
        FileConnection file = null;
        OutputStream out = null;
        try {
            file = (FileConnection) Connector.open(&quot;file:///store/home/user/pictures/&quot; + filename, Connector.READ_WRITE);
            if (file.exists())
                file.delete();
            
            file.create();
            out = file.openOutputStream();
            out.write(data);
        } 
        catch (IOException e) {
            System.out.println(&quot;Problem in writeFile : &quot; + e.toString());
        } 
        finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (file != null &amp;&amp; file.exists()) {
                    if (file.isOpen()) {          
                        file.close();
                    }
                }
            } 
            catch (IOException ioe) {
                System.out.println(&quot;Error while closing file: &quot; + ioe);
            }
        }
    }//fn writeFileData
</pre></p>
<p><strong>Code to delete a file </strong><br />
<pre class="brush: java;">

String filename = &quot;/store/home/user/pictures/test.txt&quot;;
FileConnection file = null;
try {
    file = (FileConnection) Connector.open(&quot;file://&quot; + filename, Connector.READ_WRITE);
} 
catch (IOException e) {
    System.out.println(&quot;Error in file connection : &quot;+e.toString());
} 
finally {
    try {
	if (file != null &amp;&amp; file.exists()) {                        
	    file.delete();
	}
    } 
    catch (IOException ioe) {
	System.out.println(&quot;Error in file deletion : &quot;+ioe.toString());
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=100&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2011/03/01/how-to-do-file-operations-in-blackberry/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>12.332558 76.608233</georss:point>
		<geo:lat>12.332558</geo:lat>
		<geo:long>76.608233</geo:long>
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>How to make a call automatically on Android</title>
		<link>http://katharnavas.wordpress.com/2011/01/25/how-to-make-a-call-automatically-on-android/</link>
		<comments>http://katharnavas.wordpress.com/2011/01/25/how-to-make-a-call-automatically-on-android/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 13:36:10 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[phone]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/2011/01/25/how-to-make-a-call-automatically-on-android/</guid>
		<description><![CDATA[The following code shows how to make phone calls (ie) launch the default phone dialer with the specified number in Android.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=74&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code shows how to make phone calls (ie) launch the default phone dialer with the specified number in Android.</p>
<p><pre class="brush: java;">
String data = &quot;012034034&quot;; //Phone Number

Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(data));

this.startActivity(intent);
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=74&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2011/01/25/how-to-make-a-call-automatically-on-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
		<item>
		<title>List all the files in a directory in php</title>
		<link>http://katharnavas.wordpress.com/2009/10/28/list-all-the-files-in-a-directory-in-php/</link>
		<comments>http://katharnavas.wordpress.com/2009/10/28/list-all-the-files-in-a-directory-in-php/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 10:12:46 +0000</pubDate>
		<dc:creator>katharnavas</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[list all]]></category>

		<guid isPermaLink="false">http://katharnavas.wordpress.com/?p=59</guid>
		<description><![CDATA[This code will display all the files in the images folder.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=59&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This code will display all the files in the images folder.</p>
<p><pre class="brush: php;">
foreach (glob(&quot;images/*.*&quot;) as $filename) {
       echo basename($filename);
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katharnavas.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katharnavas.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katharnavas.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katharnavas.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katharnavas.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katharnavas.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katharnavas.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katharnavas.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katharnavas.wordpress.com&amp;blog=7189910&amp;post=59&amp;subd=katharnavas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katharnavas.wordpress.com/2009/10/28/list-all-the-files-in-a-directory-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>12.332558 76.608233</georss:point>
		<geo:lat>12.332558</geo:lat>
		<geo:long>76.608233</geo:long>
		<media:content url="http://1.gravatar.com/avatar/3fa14fbd6d60448ef9389a9f02c2e410?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Navas</media:title>
		</media:content>
	</item>
	</channel>
</rss>
