<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4640198225857397031</id><updated>2012-02-16T01:46:17.196-08:00</updated><category term='J2ME'/><category term='back'/><category term='protocol'/><category term='package'/><category term='MetaData Reflection'/><category term='crystal'/><category term='use case'/><category term='shopping'/><category term='UI'/><category term='VB.NET'/><category term='class lopps'/><category term='unable to find a version of the runtime to run this application'/><category term='background worker'/><category term='pause'/><category term='EditorPane'/><category term='extension'/><category term='classes'/><category term='compatible'/><category term='synchronous'/><category term='Events'/><category term='ListCellRenderer'/><category term='Threading'/><category term='custom event'/><category term='CSS'/><category term='fields'/><category term='engineering'/><category term='refactor'/><category term='listeners'/><category term='NetBeans'/><category term='system calls'/><category term='online'/><category term='CustomerDetails'/><category term='xmas'/><category term='read'/><category term='echo'/><category term='welcome'/><category term='Dataset'/><category term='.config'/><category term='Eclipse'/><category term='content-disposition'/><category term='OOP'/><category term='lightweight'/><category term='MIDlet'/><category term='crystal reports'/><category term='framework'/><category term='blogging'/><category term='content'/><category term='error'/><category term='account'/><category term='MessageSender'/><category term='.NET'/><category term='activity'/><category term='reflection'/><category term='subclass'/><category term='CustomerService'/><category term='client'/><category term='inspired'/><category term='web page'/><category term='listview'/><category term='failed to load the JNI shared library'/><category term='messaging'/><category term='custom events'/><category term='Oracle'/><category term='application'/><category term='IDE'/><category term='GUI'/><category term='blocking'/><category term='searching algorithm'/><category term='interface'/><category term='jSQL'/><category term='document root'/><category term='worker'/><category term='zlip.output_compression'/><category term='computer'/><category term='spirit'/><category term='virtual machine'/><category term='Notepad'/><category term='FBJS'/><category term='cross-thread'/><category term='Virtualization'/><category term='StartSeach'/><category term='invoke'/><category term='Facebook'/><category term='update'/><category term='ActiveRecords'/><category term='Metadata'/><category term='ADempiere'/><category term='operation'/><category term='try/catch'/><category term='delegates'/><category term='powerful'/><category term='Open Source'/><category term='PHP'/><category term='Canvas'/><category term='print'/><category term='diagram'/><category term='javax.wireless.messaging'/><category term='wireless'/><category term='servers'/><category term='iFrame'/><category term='FMBL'/><category term='mobile'/><category term='eclipse shared library JNI'/><category term='ERD'/><category term='attachment'/><category term='sessionID'/><category term='path'/><category term='SQL'/><category term='JSP'/><category term='documentation'/><category term='Secre'/><category term='treeview'/><category term='mobile phones'/><category term='quicksearch'/><category term='projects'/><category term='LWUIT'/><category term='mirror method(MM)'/><category term='insert'/><category term='library'/><category term='initialization error'/><category term='pointers'/><category term='inherits'/><category term='ActiveX'/><category term='environment variables'/><category term='software engineering'/><category term='List'/><category term='cache-control'/><category term='CheckList'/><category term='shared library'/><category term='Record Management Store'/><category term='SMS'/><category term='stop'/><category term='WebBrowser'/><category term='threads'/><category term='wrapper'/><category term='reports'/><category term='64-bit'/><category term='CRM'/><category term='sequence'/><category term='URL'/><category term='API Key'/><category term='UML'/><category term='language'/><category term='CRUD'/><category term='school'/><category term='visual studio'/><category term='JavaME'/><category term='sense'/><category term='permissions'/><category term='JDK'/><category term='credits'/><category term='software'/><category term='HTML'/><category term='session'/><category term='text message'/><category term='VM ware'/><category term='requirements'/><category term='OS'/><category term='CheckListBox'/><category term='School Management System'/><category term='JAVA'/><category term='asynchronous'/><category term='codes'/><category term='C++'/><category term='tables'/><category term='implement'/><category term='download'/><category term='delete'/><category term='register'/><category term='topic'/><category term='db2lang'/><category term='32-bit'/><category term='browser'/><category term='class'/><category term='fire and forget'/><category term='script'/><category term='Postgres SQL'/><category term='background'/><category term='file'/><category term='Lists'/><category term='database'/><category term='operating system'/><category term='platform'/><category term='elouai'/><category term='process'/><category term='programming'/><category term='ERP'/><category term='Common Sense'/><category term='break'/><category term='simple'/><category term='instance'/><category term='Search'/><category term='API'/><category term='ADO.NET'/><category term='experiences'/><category term='C#'/><category term='source'/><category term='CheckBox'/><category term='RMS'/><category term='Singleton'/><category term='model'/><category term='data'/><title type='text'>Future of Software Engineering</title><subtitle type='html'>articles on some software development topics</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-3204549701193966495</id><published>2012-02-15T04:19:00.000-08:00</published><updated>2012-02-15T04:27:18.972-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='extension'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='attachment'/><category scheme='http://www.blogger.com/atom/ns#' term='path'/><category scheme='http://www.blogger.com/atom/ns#' term='cache-control'/><category scheme='http://www.blogger.com/atom/ns#' term='echo'/><category scheme='http://www.blogger.com/atom/ns#' term='zlip.output_compression'/><category scheme='http://www.blogger.com/atom/ns#' term='download'/><category scheme='http://www.blogger.com/atom/ns#' term='break'/><category scheme='http://www.blogger.com/atom/ns#' term='credits'/><category scheme='http://www.blogger.com/atom/ns#' term='file'/><category scheme='http://www.blogger.com/atom/ns#' term='elouai'/><category scheme='http://www.blogger.com/atom/ns#' term='document root'/><category scheme='http://www.blogger.com/atom/ns#' term='script'/><category scheme='http://www.blogger.com/atom/ns#' term='content'/><category scheme='http://www.blogger.com/atom/ns#' term='servers'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><category scheme='http://www.blogger.com/atom/ns#' term='content-disposition'/><title type='text'>PHP File Downloads</title><content type='html'>I had to sweat a little before getting this right.&lt;br /&gt;&lt;br /&gt;I browsed the net to get help on PHP File Downloading class. Well, i got some help though but i had to break open it, and learn the hard way.&lt;br /&gt;&lt;br /&gt;As i rewrote the script from scratch, i suffered a lot. Testing and testing always led to the same incorrect result: the actual content of the targeted file was being 'echoed' instead of downloaded. I saw the long lines of jumbled-texts in my browser any time i run that script. Aaarrrrgh!!&lt;br /&gt;&lt;br /&gt;Eventually, there was a light at the end of the tunnel as i added the following lines of code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;(&lt;span style="color: red;"&gt;ini_get&lt;/span&gt;('zlib.output_compression'))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&amp;nbsp; &lt;span style="color: red;"&gt;ini_set&lt;/span&gt;('zlib.output_compression', 'Off');&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Explanation? You see, most php-included Servers set the output compression (in php.ini file) to On, by default. If this is so, your browser might display that jumbled-text instead of downloading the file. This usually occurs in Internet Explorer browsers; however, most well-known browsers might follow suite.&lt;br /&gt;&lt;br /&gt;I hope this helps you.&lt;br /&gt;&lt;br /&gt;And oh, here's the full source code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$itemname = $_GET['download_file'];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$path = $_SERVER['DOCUMENT_ROOT']."/somefolder/";&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$fullPath = $path.$itemname&amp;nbsp;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// required for IE, otherwise Content-disposition is ignored&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;if(ini_get('zlib.output_compression'))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; ini_set('zlib.output_compression', 'Off');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// addition by Jorg Weske&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$file_extension = strtolower(substr(strrchr($fullPath,"."),1));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;if( $fullPath == "" )&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; exit;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;} elseif ( ! file_exists( $fullPath ) )&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; exit;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;};&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;switch( $file_extension )&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "pdf": $ctype="application/pdf"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "exe": $ctype="application/octet-stream"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "zip": $ctype="application/zip"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "doc": $ctype="application/msword"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "xls": $ctype="application/vnd.ms-excel"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "ppt": $ctype="application/vnd.ms-powerpoint"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "gif": $ctype="image/gif"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "png": $ctype="image/png"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "jpeg":&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; case "jpg": $ctype="image/jpg"; break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; default: $ctype="application/force-download";//you may want to get more...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Pragma: public"); // required&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Expires: 0");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Cache-Control: must-revalidate, post-check=0, pre-check=0");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Cache-Control: private",false); // required for certain browsers&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Content-Type: $ctype");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// change, added quotes to allow spaces in filenames, by Rajkumar Singh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Content-Disposition: attachment; filename=\"".basename($fullPath)."\";" );&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Content-Transfer-Encoding: binary");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;header("Content-Length: ".filesize($fullPath));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;readfile("$fullPath");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;exit();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;Credits:&amp;nbsp;&lt;a href="http://elouai.com/force-download.php"&gt;http://elouai.com/force-download.php&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-3204549701193966495?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/3204549701193966495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=3204549701193966495&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/3204549701193966495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/3204549701193966495'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2012/02/php-file-downloads.html' title='PHP File Downloads'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-6032652662616520517</id><published>2012-01-25T05:36:00.000-08:00</published><updated>2012-01-27T03:29:05.607-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='package'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgres SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='ERD'/><category scheme='http://www.blogger.com/atom/ns#' term='CRUD'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Open Source'/><category scheme='http://www.blogger.com/atom/ns#' term='Common Sense'/><category scheme='http://www.blogger.com/atom/ns#' term='source'/><category scheme='http://www.blogger.com/atom/ns#' term='ADempiere'/><category scheme='http://www.blogger.com/atom/ns#' term='sense'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='ERP'/><category scheme='http://www.blogger.com/atom/ns#' term='CRM'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='db2lang'/><title type='text'>Have you thought of ADempiere</title><content type='html'>This is what i've gotten myself into now: ADempiere!! (I don't really care how you pronounce it)&lt;br /&gt;&lt;br /&gt;Thinking of developing an ERP, CRM or anything of those business suites, then ADempiere might be your missing rib. Of course, it is very open source; and i mean very open. Expect to go through the fire of no-support affliction. You might need lots of bandwidth to watch online videos or webinars to get familiarised with this system.&lt;br /&gt;&lt;br /&gt;But in the long run, it's worth it. My first encounter with ADempiere was sweet. All i had to do (or at least what i thought i had to do) was to properly organise my underlying database (with Postgres; also works well with Oracle) with a neat ERD, then let ADempiere create all the windows and connections to do the CRUD work. That is quick ADempiere 101. But unscrewing the bolts and nuts led me to a whole new world of ERP.&lt;br /&gt;&lt;br /&gt;Once upon a time, i thought of developing a system that will be used to develop db related systems. Let me explain. Developers always come in contact with some kind of database connections. As such, you need to do at least 3 things:&lt;br /&gt;&lt;i&gt;1. Design database and tables&lt;/i&gt;&lt;br /&gt;&lt;i&gt;2. Develop entity classes that talk to the tables in the database&lt;/i&gt;&lt;br /&gt;&lt;i&gt;3. Design a good-looking UI that displays data from the database&lt;/i&gt;&lt;br /&gt;I started off by developing db2lang to solve problem 2. Then i realised that the burden even lies more on 1 and 3.&lt;br /&gt;&lt;br /&gt;ADempiere becomes a saviour in each of these cases. (There are other good ERP, CRM IDEs).&lt;br /&gt;&lt;br /&gt;In this blog and subsequent ones, i shall address some common issues that you may encounter during setup of your development environment. I shall use the Windows OS to do the explanation.&lt;br /&gt;&lt;br /&gt;Here are the tools you need to develop that great enterprise software you've always thought of:&lt;br /&gt;1. &lt;a href="http://www.eclipse.org/downloads/index-developer.php" target="_blank"&gt;Eclipse JEE Indigo&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.postgresql.org/download/" target="_blank"&gt;Postgres SQL (the current version)&lt;/a&gt;&amp;nbsp;with the GUI tools.&lt;br /&gt;3. &lt;a href="https://adempiere.svn.sourceforge.net/svnroot/adempiere/tags/%20adempiere360lts." target="_blank"&gt;ADempiere source package&lt;/a&gt;&lt;br /&gt;4. Latest JRE&lt;br /&gt;5. Common sense&lt;br /&gt;Mind you, these are all free.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Installation Instructions:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;1. Unzip the Eclipse IDE to your drive C&lt;br /&gt;2. Do the same for the ADempiere source package. Copy the contents to drive C:\Adempiere&lt;br /&gt;Luckily, your ADempiere should come packaged with a JBoss web server. If not, get one and download it. We shall also be working with Tomcat too. You may download it &lt;a href="http://tomcat.apache.org/download-60.cgi" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;3. Install Postgres SQL using default settings&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Let's box on:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Ok, ok. So we're ready to go.&lt;br /&gt;Create environment variables for Java JRE (if not already created), Postgres and your Adempiere directory.&lt;br /&gt;Now, create a login role in Postgres with adempiere as both username and password. Then create a schema/database called adempiere.&lt;br /&gt;&lt;br /&gt;Done? Now open Adempiere folder and run RUN_setup.bat directly or you may execute it using Command Prompt. It takes some time so get a drink whiles waiting.&lt;br /&gt;&lt;br /&gt;Enter the required details as the screen demands. Follow the windows that appears and make sure all values entered are correct. Accept license terms when it appears. Adempiere creates a .properties file in your ADempiere home folder.&lt;br /&gt;&lt;br /&gt;Good! Now run the file named 'RUN_Adempiere.bat'. This starts the Adempiere engine and open the login window.&lt;br /&gt;Click on the textbox that has 'Server' as label. This opens the Connection window. Inspect the settings to verify its correctness and hit any of the 'Test' buttons for testing your settings. Ok the window to go back to the login window. Now you can login, select your role and wala, we're there.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-6032652662616520517?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/6032652662616520517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=6032652662616520517&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6032652662616520517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6032652662616520517'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2012/01/have-you-thought-of-adempiere.html' title='Have you thought of ADempiere'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-1961503232348627534</id><published>2011-12-12T02:23:00.001-08:00</published><updated>2011-12-12T03:00:54.710-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shared library'/><category scheme='http://www.blogger.com/atom/ns#' term='environment variables'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='64-bit'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK'/><category scheme='http://www.blogger.com/atom/ns#' term='failed to load the JNI shared library'/><category scheme='http://www.blogger.com/atom/ns#' term='32-bit'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse shared library JNI'/><category scheme='http://www.blogger.com/atom/ns#' term='ADempiere'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Eclipse Shared Library Issue</title><content type='html'>Just recently, after installing ADempiere platform and playing around with it, i decided to launch eclipse and do some commenting on some of my codes. After clicking the icon, i got the following:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-T5edMliYzXg/TuXcgkrZ84I/AAAAAAAAAE0/3gZ3FI_MXyg/s1600/eclipse+error.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://2.bp.blogspot.com/-T5edMliYzXg/TuXcgkrZ84I/AAAAAAAAAE0/3gZ3FI_MXyg/s320/eclipse+error.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Unfortunately, i had changed the Java-Home path in my environment settings. My Eclipse was a 64-bit version, and i had pointed it to a 32-bit version of Java.&lt;br /&gt;To resolve this issue, I opened the eclipse.ini file in the eclipse folder and added the following line right after the 'openFile':&lt;br /&gt;&amp;nbsp;-vm &lt;br /&gt;C:\Program Files\Java\jdk1.6.0_25\bin\javaw.exe&lt;br /&gt;&lt;br /&gt;This points eclipse to where my 64-bit JDK resides. And it solved the problem. &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-1961503232348627534?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/1961503232348627534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=1961503232348627534&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/1961503232348627534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/1961503232348627534'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2011/12/eclipse-shared-library-issue.html' title='Eclipse Shared Library Issue'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-T5edMliYzXg/TuXcgkrZ84I/AAAAAAAAAE0/3gZ3FI_MXyg/s72-c/eclipse+error.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-4963103173208420892</id><published>2011-12-07T01:05:00.001-08:00</published><updated>2011-12-07T01:24:43.657-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='application'/><category scheme='http://www.blogger.com/atom/ns#' term='unable to find a version of the runtime to run this application'/><category scheme='http://www.blogger.com/atom/ns#' term='initialization error'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='Notepad'/><category scheme='http://www.blogger.com/atom/ns#' term='.config'/><category scheme='http://www.blogger.com/atom/ns#' term='compatible'/><title type='text'>.NET Framework Initialization Error!!</title><content type='html'>Do you get this error sometimes:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IoNucZmCY84/Tt8uDkcEApI/AAAAAAAAAEs/ZV8EmzQcuNI/s1600/.net+error.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="100" src="http://4.bp.blogspot.com/-IoNucZmCY84/Tt8uDkcEApI/AAAAAAAAAEs/ZV8EmzQcuNI/s320/.net+error.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Some versions of .NET may not be backward compatible unless you provide a .exe.config file next to your application.&lt;br /&gt;I've gotten the anti-error solution. Just create a .exe.config file (you can use Notepad) with the same name as your application. Copy the contents of this &lt;a href="https://skydrive.live.com/redir.aspx?cid=f5c5e1056fac2e69&amp;amp;resid=F5C5E1056FAC2E69!195&amp;amp;parid=F5C5E1056FAC2E69!185" target="_blank"&gt;file&lt;/a&gt; to your .exe.config file.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Put your .exe.config file in the same folder as your application. Now run your application. Is it done? Let me know!!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-4963103173208420892?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/4963103173208420892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=4963103173208420892&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/4963103173208420892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/4963103173208420892'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2011/12/net-framework-initialization-error.html' title='.NET Framework Initialization Error!!'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-IoNucZmCY84/Tt8uDkcEApI/AAAAAAAAAEs/ZV8EmzQcuNI/s72-c/.net+error.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-342832491604768578</id><published>2011-11-25T07:40:00.000-08:00</published><updated>2011-11-25T07:40:14.956-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CheckListBox'/><category scheme='http://www.blogger.com/atom/ns#' term='data'/><category scheme='http://www.blogger.com/atom/ns#' term='CheckBox'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='implement'/><category scheme='http://www.blogger.com/atom/ns#' term='LWUIT'/><category scheme='http://www.blogger.com/atom/ns#' term='ListCellRenderer'/><category scheme='http://www.blogger.com/atom/ns#' term='CheckList'/><category scheme='http://www.blogger.com/atom/ns#' term='J2ME'/><category scheme='http://www.blogger.com/atom/ns#' term='JavaME'/><category scheme='http://www.blogger.com/atom/ns#' term='interface'/><category scheme='http://www.blogger.com/atom/ns#' term='subclass'/><title type='text'>No CheckListBox in LWUIT?</title><content type='html'>&lt;div class="MsoNormal"&gt;As I was developing the next version of the famous SoftCards (a Scripture Mastery JavaME app), I wanted to employ the exceptionally stunning components in LWUIT to enhance my UI. However, I noticed that LWUIT was not packaged with a CheckListBox, like the one in .NET controls.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;I felt devastated but I did not lose hope. I searched the internet for help. I even realized there were others like me who wanted the same UI item. I got some help though, but, I decided to do my own thing and share it with the world. The result? CheckList!&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;How did I do it?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;CheckList subclasses the List class and provides a few critical methods like getItems(), getCheckedItems(), getItem(int index). It’s so because they were missing in the super class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Next, I created a CheckListItemData class that represents the data to be stored in the CheckList. To be simple, I created properties to get and set the check state, ID and Display Name of the item.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Also, I added a renderer class. As the name suggests, it’s responsible for presenting the check item itself; the UI. It subclasses the CheckBox and implements ListCellRenderer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Put it all together: CheckList!&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Finally, I tested it and kawaam!! It works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-4d2DVTWIQ-s/Ts-2H9gtgKI/AAAAAAAAAEY/_snblB5gEfk/s1600/CheckList+screenshot.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-4d2DVTWIQ-s/Ts-2H9gtgKI/AAAAAAAAAEY/_snblB5gEfk/s320/CheckList+screenshot.JPG" width="145" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="MsoNormal"&gt;For code lovers:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;For the CheckList class itself, I’m adding this method from the code because it was difficult to do so:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; CheckListItemData getItem(&lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; index){&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;try&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; {&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CheckListItemData &lt;span style="background: yellow; mso-highlight: yellow;"&gt;c&lt;/span&gt; = &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; CheckListItemData(0, &lt;/span&gt;&lt;span style="color: #2a00ff; font-family: Consolas; font-size: 10.0pt;"&gt;""&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;, &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;false&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;);&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; (index &amp;gt;=size() || index&amp;lt;0) {&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;return&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; &lt;span style="background: silver; mso-highlight: silver;"&gt;c&lt;/span&gt;;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setSelectedIndex(index, &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;false&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;);&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background: yellow; mso-highlight: yellow;"&gt;c&lt;/span&gt; = (CheckListItemData) getSelectedItem();&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;return&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; &lt;span style="background: silver; mso-highlight: silver;"&gt;c&lt;/span&gt;;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;catch&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; (Exception e) {&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #3f7f5f; font-family: Consolas; font-size: 10.0pt;"&gt;// &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f9fbf; font-family: Consolas; font-size: 10.0pt;"&gt;TODO&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #3f7f5f; font-family: Consolas; font-size: 10.0pt;"&gt;: handle exception&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;return&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt; CheckListItemData(0, &lt;/span&gt;&lt;span style="color: #2a00ff; font-family: Consolas; font-size: 10.0pt;"&gt;"error occured"&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;, &lt;/span&gt;&lt;b&gt;&lt;span style="color: #7f0055; font-family: Consolas; font-size: 10.0pt;"&gt;false&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;);&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 10pt; line-height: 115%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;With this basis, it’s easy to do many other things.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Download the source files &lt;a href="https://skydrive.live.com/?cid=f5c5e1056fac2e69&amp;amp;permissionsChanged=1&amp;amp;id=F5C5E1056FAC2E69%21185#" target="_blank"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-342832491604768578?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/342832491604768578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=342832491604768578&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/342832491604768578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/342832491604768578'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2011/11/no-checklistbox-in-lwuit.html' title='No CheckListBox in LWUIT?'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-4d2DVTWIQ-s/Ts-2H9gtgKI/AAAAAAAAAEY/_snblB5gEfk/s72-c/CheckList+screenshot.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-4491398766785728942</id><published>2011-11-24T14:26:00.000-08:00</published><updated>2011-11-25T07:34:17.660-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='fields'/><category scheme='http://www.blogger.com/atom/ns#' term='source'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='tables'/><category scheme='http://www.blogger.com/atom/ns#' term='wrapper'/><category scheme='http://www.blogger.com/atom/ns#' term='reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='MetaData Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='Metadata'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>db2lang</title><content type='html'>Allow me to introduce db2lang.&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Db2lang is software that creates wrapper classes for your databases entities. It simply generates source code files, nicely formatted, depending the language of your choice. For now, classes can be generated in C#, PHP and Java languages. Additionally, only MySQL and MSSQL are supported. My operations for extension to Oracle, Postgre and others were halted because of my ecclesiastical exile.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Db2lang was conceptualized when I posted a blog on making your classes talk with your database. Around the same time, a thought came to mind to develop a simple program to do this; instead of having to invariably create concrete classes for database connectivity. Thus, db2lang was born. Let me state here that I did not have any knowledge of any database-mapping tool, whatsoever. It was just my own small way of reducing time on writing code, especially for huge projects that I work on. Don’t get me wrong, I wasn’t re-inventing any wheel. &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;It really came in handy when I was single-handedly working on over 40 tables in a single database. The user architecture was becoming complex, let alone the ERD. To sit down and write codes to perform CRUD operations would be time-consuming had it not been for db2lang.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;After successful testing, verification and validation from trusted software engineer colleagues, I feel to make it open to the public. Try it out, and let me know what you think.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;How it works&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Here’s a screen shot:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-P_8TSptfD-U/Ts7CPq51_yI/AAAAAAAAAEQ/Na9c9D-5QyQ/s1600/db2lang.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="214" src="http://3.bp.blogspot.com/-P_8TSptfD-U/Ts7CPq51_yI/AAAAAAAAAEQ/Na9c9D-5QyQ/s320/db2lang.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;So, you select your database provider, enter your credentials (they are not cached anywhere, locally or sent via some unidentified socket to me, lol), select the language in which you want the source files to be generated and the folder, then start the operation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Db2lang works in a simple process I call MetaData Reflection. Reflection here has no reference whatsoever to Java or .NET runtime reflection of objects. MetaData Reflection&lt;i&gt; means &lt;/i&gt;that it accesses your tables in the specified database, retrieves the metadata, map it to the basic types of the selected language and creates simple class properties out of it. Additionally, it creates a service class containing powerful yet simple methods that perform CRUD operations on your database. The property class and service class have filenames which are the same as your table name. Great huh?&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size: 7pt; line-height: 115%;"&gt;One Tiny Hurdle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The current version assumes that your MySQL database port is set to 3306. I shall rectify this in the next release. And oh, a PRO version will come out soon.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;u&gt;How It Really Works&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;For code lovers, here are sample codes in C# (parts of the program were written in Java) on MetaData Reflection:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;summary&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Generates the class files for the specified language&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/summary&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; GenerateClasses()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt;[] thetables = &lt;b&gt;GetTables();&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue;"&gt;string&lt;/span&gt; onetable &lt;span style="color: blue;"&gt;in&lt;/span&gt; thetables)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;bool&lt;/span&gt; notsupported = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;switch&lt;/span&gt; (_langtype)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;general2lang&lt;/span&gt;.&lt;span style="color: #2b91af;"&gt;LanguageType&lt;/span&gt;.CSharp:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;db2cs&lt;/span&gt;(ClassesFolder, onetable, &lt;b&gt;GetFieldsInformation(onetable),&lt;/b&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;._connstring,&lt;span style="color: #a31515;"&gt;"MySql"&lt;/span&gt;).&lt;b&gt;StartFileCreation()&lt;/b&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;general2lang&lt;/span&gt;.&lt;span style="color: #2b91af;"&gt;LanguageType&lt;/span&gt;.Java:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;db2java&lt;/span&gt;(ClassesFolder, onetable, &lt;b&gt;GetFieldsInformation(onetable)&lt;/b&gt;, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._datasource, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._dbname, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._username, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._password).&lt;b&gt;StartFileCreation()&lt;/b&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;general2lang&lt;/span&gt;.&lt;span style="color: #2b91af;"&gt;LanguageType&lt;/span&gt;.PHP:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;db2php&lt;/span&gt;(ClassesFolder, onetable, &lt;b&gt;GetFieldsInformation(onetable)&lt;/b&gt;, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._datasource, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._dbname, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._username, &lt;span style="color: blue;"&gt;this&lt;/span&gt;._password).&lt;b&gt;StartFileCreation();&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;general2lang&lt;/span&gt;.&lt;span style="color: #2b91af;"&gt;LanguageType&lt;/span&gt;.VB:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.&lt;span style="color: #2b91af;"&gt;MessageBox&lt;/span&gt;.Show(&lt;span style="color: #a31515;"&gt;"VB is not supported for now..."&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notsupported = &lt;span style="color: blue;"&gt;true&lt;/span&gt;; &lt;span style="color: #00b050;"&gt;//vb is not ready now&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;default&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (notsupported)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.&lt;span style="color: #2b91af;"&gt;MessageBox&lt;/span&gt;.Show(ex.Message);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;So, &lt;b&gt;&lt;span style="font-family: Consolas; font-size: 12pt; line-height: 115%;"&gt;GetTables()&lt;/span&gt;&lt;/b&gt;retrieves all the tables under the chosen database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Consolas; font-size: 12pt; line-height: 115%;"&gt;GetFieldsInformation(onetable) &lt;/span&gt;&lt;/b&gt;returns the metadata about a particular field in the database&lt;b&gt;&lt;span style="font-family: Consolas; font-size: 12pt; line-height: 115%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Consolas; font-size: 12pt; line-height: 115%;"&gt;StartFileCreation() &lt;/span&gt;&lt;/b&gt;creates the data and service class for that particular field in the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;Download the raw .exe and other files &lt;a href="https://skydrive.live.com/?cid=f5c5e1056fac2e69&amp;amp;permissionsChanged=1&amp;amp;id=F5C5E1056FAC2E69%21185#" target="_blank"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-4491398766785728942?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/4491398766785728942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=4491398766785728942&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/4491398766785728942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/4491398766785728942'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2011/11/db2lang.html' title='db2lang'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-P_8TSptfD-U/Ts7CPq51_yI/AAAAAAAAAEQ/Na9c9D-5QyQ/s72-c/db2lang.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-2800965331044518270</id><published>2011-11-10T05:21:00.003-08:00</published><updated>2011-11-10T05:21:11.454-08:00</updated><title type='text'>Back</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I'm back from my ecclesiastical exile.&lt;br /&gt;&lt;br /&gt;Get ready for more on software engineering.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-2800965331044518270?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/2800965331044518270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=2800965331044518270&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2800965331044518270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2800965331044518270'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2011/11/back.html' title='Back'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-6978036091897508723</id><published>2009-10-12T05:27:00.000-07:00</published><updated>2009-10-13T07:03:56.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wrapper'/><category scheme='http://www.blogger.com/atom/ns#' term='J2ME'/><category scheme='http://www.blogger.com/atom/ns#' term='download'/><category scheme='http://www.blogger.com/atom/ns#' term='JavaME'/><category scheme='http://www.blogger.com/atom/ns#' term='library'/><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='jSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='refactor'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><category scheme='http://www.blogger.com/atom/ns#' term='codes'/><category scheme='http://www.blogger.com/atom/ns#' term='RMS'/><title type='text'>jSQL release 2</title><content type='html'>&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;I'm happy to announce release 2 of &lt;a href="http://austinejei.blogspot.com/2009/09/introducing-jsqlrms-simplified.html"&gt;jSQL&lt;/a&gt;, the much easy-to-use JavaME (or J2ME) wrapper library for Record Management Store(RMS).&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Release Notes:&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;1. Refactored code for optimization&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;2. Fully documented&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Download packages:&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;1.&amp;nbsp;&lt;a href="http://www.mediafire.com/file/0zohgy11e3o/undefined"&gt;jSQL v1.0.2&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;2.&amp;nbsp;&lt;a href="http://www.mediafire.com/file/dmuy24hlm15/doc.zip"&gt;jSQL Javadoc&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-6978036091897508723?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/6978036091897508723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=6978036091897508723&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6978036091897508723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6978036091897508723'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/10/jsql-release-2.html' title='jSQL release 2'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-6047156317282582024</id><published>2009-10-12T05:26:00.000-07:00</published><updated>2011-11-29T08:43:22.415-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='platform'/><category scheme='http://www.blogger.com/atom/ns#' term='Secre'/><category scheme='http://www.blogger.com/atom/ns#' term='session'/><category scheme='http://www.blogger.com/atom/ns#' term='Canvas'/><category scheme='http://www.blogger.com/atom/ns#' term='iFrame'/><category scheme='http://www.blogger.com/atom/ns#' term='API Key'/><category scheme='http://www.blogger.com/atom/ns#' term='URL'/><category scheme='http://www.blogger.com/atom/ns#' term='FBJS'/><category scheme='http://www.blogger.com/atom/ns#' term='register'/><category scheme='http://www.blogger.com/atom/ns#' term='sessionID'/><category scheme='http://www.blogger.com/atom/ns#' term='Facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='permissions'/><category scheme='http://www.blogger.com/atom/ns#' term='FMBL'/><category scheme='http://www.blogger.com/atom/ns#' term='account'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Working with Facebook Platform</title><content type='html'>&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;Before you read:&lt;/b&gt; &lt;i&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;This article is like 2 years old now. Facebook has sort-of changed their connectivity architecture. Please read more on this at http://developers.facebook.com&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I had a really difficult time trying to develop a simple page on the Facebook platform. It demanded lots of time and effort. It was like i was in a whole new world of re-organised programming platform. Talk about Facebook Markup Language, Facebook Query Language, Facebook JavaScript, the API itself, &amp;nbsp;etc.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;You can get really knocked out as to why they have to define their own way for programmers to follow. But hey, i respect their architecture. You can't just play around with people's publicly personal accounts. (lol!!).&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;After about 3 weeks of battling with the platform, i finally got the modus operandi. As i always do, when i get knowledge, i share.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;I've written this post to guide newbies (or dummies, if you're one) on how to create a Facebook Application.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;As usual, i assume you already have some basic skills in programming especially Javascript, PHP, or even the ASP.NET languages (C#, VB.NET).&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Ok, let's start. I'm going to do 6 things.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;1. Briefly introduce you to the Facebook platform&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;2. Crawl with you through the pre-requisites&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;3. Walk you you through your application setup and settings&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;4. Run with you through an example code&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;5. Fly with you through 1 or 2 high level intricacies.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;6. Kick you outta here to start your own application.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;span style="font-size: x-large;"&gt;1. Intro&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Facebook's developer platform enables developers to use any programming language to query their API via REST calls. As such, you can develop both desktop and web applications to do practically the same thing; update status, comment on status, view friend's profiles, it even goes to reading mails, uploading multimedia and send SMS. Awesome init?&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;span style="font-size: x-large;"&gt;2. Let's crawl&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Of course, you need to have a&amp;nbsp;Facebook&amp;nbsp;account before you can develop/host your application on their framework. So, after you login,&amp;nbsp;&lt;b&gt;go to the bottom of the page and click on 'Developers'.&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMDJNTZTwI/AAAAAAAAAC8/RtHy-ukTiAw/s1600-h/fb1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMDJNTZTwI/AAAAAAAAAC8/RtHy-ukTiAw/s320/fb1.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;span style="font-size: x-large;"&gt;3. Walk with me:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Are you on the developer's page? Ok, now click on '&lt;span style="font-family: 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: small;"&gt;&lt;span style="font-size: 13px; line-height: 16px;"&gt;Start Building for your site&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #333333; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: 12px;"&gt;&lt;span style="background-color: transparent; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; color: white; cursor: pointer; display: inline !important; font-size: 13px; font-weight: bold; line-height: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-shadow: rgb(77, 136, 53) 0px 1px 0px; width: auto;"&gt;&lt;span style="color: black; font-family: 'Times New Roman'; font-size: medium; font-weight: normal; line-height: normal;"&gt;'.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_eWKHxZe7vjY/StMDPbrv_ZI/AAAAAAAAADE/_WaGYFZY7WM/s1600-h/fb2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_eWKHxZe7vjY/StMDPbrv_ZI/AAAAAAAAADE/_WaGYFZY7WM/s200/fb2.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;A wizard-like setup page appears. Enter your details as shown. Click 'Next Step'&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_eWKHxZe7vjY/StMDVggsfyI/AAAAAAAAADM/bu1f63XRrOk/s1600-h/fb3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_eWKHxZe7vjY/StMDVggsfyI/AAAAAAAAADM/bu1f63XRrOk/s320/fb3.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;You can safely ignore step 2 (Try it if you're that curious)&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;That's it.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Do you see a page similar to the one shown below?&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMDeFmZjjI/AAAAAAAAADU/VlAimrMh6j4/s1600-h/fb4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMDeFmZjjI/AAAAAAAAADU/VlAimrMh6j4/s400/fb4.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Great!!&amp;nbsp;&lt;b&gt;Copy your API Key and Secret&lt;/b&gt;. They are the the lifeblood of your application. Click on 'Developer Dashboard'. Allow access to the next page. As you might a little confused, the page you are entering is in itself a Facebook Application. It is a sort of control panel for all your applications (yeah, i said applications; you can setup more than 1).&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Ok, now click your application name. (shaded yellow in the image below)&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMFAWDkVyI/AAAAAAAAADc/ftQHFWHSOxk/s1600-h/fb5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMFAWDkVyI/AAAAAAAAADc/ftQHFWHSOxk/s320/fb5.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;The next page is the actual control panel for your new application.Click on 'Edit Settings'.&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMFmzLGjRI/AAAAAAAAADk/xh1iqRfkIsU/s1600-h/fb6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_eWKHxZe7vjY/StMFmzLGjRI/AAAAAAAAADk/xh1iqRfkIsU/s320/fb6.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;The next page presents you with a host of options. You can perform 1001 customizations on your application. Go through it, be curious!! One important page is on &amp;nbsp;'Canvas'.&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_eWKHxZe7vjY/StMGUwe7AHI/AAAAAAAAADs/kTHUZ0gUMeg/s1600-h/FB7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_eWKHxZe7vjY/StMGUwe7AHI/AAAAAAAAADs/kTHUZ0gUMeg/s320/FB7.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;The portions shaded yellow are those i deem important. The first textfield requires you to specify just a URL name for your application. The next textfield is where you have to enter the exact URL to your index page (e.g. http://www.mytextApp.com). This page would be automatically loaded to the Facebook platform when a user visits your application.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;The next step is to specify the render method. As far as i know, Facebook renders your application as either iFrame or FBML. I like FBML;it enables you to use FBJS and FBML tags that would be intepreted and nicely rendered on your page. Read more&amp;nbsp;&lt;a href="http://wiki.developers.facebook.com/index.php/Choosing_between_an_FBML_or_IFrame_Application"&gt;here&lt;/a&gt;. Save your changes.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;4. Ready to run?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Honestly writing, the only example i got was on the main dashboard. Click on 'Back to my Applications' at the top. Scroll down and click on the hyperlinked text 'example code'.&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_eWKHxZe7vjY/StMIfJ1yNZI/AAAAAAAAAD0/SWI_j3m8WYg/s1600-h/f8.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_eWKHxZe7vjY/StMIfJ1yNZI/AAAAAAAAAD0/SWI_j3m8WYg/s320/f8.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;This pops up a dialog containing PHP codes. Yipeeeee!! Are we done? NO!! When you inspect the code, do you see 'require_once facebook.php' and a line of code that reads&amp;nbsp;&lt;span style="font-family: monospace; white-space: pre;"&gt;$facebook = new Facebook($appapikey, $appsecret);&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Where did they get that? It's a PHP client library and it's freeeee!!. You can get on the same page. Scroll down and click on 'Download the Client Library'.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;What about .NET folks? Get yours &lt;a href="http://www.codeplex.com/FacebookNET"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Java lovers, try &lt;a href="http://wiki.developers.facebook.com/index.php/Java"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;5. Let's fly&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Be patient!! Facebook offers high-level security to their account holders. Before you can do anything, the user needs to grant permission for your application. That permission can either be temporal or permanent.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Let me explain.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Anytime a user visits your page, Facebook transfers a session ID to your application. You can use this to get user's status update, list friends, groups or events. You can even use this to access the user's account offline. However, the user again needs to grant that permission; and this means you have to save it to a database.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Read on permissions &lt;a href="http://wiki.developers.facebook.com/index.php/Extended_permissions"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;Get more info on using session IDs &lt;a href="http://www.emcro.com/blog/2009/01/facebook-infinite-session-keys-no-more/"&gt;here&lt;/a&gt; or &lt;a href="http://www.henrycipolla.com/blog/2008/02/how-to-create-infinite-sessions-with-the-facebook-platform-api/"&gt;there&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="white-space: pre;"&gt;6. I encourage you to be more curious. Play with the platform. It's fun.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-6047156317282582024?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/6047156317282582024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=6047156317282582024&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6047156317282582024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6047156317282582024'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/10/working-with-facebook-platform.html' title='Working with Facebook Platform'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_eWKHxZe7vjY/StMDJNTZTwI/AAAAAAAAAC8/RtHy-ukTiAw/s72-c/fb1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-1037166817886069170</id><published>2009-09-08T09:03:00.000-07:00</published><updated>2009-09-09T03:48:45.556-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lightweight'/><category scheme='http://www.blogger.com/atom/ns#' term='powerful'/><category scheme='http://www.blogger.com/atom/ns#' term='read'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='jSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='update'/><category scheme='http://www.blogger.com/atom/ns#' term='RMS'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='download'/><category scheme='http://www.blogger.com/atom/ns#' term='delete'/><category scheme='http://www.blogger.com/atom/ns#' term='JavaME'/><category scheme='http://www.blogger.com/atom/ns#' term='Record Management Store'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='insert'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBeans'/><title type='text'>Introducing jSQL...RMS simplified</title><content type='html'>Working with Record Management Store (RMS) on JavaME can exhaust man hours if you are not so conversant with its operations. You may end up not storing anything at all or finding it hard to update your data.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I want to introduce you to jSQL, a powerful, lightweight JavaME library purposefully written to ease your burden when working with RMS. And guess what? IT IS FREEE!!!!...but source is not available till further notice.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Facts&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;physical size:&lt;/b&gt; 5KB&lt;/li&gt;&lt;li&gt;&lt;b&gt;Platform:&lt;/b&gt; JavaME&lt;/li&gt;&lt;li&gt;&lt;b&gt;IDEs: &lt;/b&gt;any JavaME supported IDEs such as Eclipse, NetBeans &lt;/li&gt;&lt;li&gt;&lt;b&gt;Performance:&lt;/b&gt; superb....unlike any other&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can &lt;a href="http://www.mediafire.com/?sharekey=1a252322d9e3901e95af63b7d44918aa9f4189005e1e6f13"&gt;download&lt;/a&gt; zip file containing jSQL jar file, source documentation in .zip format and a sample code file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Release notes&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;i&gt;Version 1.0.1  - September 2009&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;first public release&lt;/div&gt;&lt;div&gt;has methods to insert, update, delete or read data from RMS.&lt;/div&gt;&lt;div&gt;very lightweight, simple and easy to use.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-1037166817886069170?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/1037166817886069170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=1037166817886069170&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/1037166817886069170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/1037166817886069170'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/09/introducing-jsqlrms-simplified.html' title='Introducing jSQL...RMS simplified'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-9033697943741350228</id><published>2009-08-20T09:16:00.000-07:00</published><updated>2009-08-26T07:03:50.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='process'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='listeners'/><category scheme='http://www.blogger.com/atom/ns#' term='threads'/><category scheme='http://www.blogger.com/atom/ns#' term='SMS'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='custom event'/><category scheme='http://www.blogger.com/atom/ns#' term='invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='JavaME'/><category scheme='http://www.blogger.com/atom/ns#' term='interface'/><category scheme='http://www.blogger.com/atom/ns#' term='instance'/><title type='text'>Make your MIDlets Eventful</title><content type='html'>This article shows you how to create custom events on the JavaME platform.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's as easy as my other article on .NET custom events.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Events are needed so as to display information on threaded (background) process that cannot be readily rendered on the UI controls. An example is sending SMS. The user may want to know 'what is going on?' as against how it is done.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'll use the same example in my previous article on SMS.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's box on then!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First we need an event class. This acts like the messaging item that would be read from the UI.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So we do: &lt;/div&gt;&lt;div&gt;public class MessageSenderEvent{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public MessageSenderEvent(String msg){&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;currentStatus = msg;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public String currentStatus;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next we need the event listener interface. This has to be implemented in our UI to listen and display status updates from the MessageSender class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public interface MessageSenderEventListener{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void statusUpdated(MessageSenderEvent e);&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Third, we need to modify our MessageSender class.&lt;/div&gt;&lt;div&gt;So,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;import javax.microedition.io.Connector;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;import javax.wireless.messaging.MessageConnection;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;import javax.wireless.messaging.TextMessage;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; * Class to send SMS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; * @author Augustine&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; *&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; */&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public class MessageSender {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; private MessageSenderEventListener listener = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;public void setMessageSenderEventListener(MessageSenderEventListener alistener){&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;this.listener = alistener;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;protected void onStatusUpdated(MessageSenderEvent e){&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if(listener!=null){&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//invokes the method on the interface...&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;listener.&lt;span class="Apple-style-span" style="white-space: normal; "&gt;statusUpdated(e);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;private String themessage;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;private String destination;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;private MessageConnection conn;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; * Sends an SMS.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; * The destination number is retrieved internally from AdminSettings class&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; * @param message The message to be sent. The message prefix would be appended to it.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; */&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void sendMessage(String message,String destination){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;themessage = message;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;destination = destination;&lt;span class="Apple-style-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  onStatusUpdated(new MessageSenderEvent("Beginning..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Thread msgThread = new Thread() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void run() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// sets address to send message&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;System.out.println(destination);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;System.out.println("Message: " + themessage);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;String addr = "sms://" +destination + ":2000";&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// opens connection&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;onStatusUpdated(new MessageSenderEvent("Establishing connection..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;conn = (MessageConnection) Connector.open(addr,2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;onStatusUpdated(new MessageSenderEvent("Connection established..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// prepares text message&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// set text&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;msg.setPayloadText(themessage);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;onStatusUpdated(new MessageSenderEvent("Preparing to send..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// send message&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;conn.numberOfSegments(msg);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;onStatusUpdated(new MessageSenderEvent("Sending..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;conn.send(msg);//sends the message&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;onStatusUpdated(new MessageSenderEvent("Message sent...\nClosing connection..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;conn.close();//closes the connection&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;onStatusUpdated(new MessageSenderEvent("Connection closed..."));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;} catch (Exception e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;onStatusUpdated(new MessageSenderEvent("An error has occured...\n" + e.getMessage()));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;finally{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;if (conn!=null) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;conn.close();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;} catch (Exception e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// TODO: handle exception&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;msgThread.setPriority(Thread.NORM_PRIORITY);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;msgThread.start();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you can see, we created an instance of our interface, and provided a method (setMessageSenderEventListener(...)) to set the listener to an instance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, we can work off something...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We can now do this in our UI:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public class MyMIDlet extends MIDlet implements &lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;MessageSenderEventListener&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public MyMIDlet(){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void startApp(){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;try{&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;MessageSender sender = new MessageSender();&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;sender.sendMessage("hello world","+233123456789");&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;sender.setMessageSenderEventListener(this);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void pauseApp(){}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void destroyApp(boolean unconditional){}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//overriden method in interface&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#6666CC;"&gt;public void &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#6666CC;"&gt;onStatusUpdated(MessageSenderEvent e)&lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//code goes here for displaying status updates&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;System.out.println(&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;e.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: normal; "&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;currentStatus&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;And were done!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-9033697943741350228?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/9033697943741350228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=9033697943741350228&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/9033697943741350228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/9033697943741350228'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/08/make-your-midlets-eventful.html' title='Make your MIDlets Eventful'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-8397454637717950178</id><published>2009-07-31T02:35:00.000-07:00</published><updated>2009-08-20T09:16:14.440-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javax.wireless.messaging'/><category scheme='http://www.blogger.com/atom/ns#' term='mobile phones'/><category scheme='http://www.blogger.com/atom/ns#' term='application'/><category scheme='http://www.blogger.com/atom/ns#' term='MessageSender'/><category scheme='http://www.blogger.com/atom/ns#' term='system calls'/><category scheme='http://www.blogger.com/atom/ns#' term='SMS'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless'/><category scheme='http://www.blogger.com/atom/ns#' term='blocking'/><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='JavaME'/><category scheme='http://www.blogger.com/atom/ns#' term='protocol'/><category scheme='http://www.blogger.com/atom/ns#' term='MIDlet'/><category scheme='http://www.blogger.com/atom/ns#' term='messaging'/><category scheme='http://www.blogger.com/atom/ns#' term='try/catch'/><category scheme='http://www.blogger.com/atom/ns#' term='text message'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Sending SMS using JavaME</title><content type='html'>This article is to show you how to use JavaME text messaging API to send simple text message.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I already assume you know Java programming language, as well as JavaME and have a little basis on its grand architecture to permeate Java on every hardware platform.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;OK. SMS on mobile phones is a protocol much like 'http://'. But most (if not all) mobile phones do this for you by providing two textboxes where you input destination number and message.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the JavaME platform, you need to invoke higher API calls via interface objects; the runtime engine on the host system would then perform necessary low-level system calls to send the message to the specified number.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The codes below is a class that you can re-use in your MIDlet application. It has only one method 'sendSMS' which takes two java.lang.String arguments, destination and message.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;import javax.microedition.io.Connector;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;import javax.wireless.messaging.MessageConnection;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;import javax.wireless.messaging.TextMessage;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;/**&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; * Class to send SMS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; * @author Augustine&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; *&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; */&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;public class MessageSender {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;private String themessage;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;private String thedestination;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;/**&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; * Sends an SMS.&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; * The destination number is retrieved internally from AdminSettings class&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; * @param message The message to be sent. The message prefix would be appended to it.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; */&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;public void sendMessage(String destination,String message){&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;themessage = message;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  the&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;destination = destination;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  &lt;span class="Apple-style-span" style="white-space: normal; "&gt;MessageConnection conn = null;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;Thread msgThread = new Thread() {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;   &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;public void run() {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;try {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;// sets address to send message&lt;span class="Apple-style-span" style="white-space: pre; "&gt;    &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;String addr = "sms://" +thedestination;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;// opens connection&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;conn = (MessageConnection) Connector.open(addr,2);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;// prepares text message&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;// set text&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;msg.setPayloadText(themessage);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;// send message&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;conn.numberOfSegments(msg);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;conn.send(msg);//sends the message&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;conn.close();//closes the connection&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;} catch (Exception e) {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;     &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;System.out.println( "from Message Sender: " + e.getMessage());&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;    finally{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;try{&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if(conn!=null)&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;  &lt;/span&gt;conn.close();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;catch(Exception fe){&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;   &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;};&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;msgThread.setPriority(Thread.NORM_PRIORITY);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;msgThread.start();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All you need to do is just create an instance of the class, call the method and that's it.&lt;/div&gt;&lt;div&gt;If you're worried about determining whether the message went or not, it's not your problem!! The user's phone would bounce back a message like 'Test Message Failed' if the phone is out of network coverage or not enough credits to send message.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However you can modify the code to return boolean value in its try/catch statement blocks. I must warn you that most methods in 'javax.wireless.messaging' package are &lt;i&gt;very&lt;/i&gt; blocking and require you to spin them on a thread.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-8397454637717950178?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/8397454637717950178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=8397454637717950178&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8397454637717950178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8397454637717950178'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/07/sending-sms-using-javame.html' title='Sending SMS using JavaME'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-7640918668616827502</id><published>2009-06-09T07:16:00.000-07:00</published><updated>2009-06-09T07:36:49.551-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='EditorPane'/><category scheme='http://www.blogger.com/atom/ns#' term='client'/><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='file'/><category scheme='http://www.blogger.com/atom/ns#' term='print'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><category scheme='http://www.blogger.com/atom/ns#' term='WebBrowser'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBeans'/><title type='text'>Tried HTML for reports?</title><content type='html'>HTML is hypertext markup language. It specfied what should be displayed and how it should be displayed.&lt;div&gt;&lt;br /&gt;&lt;div&gt;This is a powerful way to neatly present your output items from a data list.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Think of how you can incorporate the sleek, eye-catching scenes of cascaded style sheets.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I recently realized this easy way when i was pressured by a client to display its information in a certain way before printing. hwew! now the trouble is over.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This article is for both .NET and Java guys. However it can be suited to any programming platform if these basic steps are followed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Both .NET and Java have 'Something'.IO.File class. Good!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. All you need to do is to generate a string of html codes from your program and save it as a '.html' or '.htm' when writing to a file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Load the file into a web browser component on your form. &lt;/div&gt;&lt;div&gt;For Visual Studio lovers, just drop a WebBrowser control (name it say 'browser') on your form. Add 2 buttons for load and print. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the load button's click event, add the following lines of code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;browser.Navigate('myfile.html');//navigates to the file path&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the print button's click event, add the following lines of code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;browser.Print();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Java user, especially NetBeans IDE followers, just drop an EditorPane to your form. Call it say 'browser'. Add 2 buttons for loading and printing.&lt;/div&gt;&lt;div&gt;In the click event handler for the load button, add the following code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;    &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;browser.setContentType("text/html");&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;browser.setPage('myfile.html');&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the click event handler for the print button, add the following code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;   &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;browser.print();&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    That's it!!&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-7640918668616827502?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/7640918668616827502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=7640918668616827502&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/7640918668616827502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/7640918668616827502'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/06/tried-html-for-reports.html' title='Tried HTML for reports?'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-8771753688358585327</id><published>2009-03-28T04:34:00.000-07:00</published><updated>2009-06-18T05:29:35.280-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='requirements'/><category scheme='http://www.blogger.com/atom/ns#' term='CustomerService'/><category scheme='http://www.blogger.com/atom/ns#' term='delegates'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='custom events'/><category scheme='http://www.blogger.com/atom/ns#' term='simple'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='custom event'/><title type='text'>Making your applications Eventful</title><content type='html'>This is an area where most developers may not want to go.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Creating custom events has been simplified in this article. &lt;/div&gt;&lt;div&gt;Oh, i forgot. This blogpost goes only for .NET framework programmers specifically C# guys.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Requirements&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;To create events you need some few things....&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;a void delegate to act as the event method invoker&lt;/li&gt;&lt;li&gt;an event argument class&lt;/li&gt;&lt;li&gt;the event name itself&lt;/li&gt;&lt;li&gt;your programming skills...&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Lets say we have a class called CustomerService that provides services on a Customer class. For the sake of simplicity we would only concern ourself with an AddCustomer method. Below is a simple detail of what i'm writing about...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;namespace MyServices{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//this delegate would be used to invoke the event when a new customer is added to the database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public delegate void CustomerAddedEventHandler(object sender, CustomerAddedEventArgs e );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public class CustomerService{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//this is the main event that would be called when a customer has been added....&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public event CustomerAddedEventHandler CustomerAdded;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public void AddCustomer(Customer customer){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//we do all the db connections,  add the customer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//then we call the OnCustomerAdded method to fire the event&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;CustomerAddedEventArgs e = new CustomerAddedEventArgs(customer);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;OnCustomerAdded(e);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;protected virtual void OnCustomerAdded(CustomerAddedEventArgs e){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;if(CustomerAdded!=null){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;CustomerAdded(this,e);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//this class would be used as an argument in the main event&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public class CustomerAddedEventArgs{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public CustomerAddedEventArgs(Customer theCustomer){&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;OneCustomer = theCustomer;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;private Customer onecus  = new Customer()&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public Customer OneCustomer { get{return onecus;} private set{onecus=value;}}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's assume there's a button called AddCustomer....so in it's click event, we would write the following...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;void button1_click(object sender, EventArgs e){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Customer c = new Customer();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;CustomerService cus = new CustomerService();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//after typing +=, visual studio would automatically create a method to handle the incoming //event.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;cus.CustomerAdded += CustomerAddedEventHandler(cus_CustomerAdded);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//we then assign values to the customer properties...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//e.g. c.Surname = txtsur.Text &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//and so on&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;cus.AddCustomer(c);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;//this method is created automatically by VS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;void cus_CustomerAdded(object sender, CustomerAddedEventArgs e){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;MessageBox.Show("1 customer has been added");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That is all there is to it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-8771753688358585327?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/8771753688358585327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=8771753688358585327&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8771753688358585327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8771753688358585327'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/03/making-your-applications-eventful.html' title='Making your applications Eventful'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-1191101288467880871</id><published>2009-03-27T04:01:00.000-07:00</published><updated>2009-03-27T04:12:06.387-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Dataset'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='crystal'/><category scheme='http://www.blogger.com/atom/ns#' term='crystal reports'/><category scheme='http://www.blogger.com/atom/ns#' term='School Management System'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='ActiveX'/><category scheme='http://www.blogger.com/atom/ns#' term='reports'/><title type='text'>Crystal Reports made easy</title><content type='html'>I bet you’ve heard that phrase over and over and over again: …‘MADE EASY’!!&lt;br /&gt;Well, you might just nod to this piece too if you follow what I have for you.&lt;br /&gt;Crystal Reports are an easy-to-do report designer incorporated into Visual Studio .NET suite. It comes as an ActiveX drag-drop UI design component. That’s the easy part. Everyone can try their hands on it. But the issue arises when you need to display the report programmatically, especially from a database. Hmmm!!!....smyl……this article shows you just how to do that.&lt;br /&gt;Now I assume have all the classes in place to connect and retrieve data from your database.&lt;br /&gt;Let’s assume a School Management System where we have a service class called StudentService and a data class called StudentDetails. Now we want to display all student details (name, age, address, year, course, etc.) in the crystal report.&lt;br /&gt;As procedure requires, add the following items to your project:&lt;br /&gt;i. Crystal report document (call it ‘MyReport’)&lt;br /&gt;ii. Dataset (let’s call it ‘StudentSet’)&lt;br /&gt;iii. Windows form (name it ‘PreviewForm’)&lt;br /&gt;Starting with the dataset, create a new table (might be the same name as the student details table in my database). Add the columns you want to display (such as name, age). We’re done with the dataset.&lt;br /&gt;Switch to the crystal report document. Right click on ‘Database Fields’ and click ‘Database Manager’. In the window that appears, expand the ‘Project Data’ tree, then expand ‘ADO.NET DataSets’. Have you seen our dataset there? Great! Select it and click on the button captioned ‘&gt;’. We’re done! Click finish.&lt;br /&gt;Now expand the ‘Database Fields’ tree. Have you observed that our data table is there? Expand it. Now drag each item under the node onto ‘Section 3 (Details)’ portion of the crystal report document. Voila…we made it.&lt;br /&gt;Open the windows form and add a crystal report viewer, name it ‘cpviewer’. Change its modifier property to ‘’public’. That’s it for this part.&lt;br /&gt;On to coding…&lt;br /&gt;Place the following method in your code:&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;public void ViewReport(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;Try{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;//lets say we have a method in StudentService called GetAllStudents() that returns a list of StudentDetails&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;MyReport report = new MyReport();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;Report.SetDataSource(new StudentService().GetAllStudents()); //our datasource is now set…let’s go on and preview it….&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;PreviewForm pform = new PreviewForm();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;pform.cpviewer.ReportSource = report; //assigns the report source&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;pform.ShowDialog() //..aha…there it is….we’re done…&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;catch(Exception ex){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;System.Windows.Forms.MessageBox.Show(ex.Message);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;Get it? That’s it…just a few lines of code that save you lot’s of time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-1191101288467880871?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/1191101288467880871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=1191101288467880871&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/1191101288467880871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/1191101288467880871'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/03/crystal-reports-made-easy.html' title='Crystal Reports made easy'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-5494674688071993686</id><published>2009-03-06T06:41:00.000-08:00</published><updated>2009-03-06T08:01:38.029-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='topic'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='online'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='ActiveRecords'/><category scheme='http://www.blogger.com/atom/ns#' term='shopping'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='web page'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='CustomerDetails'/><title type='text'>The concept of data and service objects</title><content type='html'>I thought i would never blog again....&lt;br /&gt;&lt;br /&gt;Back to the topic.&lt;br /&gt;&lt;br /&gt;Ever been entangled in the web of database connections? Here's a way to alleviate your task.&lt;br /&gt;I've already posted a blog on 'how to make classes talk to databases!'. This is an emphasis on such a fantastic back-end design model, sometimes referred to as ActiveRecords.&lt;br /&gt;&lt;br /&gt;As an example, i was once creating a design for an online shopping portal for books using JSP. It took me less than half of the stipulated time frame to realize the implementation. This was due to the meticulous approach to the design.&lt;br /&gt;&lt;br /&gt;Lets use an entity in the database called 'customers.'&lt;br /&gt;&lt;br /&gt;The customers table has the following attributes:&lt;br /&gt;i] customerid&lt;br /&gt;ii] fullname&lt;br /&gt;iii] address&lt;br /&gt;iv] creditcardnumber, etc.&lt;br /&gt;&lt;br /&gt;In order to easily communicate with the db, i created a simple CustomerDetails class to hold data and a Customer class to provide services to the CustomerDetails class.&lt;br /&gt;&lt;br /&gt;Consider the contents of an interface to the CustomerDetails class, written in crud C#:&lt;br /&gt;public interface ICustomerDetails {&lt;br /&gt; &lt;br /&gt;    public int CustomerID{get;set;}&lt;br /&gt;&lt;br /&gt;    public string Fullname&lt;br /&gt;       { get; set;}&lt;br /&gt;&lt;br /&gt;       public string Address{ get;set;}&lt;br /&gt;&lt;br /&gt;       public string CreditCardNumber{get;set}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Consider also the contents of an interface for the Customer class, also in C#.&lt;br /&gt;&lt;br /&gt;public interface ICustomerServices{&lt;br /&gt;       public void AddCustomer(ICustomerDetails customer);&lt;br /&gt;&lt;br /&gt;               public bool IsSuccessful{get};&lt;br /&gt;&lt;br /&gt;              public void UpdateCustomer(ICustomerDetails oldcustomer,ICustomerDetails newcustomer);&lt;br /&gt;&lt;br /&gt;        public void UpdateCustomer(ICustomerDetails customer, int id);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       public void DeleteCustomer(int id);&lt;br /&gt;&lt;br /&gt;         public ICustomerDetails[] FindCustomer(int id);&lt;br /&gt;&lt;br /&gt;         public ICustomerDetails[] FindCustomer(string field, object item);&lt;br /&gt;&lt;br /&gt;         public ICustomerDetails[] FindCustomer(string field, object item, string operator);&lt;br /&gt;&lt;br /&gt;//...and many more services...&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I bet you that this design model would really lighten the burdern of fixing database connection scripts (harpharzadly) in your web pages, especially when working with PHP or JSP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-5494674688071993686?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/5494674688071993686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=5494674688071993686&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/5494674688071993686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/5494674688071993686'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/03/concept-of-data-and-service-objects.html' title='The concept of data and service objects'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-6734416643064991557</id><published>2009-01-13T00:48:00.000-08:00</published><updated>2009-01-13T00:53:17.802-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='delegates'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='stop'/><category scheme='http://www.blogger.com/atom/ns#' term='threads'/><category scheme='http://www.blogger.com/atom/ns#' term='operation'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='worker'/><category scheme='http://www.blogger.com/atom/ns#' term='fire and forget'/><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='pointers'/><category scheme='http://www.blogger.com/atom/ns#' term='background'/><category scheme='http://www.blogger.com/atom/ns#' term='cross-thread'/><category scheme='http://www.blogger.com/atom/ns#' term='asynchronous'/><category scheme='http://www.blogger.com/atom/ns#' term='background worker'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='synchronous'/><category scheme='http://www.blogger.com/atom/ns#' term='pause'/><title type='text'>Threads vrs. Delegates</title><content type='html'>Ah haaa...this is what you've been waiting for...finally it's here.&lt;br /&gt;What are my views on this interesting topic? hmmm...let's find out!&lt;br /&gt;&lt;br /&gt;Threads, they say, are fire and forget 'things'..once you create and start'em...you MAY not have control over them.&lt;br /&gt;&lt;br /&gt;My little experience with threads were quite a battle for control. At least i thought i had control when i developed QuickSearch because i was able to 'control' the underlying thread by 'pausing' or 'stopping' it altogether.&lt;br /&gt;To be frank, I love threads. When i somehow discovered its swift executing power, i quickly threaded all my controls...but i came to a wall. Since most .NET components are single threaded, i battled with 'cross thread operation' error messages. After extensive research, i found the 'InvokeRequired' property of most .NET UI controls.&lt;br /&gt;Going deeper, i came to a point of thread synchronization. It was where i learnt how to use the 'lock' keyword. The worse part of threads was that it does not return any value. All target threaded methods are void. Nonetheless, it was fun but tidious.&lt;br /&gt;&lt;br /&gt;Look at this example;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public class MyThread{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    private int num1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    private int num2;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    public int FirstNumber{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;        get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;return this.num1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;set{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;this.num1 = value;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public int SecondNumber{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;return this.num2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;set{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;this.num2 = value;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public int SumOfNumbers{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    return NumberSum;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;private int sum;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;private int NumberSum{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;return sum;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;set{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;sum = value;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;private void SumTheNumbers(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    int total = FirstNumber + SecondNumber;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    NumberSum = total;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    System.Windows.Forms.MessageBox("Done");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public void CalculateSum(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    System.Threading.Thread thrcal = new System.Threading.Thread();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    thrcal.Start(new System.Threading.ThreadStart(SumTheNumbers));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The 'tidious' nature of keeping up with my love for threads lead me into the world of delegates. If you don't know the history, let me be a story teller for some seconds. Remember in C++, you had to declare function pointers, right? Yes, and at the end you had to delete yourself.&lt;br /&gt;&lt;br /&gt;C# takes care of this burden by introducing delegates. Essentially, delegates are function pointers with more capability.&lt;br /&gt;As the name sounds, you 'delegate'  or assign method to be executed separately.They can be invoked both synchronously and asynchronously. Though the declaration is a bit confusing in the beginning, you would come to appreciate its value in the course of your programming life.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public class MyDelegate{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;//this is the 'pointer' signature for the delegate...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public delegate int SumCalculator(int n1, int n2);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    private int num1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    private int num2;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    public int FirstNumber{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;        get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;return this.num1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;set{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;this.num1 = value;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public int SecondNumber{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;return this.num2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;set{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;this.num2 = value;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;//this property synchronously returns the sum of the other two properties&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public int SumOfNumbersSync{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    //creates a type of our delegate&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    SumCalculator summa = new SumCalculator(CalculateSum);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    return summa.Invoke(FirstNumber,SecondNumber);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;//this property asynchronously returns the sum of the other two properties&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;public int SumOfNumbersAsync{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;get{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    SumCalculator summa = new SumCalculator(CalculateSum);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    //this would be our call back variable..it points to the call back function when the operation is done.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    AsyncCallback calb = new AsyncCallback(CalculateCompleted);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    object state =new object();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    return summa.BeginInvoke(calb,FirstNumber,SecondNumber,state);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;//this is the call back function. Note that it must take this method signature&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;//1.must be void&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;//2.must have one argument of type IAsyncResult&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;private void CalculateCompleted(IAsyncResult ar){&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    System.Windows.Forms.MessageBox.Show("Done.");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;private int CalculateSum(int num1,int num2){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;    return num1 + num2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see, this is the power of delegates.&lt;br /&gt;&lt;br /&gt;Conclusion?, i think that they might be more helpful to use than 'raw-spun' threads.&lt;br /&gt;&lt;br /&gt;Hey, have you heard or seen the Background Worker control in your VS toolbox. If you're thinking of threading or delegating windows controls without code hassle, use them; that is why they were created.&lt;br /&gt;&lt;br /&gt;Enjoy delegating.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-6734416643064991557?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/6734416643064991557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=6734416643064991557&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6734416643064991557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6734416643064991557'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2009/01/threads-vrs-delegates.html' title='Threads vrs. Delegates'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-2082904029092231141</id><published>2008-12-17T12:13:00.000-08:00</published><updated>2008-12-17T12:15:51.833-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='use case'/><category scheme='http://www.blogger.com/atom/ns#' term='projects'/><category scheme='http://www.blogger.com/atom/ns#' term='inherits'/><category scheme='http://www.blogger.com/atom/ns#' term='UML'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='sequence'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='activity'/><category scheme='http://www.blogger.com/atom/ns#' term='model'/><category scheme='http://www.blogger.com/atom/ns#' term='diagram'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>The Power of Designs</title><content type='html'>&lt;div&gt; I once thought software engineering is all about codes (you know, the intricacies of a programming language). But i was partly right and partly wrong. Why do i say this?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; I'm &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;RIGHT&lt;/span&gt; because:&lt;/div&gt;&lt;div&gt; Eventually, all designs lead to codes, whether high, semi-high or low level programming languages, that ought to be compiled and executed (or re-used by another program).&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; I'm &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;WRONG&lt;/span&gt; because:&lt;/div&gt;&lt;div&gt; If you are managing huge projects, like uhmm...an Office package (say Microsoft Word), you can't just get up and start coding; there ought to be a predesign, evaluation, testing and validation of such a (huge) design before we move on into action.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; In this article, i'd like to draw your attention to the power of designs, particularly to emphasize (if not introduce) the modelling language called UML. Thanks to the three amigo's who invented this language in 1997, programmers and non-technophiles can talk at the higher level with diagrams before they get nighmares with the bolts and nuts of the software at the lower level. HURRAYY!!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; As i said before, the Unified Modelling Language (UML) is a modelling language. A model is basically an abstraction of reality. Therefore, with models, we have a unique advantage of critically analysing before implementation. Additionally, model are scalable and they aid in proper documentation.&lt;/div&gt;&lt;div&gt; The UML can do all these.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; As a quick breather, the UML consists of diagrams, relationships and things. The diagrams include:&lt;/div&gt;&lt;div&gt; 1. &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Use case diagrams&lt;/span&gt;: I love this stick-figure diagrams. These capture the requirements of the proposed software at the macro-level. They are like to-do lists. The give a general overview of the capabilities of the software.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; 2.&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Class diagram&lt;/span&gt;s:This the part i enjoy doing. These diagrams represent the classes, interfaces, packages or namespaces to be used, as well as methods and properties in those entities. Additionally, class diagrams also details which class inherits what, interfaces or subclasses another class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Sequence diagrams&lt;/span&gt;: Order....order.....ORDER. These show the time-ordering sequence of how the methods in class diagrams are used and the chain of synchronous or asynchronous messages passed between them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; 4. &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Activity diagrams&lt;/span&gt;: These are like flowcharts. However, they are more powerful than flowcharts. They can model parallel processes.&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt;5. And many more...&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; I do not want to further arouse your interest concerning this infant engineering standard. It has come to stay and it is strengthening most weak and crippled projects of software companies. Believe me, about 80% or more software projects fail or are at a stand-still because of lack of a unified model/predesign.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; UML is not a method. It is a principle. It is not limited to only software projects (though conversely, it promotes the OOP paradigm). Whether you are an Agilian or waterfall-dependent, a little design before 'public class....'  wouldn't kill ya.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; Many UML software exists. Try Visual Paradigm, ArgoUML, or just google UML software.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; Spread the word.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-2082904029092231141?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/2082904029092231141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=2082904029092231141&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2082904029092231141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2082904029092231141'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/12/power-of-designs.html' title='The Power of Designs'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-5486154124530705576</id><published>2008-12-17T11:35:00.000-08:00</published><updated>2008-12-17T12:13:22.548-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spirit'/><category scheme='http://www.blogger.com/atom/ns#' term='back'/><category scheme='http://www.blogger.com/atom/ns#' term='xmas'/><category scheme='http://www.blogger.com/atom/ns#' term='school'/><category scheme='http://www.blogger.com/atom/ns#' term='blogging'/><title type='text'>I'm back</title><content type='html'> Hello there,&lt;div&gt; I'm back from the drudgery of school work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; Let's see how this blogging spirit can enjoy its yearned freedom.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; Merry Xmas.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-5486154124530705576?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/5486154124530705576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=5486154124530705576&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/5486154124530705576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/5486154124530705576'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/12/im-back.html' title='I&apos;m back'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-6420451716713978498</id><published>2008-09-23T23:03:00.000-07:00</published><updated>2008-09-23T23:03:01.004-07:00</updated><title type='text'>A little break</title><content type='html'>Hi everyone...&lt;br /&gt;Looks like the enthusiasm to blog is dying with academic pressure...but..never say DIE....i will be back with more soft things after the storm abates for a while...i've got a bag of new goodies for you..till then...have a nice day.&lt;br /&gt;P.S. i changed the title to reflect the content of this blog&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-6420451716713978498?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/6420451716713978498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=6420451716713978498&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6420451716713978498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6420451716713978498'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/09/little-break.html' title='A little break'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-2402440613641225754</id><published>2008-08-12T08:05:00.000-07:00</published><updated>2008-08-12T08:12:22.368-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='experiences'/><category scheme='http://www.blogger.com/atom/ns#' term='inspired'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='software engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='computer'/><category scheme='http://www.blogger.com/atom/ns#' term='welcome'/><title type='text'>Welcome Message</title><content type='html'>Hi, welcome to my blog.&lt;br /&gt;&lt;br /&gt;Forgive me for not writing this first. Anyway, this is a small place in the big web world that may teach you some few topics in computer programming or software engineering.&lt;br /&gt;&lt;br /&gt;You'll notice that i've also included some real experiences.&lt;br /&gt;&lt;br /&gt;I don't have a laid down routine on when i blog. I just start writing when i feel 'inspired'.&lt;br /&gt;&lt;br /&gt;Please leave a comment during or after reading.&lt;br /&gt;&lt;br /&gt;Happy reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-2402440613641225754?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/2402440613641225754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=2402440613641225754&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2402440613641225754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2402440613641225754'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/08/welcome-message.html' title='Welcome Message'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-2672403616887743672</id><published>2008-08-08T05:03:00.000-07:00</published><updated>2008-08-08T06:19:16.242-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Lists'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='listview'/><category scheme='http://www.blogger.com/atom/ns#' term='treeview'/><title type='text'>Working with .NET Lists</title><content type='html'>I've gotten the thing about listviews and treeview. I'd like to share it with all today&lt;br /&gt;This blog talks about how to load data into any list very quickly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Working with listview&lt;/span&gt;&lt;br /&gt;Listviews can be fun to work with especially when you're loading data from a file.&lt;br /&gt;Take for example a CSV file from which we would load email addresses (which may be in the 3rd field)&lt;br /&gt;&lt;br /&gt;You may have realized that most lists (e.g. listview, treeview, listbox, checklistbox) all inherit from the IList interface with added methods of AddRange(typename arg())&lt;br /&gt;&lt;br /&gt;Ok, we now write a method that simply reads the CSV file, creates an array of ListViewItem and initializes each array member. Finally, we simply call .AddRange(...) and pass the array into it.&lt;br /&gt;Usually, .NET Lists loads the items asynchronously into the listview.&lt;br /&gt;That's it.&lt;br /&gt;&lt;br /&gt;Sample code in VB.NET:&lt;br /&gt;&lt;br /&gt;'lets say we have a listview control called lvw1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;public sub&lt;/span&gt; LoadEmailAddresses()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;dim&lt;/span&gt; arrcontacts &lt;span style="color: rgb(51, 51, 255);"&gt;as&lt;/span&gt; array = System.io.file.readalllines("C:\mycontacts.csv")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;dim&lt;/span&gt; lstemails(arrcontacts.length-1) &lt;span style="color: rgb(0, 0, 153);"&gt;as&lt;/span&gt; listviewitem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt; i &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt; integer=0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;foreach&lt;/span&gt; contact &lt;span style="color: rgb(0, 0, 153);"&gt;as&lt;/span&gt; string in arrcontacts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt; details &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt; string() = split(contact,",")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;lstemails(i)= &lt;span style="color: rgb(0, 0, 153);"&gt;new&lt;/span&gt; listviewitem(details)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;i +=1&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new; color: rgb(0, 0, 153);"&gt;next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;lvw1.items.AddRange(lstemails) 'this is where all the magic occurs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;end sub &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This code applies in all Lists in the .NET platform...(well i've not tested it on JAVA platform yet). Adjust the code to suit your preferred language.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-2672403616887743672?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/2672403616887743672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=2672403616887743672&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2672403616887743672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2672403616887743672'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/08/working-with-net-lists.html' title='Working with .NET Lists'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-3581045156422224212</id><published>2008-08-04T08:32:00.000-07:00</published><updated>2008-08-04T09:40:55.117-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='projects'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='classes'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='codes'/><title type='text'>Making classes talk with databases</title><content type='html'>Most of my previous database projects were quite difficult to complete or work with. It may be because of poor organisation of classes and communication to the database.&lt;br /&gt;I undertook a project about a month ago..the same database project. Time constraints kicked in as the client wanted it as soon as possible.&lt;br /&gt;I quickly figured out a way of making my classes talk to the database for quick and effective response.&lt;br /&gt;I did it in C# but it can be applicable anywhere.&lt;br /&gt;&lt;br /&gt;Here's the 'new' idea:&lt;br /&gt;&lt;br /&gt;Lets assume we have a database file(an Access file called dbSchool.mdb) with a table called tblStudents having fields:&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;IDNumber(text),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;Surname(text),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;Othernames(text),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;ContactAddress(text)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create an interface (say &lt;span style="font-style: italic;font-family:courier new;" &gt;ISchoolData&lt;/span&gt;) with common database methods  such as:&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;Add(object[] data),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;Update(object[] data),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;Delete(object data)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;and Find(object data),&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create an abstract class (say TheSchool) that inherits the &lt;span style="font-style: italic;font-family:courier new;" &gt;ISchoolData&lt;/span&gt; interface. Ideally, the abstract class now represents the dbSchool schema in your database.&lt;br /&gt;&lt;br /&gt;This abstract class would be the ultimate point of connection/communication to the database.&lt;br /&gt;So, you must import the correct namespaces to connect to your database. In this case, import the &lt;span style="font-style: italic;font-family:courier new;" &gt;System.Data&lt;/span&gt; and &lt;span style="font-style: italic;font-family:courier new;" &gt;System.Data.Oledb&lt;/span&gt; namespaces.&lt;br /&gt;Provide instances of &lt;span style="font-style: italic;font-family:courier new;" &gt;OledbConnection&lt;/span&gt; and &lt;span style="font-style: italic;font-family:courier new;" &gt;OledbCommand&lt;/span&gt; including the connection string.&lt;br /&gt;Provide a protected string property called &lt;span style="font-style: italic;font-family:courier new;" &gt;Tablename&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Now, in the Add method, write these codes.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Protected void Add(object[] data)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    List&lt;string&gt; fields = new List&lt;string&gt;();&lt;/string&gt;&lt;/string&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    fields.Clear();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    fields = TableFields();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    int affected=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    string sql = "INSERT INTO " + Tablename + " " + GetColumns() + " VALUES " +  ContinueInsert();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    cmd = new OledbCommand(sql,conn); //conn represents the instance of OledbConnection&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int i=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    foreach(string item in data)&lt;data.length i=""&gt;&lt;data.lenght i=""&gt;&lt;/data.lenght&gt;&lt;/data.length&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    cmd.Parameters.Add("@" + fields[i],item);&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    i++;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    conn.Open();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    affected = cmd.ExecuteNonQuery();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    conn.Close();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Notice the &lt;span style="font-family:courier new;"&gt;TableFields()&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;GetColumns()&lt;/span&gt;,&lt;span style="font-family:courier new;"&gt;ContinueInsert()&lt;/span&gt; methods&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;TableFields()&lt;/span&gt; gets all the fields in a specified table in a file as a generic List of strings.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;GetColumns()&lt;/span&gt; returns a string with the fields in the database table.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ContinueInsert()&lt;/span&gt; returns a string that continues the SQL statement.&lt;br /&gt;&lt;br /&gt;Still don't see the picture?&lt;br /&gt;&lt;br /&gt;Create a class (say Students) that inherits from TheSchool abstract class. Provide properties that match the fields in the tblStudents table in the dbSchool schema. So, we now have &lt;span style="font-style: italic;font-family:courier new;" &gt;IDNumber&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;&lt;span style="font-family:courier new;"&gt;Surnam&lt;/span&gt;e&lt;/span&gt;, &lt;span style="font-style: italic;font-family:courier new;" &gt;Othernames&lt;/span&gt; and&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;ContactAddress&lt;/span&gt; as properties in the database.&lt;br /&gt;Provide a static field in the class that contains the name of the table in the database to which connections would be made.(for e.g. static string thetable = "tblStudents";)&lt;br /&gt;&lt;br /&gt;Provide a method (say &lt;span style="font-style: italic;font-family:courier new;" &gt;AddStudent()&lt;/span&gt;) that calls &lt;span style="font-style: italic;font-family:courier new;" &gt;Add(object[] data)&lt;/span&gt; in the abstract class.&lt;br /&gt;So, Add student would look like :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public void AddStudent()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    this.Tablename = thetable;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    this.Add(IDNumber,Surname,Othernames,ContactAddress);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is how easy it appears.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Summary&lt;/span&gt;&lt;br /&gt;Any schema in the database is represented by an abstract class that inherits an interface.&lt;br /&gt;All tables are represented subclasses of the abstract class with properties that represent the field in their respective tables.&lt;br /&gt;Provide methods in each of the subclasses that calls the methods in the abstract class.&lt;br /&gt;&lt;br /&gt;This way, only the abstract class (or classes)  actually connect to the database for queries.&lt;br /&gt;You only need to work with one file for configurations (such as change of database name, physical location).&lt;br /&gt;&lt;br /&gt;Email me for more information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-3581045156422224212?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/3581045156422224212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=3581045156422224212&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/3581045156422224212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/3581045156422224212'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/08/making-classes-talk-with-databases.html' title='Making classes talk with databases'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-2511016083397950764</id><published>2008-07-29T12:02:00.000-07:00</published><updated>2008-08-04T09:39:17.626-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mirror method(MM)'/><category scheme='http://www.blogger.com/atom/ns#' term='reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='class lopps'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='classes'/><category scheme='http://www.blogger.com/atom/ns#' term='Singleton'/><title type='text'>Some funny classy thuts</title><content type='html'>Some funny thoughts just crossed my mind as i hiked home this evening.&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;1.The Singleton issue.&lt;/span&gt;&lt;br /&gt;  I bet u already know what a singleton class is n possibly what it does.&lt;br /&gt;    For instance,&lt;br /&gt; &lt;span style="font-family:courier new;"&gt;   public class MyClass&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    private static MyClass _current;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    public static MyClass Current{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    get &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                            if (_current == null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                                    _current= new MyClass();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                            return _current;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I suggest this method be called a mirror method (or MM persay) or reflector property. The reason? Because it just reflects all the public properties and methods in the class without necessarily creating a new instance occasionally. I guess i should say the class should also be called a mirror class.&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;2. Class Loops&lt;/span&gt;&lt;br /&gt;Sounds crazy huh? Well, think of this. Class A inherits from B. B from C. C from D. D from A.&lt;br /&gt;So, what does this do?&lt;br /&gt;Well, at any point in time you have access to all public properties and methods in any of the classes. Think of it as a circle with a line as any edge.&lt;br /&gt;The line is the pathway to an instance of the class. You can mary-go-around the circle and back to the same point.&lt;br /&gt;This way u can beat the no-multiple-inheritance thing in C#. It may look like single-inheritance...but it is multiple-like inheritance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-2511016083397950764?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/2511016083397950764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=2511016083397950764&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2511016083397950764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/2511016083397950764'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/07/some-funny-classy-thuts.html' title='Some funny classy thuts'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-463555839055766675</id><published>2008-07-20T16:11:00.000-07:00</published><updated>2008-08-04T09:40:09.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='listview'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><title type='text'>A little lesson</title><content type='html'>I got myself entangled in a web of program crashes just recently. I had completed a software (the first release) for the company i worked with. It was a complete success. However, i decided to add some cosmetics to the interface.&lt;br /&gt;There was listview on one of the forms. I decided to lock a column to prevent resizing. That is where the problem started.&lt;br /&gt;This is what i did&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; Private Sub datalist_ColumnWidthChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangedEventArgs) Handles datalist.ColumnWidthChanged&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;        If e.ColumnIndex = 4 Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            datalist.Columns(4).Width = 20&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        End If&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For almost 3 days i couldn't find out the problem with the program. It worked well on my laptop (Vista) but did not work on other laptops. Surprisingly, it did work on an XP system. It got to a point i almost gave up and decided to re-build the whole application.&lt;br /&gt;At home, i got the impression of transferring the source codes to my XP desktop to see what the problem was. Upon the first debug, there it was....the green marker was painted on that portion of code.&lt;br /&gt;I engulfed the code in try..catch but it still flagged an error. So, i had to delete the code block from the page. It now worked as expected.&lt;br /&gt;The lesson? Please test your source codes both on XP and on Vista. You may not know where the problem is unless you change the coding environment.&lt;br /&gt;Ah...at last i can wipe the sweat off my face....!!!&lt;br /&gt;But...uhmmm...can any of you show me how to hide a column in an ordinary listview?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-463555839055766675?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/463555839055766675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=463555839055766675&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/463555839055766675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/463555839055766675'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/07/little-lesson.html' title='A little lesson'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-6816645993383764019</id><published>2008-07-11T02:36:00.000-07:00</published><updated>2008-08-08T06:30:35.345-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Search'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='quicksearch'/><category scheme='http://www.blogger.com/atom/ns#' term='StartSeach'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='searching algorithm'/><title type='text'>Simple Searching Algorithm</title><content type='html'>I once decided to write a simple program to search for files on my desktop computer. The idea initially evolved from a quick 'antivirus' simulator i developed in the computer lab. as a show-off to my friends. The funny thing is that a coursemate even wanted to use it to scan his flash drive. But i knew then that it had to start from getting the search algorithm right.&lt;br /&gt;Believe me, i had quite a difficult journey during coding. I then went on open-source websites for help. Man, the codes i downloaded were like close to 900 lines of code. It was way too much.&lt;br /&gt;What i really wanted was to design and develop a program that is faster than the resident Windows Search program. It seemed quite impossible to go head-to-head with the Redmond masters.&lt;br /&gt;I tried with VB 6 using the directory control but it proved futile initially. I then moved on to the .NET framework. I felt much comfortable. With little trial and error, in less than 2 days, i got it right. It brought the files i needed but not as fast as i expected it to be. I knew nothing of program threads or regular expressions. Anyway, i heard my C++ lecturer talk about how threads help make programs execute faster.&lt;br /&gt; With some quick online tutorials on the 2 topics, i employed threads and regular expressions.....my oh my.....&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;it is so fast that i can't even time it&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;...&lt;/span&gt;just like the resident search program. I call the algorithm QuickSearch.&lt;br /&gt;&lt;br /&gt; And now..... the big idea....&lt;br /&gt; The input to the algorithm is the folder location and of course, the file to find.&lt;br /&gt;&lt;br /&gt; So, in the class i built, there is a StartSearch and StopSearch method to begin or abort the search thread.&lt;br /&gt;The StartSearch spins a new thread pointing it to LookHere() method. The LookHere basically does the filematching in a folder and puts like files in a list of strings. When done it calls GetAllFolders(). This method opens subfolders and recalls LookHere() for file match.&lt;br /&gt;This sort of pipelined activity with threading is executed very quickly. If the process is done...It raises an event. This way, the front-end UI can know when the search is completed and gets the result from a read-only property of list of strings in the class and load it into a listview.&lt;br /&gt;  Doesn't make sense huh?&lt;br /&gt;&lt;br /&gt;  Check this code structure.....&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    private _filelocation as String&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;     Public Property FileLocation as String&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;         Get&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;            return _filelocation&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;        End Get&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;        Set (value as String)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;            _filelocation = value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;       End Set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;     End sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    Public sub StartSearch()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;        'start some global thread&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    End sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    Public sub StopSearch()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;        'stop the global thread&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    End sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    Public sub LookHere()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;           1.get files from filelocation into array&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;            2.loop through array for file match&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;            3.if file is there, put in list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;            4.if loop is done call GetAllFolders()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    End sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    Public sub GetAllFolders()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;        1.get all folders in filelocation&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;        2.loop through and call LookHere() to find file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    End sub&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      Please send me a mail to get the full program with the source code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-6816645993383764019?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/6816645993383764019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=6816645993383764019&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6816645993383764019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/6816645993383764019'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/07/simple-searching-algoritm.html' title='Simple Searching Algorithm'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-8636748539508484241</id><published>2008-04-22T03:14:00.000-07:00</published><updated>2008-08-04T09:42:32.990-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2ME'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBeans'/><title type='text'>The world of Java GUI</title><content type='html'>My lecturer for Object Oriented Programming (OOP) said 'brace yourself because we're going to fly'. He chose to implement the OOP stuffs in JAVA.&lt;br /&gt;&lt;br /&gt;That was an advantage for me, cuz i'm already familiar with .NET environment.&lt;br /&gt;&lt;br /&gt;We did not use NetBeans....surprised? We had to battle with raw-text programming editor of JCreator PRO (evaluation edition). Though it had quick intellisense aids.&lt;br /&gt;&lt;br /&gt;I've come to appreciate the code-from-scratch designing (that's a whole lot of hardwork).&lt;br /&gt;The Java environment is very good for academic work. I love the way i can extend other classes and implement interfaces, override and overload methods.&lt;br /&gt;&lt;br /&gt;Java is very type-conscious (strongly typed)...way too conventional (with respect to namings).&lt;br /&gt;Anyway i enjoy the simple, easy to remember methods of classes: &lt;span style="font-style: italic;"&gt;getFont(....)&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;setBackground(....)&lt;/span&gt;...it is very exciting.&lt;br /&gt;&lt;br /&gt;I always feel like i'm creating a system (in OOP) anytime i develop a program.....Let there be &lt;span style="font-style: italic;"&gt;setGrades&lt;/span&gt; in &lt;span style="font-style: italic;"&gt;Student&lt;/span&gt; class....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-8636748539508484241?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/8636748539508484241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=8636748539508484241&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8636748539508484241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8636748539508484241'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/04/world-of-java-gui.html' title='The world of Java GUI'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640198225857397031.post-8392909192087681527</id><published>2008-04-22T02:47:00.000-07:00</published><updated>2008-08-04T09:43:23.522-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><category scheme='http://www.blogger.com/atom/ns#' term='VM ware'/><category scheme='http://www.blogger.com/atom/ns#' term='Virtualization'/><category scheme='http://www.blogger.com/atom/ns#' term='operating system'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual machine'/><title type='text'>PC virtualization...</title><content type='html'>Can you imagine running 2,3,4 or more operating system on 1 computer....This is a dream come true (at least for developers and IT specialists). Talk about cost, convenience and flexibility.&lt;br /&gt;Personally, i thought of this technology as my project work. Can u imagine that? An undergraduate in the university of Ghana 'inventing' this technology? I would've been at Microsoft or Sun Microsystems or even Google by now. I guess i did not do much reading...It's not my fault anyway...the ICT center in my school is always crowded so how can i surf the net for research.&lt;br /&gt;Before i could say '&lt;span style="font-style: italic;"&gt;jack&lt;/span&gt;' (a common term in Ghana), a friend (a fellow coursemate) introduced me to VM ware 6.0.&lt;br /&gt;Version 6!!! Yes. it was version 6. That means that it had been like 6 years since Desktop Virtualization came to pass. 'Ouch' to my proposed work. I quickly familiarised myself to this software on their homepage. I downloaded a free trial and installed it, hoping to flirt more with Ubuntu.&lt;br /&gt;Of course, i had quite some problems with Vista (bluescreen to be precise).&lt;br /&gt;Later, i visited Microsoft's website to see whether the Redmond's had entered the world of Virtualization. Hurray! hurray!!, they had! And it was even free to download. (Virtual pc 2007).&lt;br /&gt;I must say that the world is really rotating very fast.&lt;br /&gt;As a student developer, i hope to use this medium to test my applications on both Windows and Linux platforms.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4640198225857397031-8392909192087681527?l=austinejei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://austinejei.blogspot.com/feeds/8392909192087681527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4640198225857397031&amp;postID=8392909192087681527&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8392909192087681527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640198225857397031/posts/default/8392909192087681527'/><link rel='alternate' type='text/html' href='http://austinejei.blogspot.com/2008/04/pc-virtualization.html' title='PC virtualization...'/><author><name>stynpro</name><uri>http://www.blogger.com/profile/00932345738669181423</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_eWKHxZe7vjY/Sbujh7GdzcI/AAAAAAAAACU/NDQCKQs92L0/S220/me+at+home.jpg'/></author><thr:total>0</thr:total></entry></feed>
