<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>j2se &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/j2se/</link>
	<description>Feed of posts on WordPress.com tagged "j2se"</description>
	<pubDate>Mon, 28 Dec 2009 22:03:43 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[java.lang.IllegalArgumentException: SSL]]></title>
<link>http://polimetla.com/2009/12/28/java-lang-illegalargumentexception-ssl/</link>
<pubDate>Mon, 28 Dec 2009 19:29:28 +0000</pubDate>
<dc:creator>polimetla</dc:creator>
<guid>http://polimetla.com/2009/12/28/java-lang-illegalargumentexception-ssl/</guid>
<description><![CDATA[Problem: INFO: Interceptor has thrown exception, unwinding now java.lang.IllegalArgumentException: S]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Problem:<br />
INFO: Interceptor has thrown exception, unwinding now<br />
<span style="color:#ff0000;"><strong>java.lang.IllegalArgumentException: SSL</strong></span><br />
at com.sun.net.ssl.internal.ssl.ProtocolVersion.valueOf(ProtocolVersion.java:133)<br />
at com.sun.net.ssl.internal.ssl.ProtocolList.(ProtocolList.java:38)<br />
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setEnabledProtocols(SSLSocketImpl.java:2075)</p>
<p>Fix:</p>
<p><span style="color:#ff0000;"><strong>Before</strong>:    parameters.setSecureSocketProtocol(&#8220;SSL&#8221;);</span></p>
<p><span style="color:#008000;"><strong>After</strong>:     parameters.setSecureSocketProtocol(&#8220;SSLv3&#8243;);</span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Kenali Pemrograman Java dengan menyederhanakannya]]></title>
<link>http://muhammadsawal.wordpress.com/2009/12/16/kenali-pemrograman-java-dengan-menyederhakannya/</link>
<pubDate>Wed, 16 Dec 2009 09:09:28 +0000</pubDate>
<dc:creator>muhammadsawal</dc:creator>
<guid>http://muhammadsawal.wordpress.com/2009/12/16/kenali-pemrograman-java-dengan-menyederhakannya/</guid>
<description><![CDATA[Untuk yang mungkin telah mempelajari pemrograman sebelumnya, atau para akademisi yang telah mendapat]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://muhammadsawal.wordpress.com/files/2009/12/walle_eve.jpg"><img class="size-full wp-image-205 alignleft" title="Kenalan" src="http://muhammadsawal.wordpress.com/files/2009/12/walle_eve.jpg" alt="" width="210" height="161" /></a>Untuk yang mungkin telah mempelajari pemrograman sebelumnya, atau para akademisi yang telah mendapatkan mata kuliah pemrograman, sering sekali ketika mendapatkan hal yang baru seperti pemrograman Java menjadi bingung.</p>
<p>Mudah-mudahan konsep pengenalan yang sedikit ini dapat membuka hal-hal yang masih membingungkan itu.</p>
<p><!--more--></p>
<p>Sederhana saja, ketika teman yang sebelumnya telah tahu tentang pemgrograman bertanya pada saya, apa itu netbean, eclipse dan apa itu JAR apa itu dan itu. Biasa yang saya jawab seperti ini dan mereka sedikit menjadi lebih memahami walaupun sebenarnya mesti mendalami lagi :</p>
<ul>
<li>Ketika teman bertanya apa itu Netbeans, Eclispe :<br />
“Pernah tahu Dreamweaver untuk editing tampilan buat bikin website, atau visual studio untuk dipakai  pada .Net Framework ?<br />
Ya, itu lah jawabannya, hanya perangkat lunak yang difungsikan sebagai IDE (Integreted Development Inveronment) dan difungsikan untuk pemrograman Java. Walaupun akhir-akhir ini telah berubah konsep keduanya menjadi Platform yang sering dikenal RCP (Rich Client Platform), tapi untuk ditahapan pengenalan awal, kedua software tersebut bisa dikatakan  sebuah IDE.”</li>
</ul>
<ul>
<li>Kalimat pertanyaan Java Eclipse dengan Java Netbeans bedanya dimana?<br />
“Setelah pemahaman dari jawaban pertama,  untuk pertanyaan ini sudah pasti terjawabkan”</li>
</ul>
<ul>
<li> Bertanya tentang JAR itu apa?trus di ‘jalanin’ pake apa, dan kenapa mesti pake itu?<br />
“Pernah tahu Flash, Macromedia Flash, selalu export file berformat SWF kan..trus kalau SWF itu biasanya di ‘jalanin’ pake apa, yep ..tentu saja adalah Flash Player.<br />
Nah, untuk Java export file atau hasil produknya adalah file berformat JAR (Java ARchive). Dan itu dijalanin pake JRE, seperti halnya Flash Player, aplikasi ini akan menjalankan file JAR tersebut diatas platform JAVA, kepanjangannya JRE (Java Runtime Environment)”</li>
</ul>
<ul>
<li>Kenapa banyak banget Java?bingung nih, yang ada awalan-awalan J..J nya itu. JDK trus banyak lagi.Install yang mana? (Maksud penanya adalah JDK, J2SE, J2EE, J2ME)<br />
Jawaban sederhana yang biasa mudah diterima : “ JDK itu kepanjangannya Java Development Kit, kalau mau menjadi developer atau menggunakan java sebagai bahasa pemrograman, install JDK tersebut. Tapi jika hanya menjalakan aplikasi Java yang berformat file JAR, cukup install JRE saja.<br />
Kenapa banyak sekali Java, ya itu lah kelebihan Java, mempunyai banyak teknologi, karena banyak jadi dibagi-bagi pengelompokannya, dan diberi nama masing-masing<br />
J2SE – untuk buat aplikasi desktop<br />
J2EE -  untuk buat aplikasi website<br />
J2ME – untuk buat aplikasi mobile atau apliasi yang ‘jalan’ di handphone.”</li>
</ul>
<p>Sejauh ini yang sering dibicarakan dalam pertanyaan teman yang telah dahulu mengenal pemgrogaman adalah seputar pertanyaan tersebut diatas.  Biasanya dengan jawaban itu menambah pemahaman dan lebih menyederhakanan pemikiran tentang Java yang sulit dipelajari, padahal bakal ‘fun and happy’ ketika menjalaninya.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Monitoreo de Java Virtual Machine con SNMP]]></title>
<link>http://openjlife.wordpress.com/2009/11/22/monitoreo-de-java-virtual-machine-con-snmp/</link>
<pubDate>Mon, 23 Nov 2009 04:25:36 +0000</pubDate>
<dc:creator>Jose Manuel</dc:creator>
<guid>http://openjlife.wordpress.com/2009/11/22/monitoreo-de-java-virtual-machine-con-snmp/</guid>
<description><![CDATA[La manera no intrusiva de monitorear parámetros de la máquina virtual de java, es habilitar la capac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>La manera no intrusiva de monitorear parámetros de la máquina virtual de java, es habilitar la capacidad de emitir datos por SNMP (Simple Network Management Protocol) al agregar los siguientes parámetros en las opciones extra de la JVM:</p>
<blockquote><p>JAVA_OPTS=$JAVA_OPTS &#8221; -Dcom.sun.management.config.file=/path/to/file/jvm.management.properties&#8221;</p></blockquote>
<p>Contenido del archivo /path/to/file/jvm.management.properties</p>
<blockquote><p># SNMP Management Settings<br />
com.sun.management.snmp.interface=0.0.0.0<br />
com.sun.management.snmp.port=8162<br />
com.sun.management.snmp.acl=false<br />
#com.sun.management.snmp.acl.file=filepath<br />
#com.sun.management.snmp.trap=&#60;hostname:port&#62;</p></blockquote>
<p>Para comprobar que los parámetros fueron aceptados de manera exitosa, podemos buscar el puerto establecido, en este caso 8162, con estado Idle con netstat de la siguiente manera:</p>
<blockquote><p>netstat -an &#124; grep 8162<br />
*.8162                              Idle</p></blockquote>
<p>Finalmente, con el comando snmpwalk (linux) obtenemos los datos de la JVM:</p>
<blockquote><p>snmpwalk -v2c -m all -c public &#60;server&#62;:8162 .1</p>
<p>.</p>
<p>JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.$&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.%&#8217; = BITS: 02 00 terminated(6)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.&#38;&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.(&#8216; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.)&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.*&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.+&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.,&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.-&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;..&#8217; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.0&#8242; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.1&#8242; = BITS: 01 00 waiting(7)<br />
JVM-MANAGEMENT-MIB::jvmThreadInstState.&#8217;&#8230;&#8230;.2&#8242; = BITS: 01 00 waiting(7)<br />
.</p></blockquote>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[TABLEMODEL AS DATASOURCE IN JASPER REPORTS]]></title>
<link>http://gilbertadjin.wordpress.com/2009/11/22/tablemodel-as-datasource-in-jasper-reports/</link>
<pubDate>Sun, 22 Nov 2009 14:05:30 +0000</pubDate>
<dc:creator>Gilbert Adjin Frimpong</dc:creator>
<guid>http://gilbertadjin.wordpress.com/2009/11/22/tablemodel-as-datasource-in-jasper-reports/</guid>
<description><![CDATA[It is a common requirement in many J2SE (client,swing) applications to present data in a tabular way]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It is a common requirement in many J2SE (client,swing) applications to present data in a tabular way and also print this tabular format as a report.</p>
<p>Jasper reports provides implementation that makes the task of generating reports from tabular formats simple in Swing   <br />applications. In this demonstrations, we will be using Jasper reports 3.6.1, Netbeans 6.1 and Ireport 3.6.1.</p>
<p>Let start by designing our report. In generating reports from tablemodels the report fields must match the column names of the tablemodel, but sometimes it becomes impractical to use the actual column names as report fields. Jasper Reports provides a way to generate reports from TableModels without having to map the actual table columns to the report fields. We can name our   <br />report fields COLUMN_X, where x is the column index, starting with zero. Note “COLUMN” all characters should be capitals as “column” will give you error message at run time.</p>
<p>Also in case you have 3 columns in your table and you define a report field “COLUMN_4” , which is for column 5, null values will be displayed for each row in the report under that field. To prevent null values from displaying in a text field you can edit the expression for that field e.g. (($F{COLUMN_4}==null)? &#34;&#34;:$F{COLUMN_4}.toString()), which means if the if the value of $F{COLUMN_4} is null ,display nothing else display the value. To do this, right click the text field and select “edit expression”, an expression editor will pop up for you to change the expression.</p>
<p>Below is a picture of our report at design time</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image2.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb2.png?w=406&#038;h=236" width="406" height="236" /></a> </p>
<p>After creating our report, we go to our application (using Netbeans as the IDE), we add a JTable and a JButton to our JFrame. We the create a method which accepts&#160; the table model to create the report, tbProducts is the name of the Jtable. Check <a title="http://gilbertadjin.wordpress.com/2009/05/05/populating-a-jtable-with-a-collection-list/" href="http://gilbertadjin.wordpress.com/2009/05/05/populating-a-jtable-with-a-collection-list/">http://gilbertadjin.wordpress.com/2009/05/05/populating-a-jtable-with-a-collection-list/</a> to see how to populate a list of javabean object to a Jtable</p>
<p>private void <strong>generateReports</strong>(String name, Map param) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; try { </p>
<blockquote><p>&#160;&#160;&#160;&#160;&#160; String source = &#34;C:/sabonay/jasperreports/&#34; + name + &#34;.jrxml&#34;;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (new File(source).exists() == false) {      <br />&#160;&#160;&#160;&#160;&#160; xputils.showMessage(&#34;Please go to setting and Choose report Source&#34;);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </p>
</blockquote>
<blockquote><p> JasperReport jasperReport = JasperCompileManager.compileReport(source);     <br /> JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param, <strong>new JRTableModelDataSource(tbProducts.getModel()));</strong> </p>
</blockquote>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JasperViewer.viewReport(jasperPrint, false); </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (Exception e) {   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(&#34;reports Error&#160; &#34; + e.toString()); </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>Cheers !!!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[LOAD IMAGES DYNAMICALLY INTO JASPER REPORTS]]></title>
<link>http://gilbertadjin.wordpress.com/2009/11/13/load-images-dynamically-into-jasper-reports/</link>
<pubDate>Fri, 13 Nov 2009 11:38:00 +0000</pubDate>
<dc:creator>Gilbert Adjin Frimpong</dc:creator>
<guid>http://gilbertadjin.wordpress.com/2009/11/13/load-images-dynamically-into-jasper-reports/</guid>
<description><![CDATA[If you want to insert images from the file system (e.g. C:\images folder) into jasper reports at run]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you want to insert images from the file system (e.g. C:\images folder) into jasper reports at runtime, for example changing a logo depending on user selection or simply allowing the user to browse for his or her image to be displayed&#160; in the report then here is a simple process of doing that.</p>
<p>Let start with the report design using ireport. In this instance the picture will be passed to the report as a parameter.</p>
<p>So let’s create a parameter in our report and call it “photo”</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb.png?w=367&#038;h=210" width="367" height="210" /></a> </p>
<p>As shown in the picture above, the data type of our parameter should be “java.lang.Object”</p>
<p>After this, drag the image , from the tool bar, on to your report.Right click on the image and choose “Properties” from the menu</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image1.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb1.png?w=343&#038;h=203" width="343" height="203" /></a> </p>
</p>
<p>Under the image tab of the dialog box, make sure you select “java.awt.image” for the Image Expression Class. Once this is done, you are done with the report design</p>
<p>Lets go to netbeans , do some coding and connect our designed report to a java application.</p>
<p>First we need to declare a variable of type image,</p>
<p>Image photo;</p>
<p>Also we create a method , which on click of a button, loads a picture from the file system and initializes the “photo: variable.</p>
<p>JFileChooser fc = new JFileChooser();</p>
<p>private void getPicture() {</p>
<p>fc.setFileFilter(new FileNameExtensionFilter(&#34;Images&#34;, &#34;jpg&#34;, &#34;gif&#34;, &#34;bmp&#34;));</p>
<p>if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {</p>
<p>fc.setCurrentDirectory(fc.getCurrentDirectory());</p>
<p>ImageIcon icon = new ImageIcon(fc.getSelectedFile().getAbsolutePath());</p>
<p>icon = new ImageIcon(icon.getImage().getScaledInstance(350, 350, Image.SCALE_DEFAULT));</p>
<p>photo = icon.getImage();</p>
<p>}</p>
<p>After getting our picture, create an instance of the Map class and pass our “variable” as a parameter.</p>
<p>Map&#60;String, Object&#62; param = new HashMap&#60;String, Object&#62;();</p>
<p>param.put(&#34;photo&#34;, photo); //the “photo” should be the same name as the parameter name in our report</p>
<p>We then create a method that passes our created parameter to the report and we are done. below is the method that does the job.</p>
<p>private void generateReports(String name, Map param) {</p>
<p>try {</p>
<p>String source = &#34;C:/sabonay/jasperreports/&#34; + name + &#34;.jrxml&#34;;</p>
<p>if (new File(source).exists() == false) {</p>
<p>xputils.showMessage(&#34;Please&#160; report Source does not exist&#34;);</p>
<p>return;</p>
<p>}</p>
<p>JasperReport jasperReport = JasperCompileManager.compileReport(source);</p>
<p>JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param, new <b>JREmptyDataSource()</b>);</p>
<p>JasperViewer.viewReport(jasperPrint, false);</p>
<p>//the false parameter makes sure the application does not close on closing the report</p>
<p>} catch (Exception e) {</p>
<p>System.out.println(&#34;reports Error &#34; + e.toString());</p>
<p>}}</p>
<p>Make sure to reference the necessary jasper jar files in your application</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[I Touched a Motorola Droid Today ...]]></title>
<link>http://rschilling.wordpress.com/2009/11/10/i-touched-a-motorola-droid-today/</link>
<pubDate>Tue, 10 Nov 2009 22:51:33 +0000</pubDate>
<dc:creator>rschilling</dc:creator>
<guid>http://rschilling.wordpress.com/2009/11/10/i-touched-a-motorola-droid-today/</guid>
<description><![CDATA[Yes.  Just a couple days off the shelf and I finally got to hold a Droid.  Nice phone that feels hea]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Yes.  Just a couple days off the shelf and I finally got to hold a Droid.  Nice phone that feels heavy and solid in your hand.  I haven&#8217;t even had a chance to read the release notes, but in the coming weeks I&#8217;ll be porting an application that I&#8217;ve written for the G1.  I&#8217;ll let you know how it goes.  I can&#8217;t give a full review because I just haven&#8217;t had time to look at it.  But I can tell you one thing from working almost a year solid on the G1. This phone and the operating system is going to have some power behind it and some solid application design features.  And, with the recent release of the Android OS that will run on the personal computer, we have a serious contender for both the PC workspace and the mobile space all in one package.  I can&#8217;t wait until I get a chance to try out some heavy computation lifting with both the PC and the phone platforms being integrated.  Here&#8217;s some links:</p>
<ul>
<li>The Official site for Android Live (Android on a PC): <a href="http://code.google.com/p/live-android/" target="_blank">http://code.google.com/p/live-android/</a></li>
<li>Android Live on the PC: <a href="http://www.blogsdna.com/4032/install-google-android-on-pc-with-google-android-live-cd-live-usb.htm" target="_blank">http://www.blogsdna.com/4032/install-google-android-on-pc-with-google-android-live-cd-live-usb.htm</a></li>
</ul>
<div class="wp-caption alignleft" style="width: 210px"><img class="  " style="border:1px solid black;" title="Motorola Andorid, 11/10/2009" src="http://i427.photobucket.com/albums/pp357/wtpmjg/November-10_1414.jpg" alt="" width="200" /><p class="wp-caption-text">The new Motorola Android is a phone that feels solid in your hands.</p></div>
<div class="wp-caption alignleft" style="width: 210px"><img class="  " style="border:1px solid black;" title="Closeup of the new Motorola Droid" src="http://i427.photobucket.com/albums/pp357/wtpmjg/November-10_1415.jpg" alt="" width="200" /><p class="wp-caption-text">The Motorola Droid has a crystal clear display with lots of interesting detail.</p></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Explaining Java Technology]]></title>
<link>http://tecnoesis.wordpress.com/2009/11/06/explaining-java-technology/</link>
<pubDate>Fri, 06 Nov 2009 08:49:10 +0000</pubDate>
<dc:creator>Rajani Ramsagar</dc:creator>
<guid>http://tecnoesis.wordpress.com/2009/11/06/explaining-java-technology/</guid>
<description><![CDATA[   Module 1 &#8211; Explaining Java Technology.   Objective: Upon completion of reading this post, y]]></description>
<content:encoded><![CDATA[   Module 1 &#8211; Explaining Java Technology.   Objective: Upon completion of reading this post, y]]></content:encoded>
</item>
<item>
<title><![CDATA[Transfer Text HP (Mobile) ke PC (Komputer)]]></title>
<link>http://shaff.wordpress.com/2009/11/04/transfer-text-hp-mobile-ke-pc-komputer/</link>
<pubDate>Wed, 04 Nov 2009 05:08:49 +0000</pubDate>
<dc:creator>shaff</dc:creator>
<guid>http://shaff.wordpress.com/2009/11/04/transfer-text-hp-mobile-ke-pc-komputer/</guid>
<description><![CDATA[Pertama lakukan instalasi Bluecove di Eclipse atau Netbeans. Lalu buat sorce code berikut ini: 1. Ap]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Pertama lakukan<a href="http://shaff.wordpress.com/2009/10/25/bluecove-di-eclipse/" target="_blank"> instalasi Bluecove di Eclipse</a> atau Netbeans. Lalu buat sorce code berikut ini:</p>
<p><span style="color:#993300;"><strong>1. Aplikasi di PC (Komputer) Anda:</strong></span></p>
<pre>import java.io.*;
import javax.bluetooth.*;
import javax.microedition.io.*;

public class EchoServer {
    public final UUID uuid = new UUID(                              //the uid of the service, it has to be unique,
			"27012f0c68af4fbf8dbe6bbaf7aa432a", false); //it can be generated randomly
    public final String name = "Echo Server";                       //the name of the service
    public final String url  =  "btspp://localhost:" + uuid         //the service url
                                + ";name=" + name
                                + ";authenticate=false;encrypt=false;";
    LocalDevice local = null;
    StreamConnectionNotifier server = null;
    StreamConnection conn = null;

    public EchoServer() {
        try {
            System.out.println("Setting device to be discoverable...");
            local = LocalDevice.getLocalDevice();
            local.setDiscoverable(DiscoveryAgent.GIAC);
            System.out.println("Start advertising service...");
            server = (StreamConnectionNotifier)Connector.open(url);
            System.out.println("Waiting for incoming connection...");
            conn = server.acceptAndOpen();
            System.out.println("Client Connected...");
            DataInputStream din   = new DataInputStream(conn.openInputStream());
            while(true){
                String cmd = "";
                char c;
                while (((c = din.readChar()) &#62; 0) &#38;&#38; (c!='\n') ){
                    cmd = cmd + c;
                }
                System.out.println("Received " + cmd);
            }

        } catch (Exception  e) {System.out.println("Exception Occured: " + e.toString());}
    }

    public static void main (String args[]){
        EchoServer echoserver = new EchoServer();
    }

}</pre>
<p><strong><span style="color:#993300;">2. Aplikasi di HP Anda:</span></strong></p>
<pre>
<pre>import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import javax.bluetooth.*;
import java.io.*;
public class EchoClient extends MIDlet
   implements CommandListener,DiscoveryListener  {
    List main_list,dev_list;
    Command exit,ok;
    TextBox cmd;
    Display display;
    java.util.Vector devices,services;
    LocalDevice local;
    DiscoveryAgent agent;
    DataOutputStream dout;
    int currentDevice = 0;       //used as an indicator to the device queried for
                                 //the echo server

public void startApp() {
    main_list = new List("Echo Server",Choice.IMPLICIT);   //the main menu
    dev_list  = new List("Select Device",Choice.IMPLICIT); //the list of devices
    cmd       = new TextBox("Text to echo","",120,TextField.ANY);
    exit      = new Command("Exit",Command.EXIT,1);
    ok        = new Command("Send",Command.OK,1);
    display   = Display.getDisplay(this);

    main_list.addCommand(exit);
    main_list.setCommandListener(this);
    dev_list.addCommand(exit);
    dev_list.setCommandListener(this);
    cmd.addCommand(ok);
    cmd.setCommandListener(this);

    main_list.append("Find Echo Server",null);
    display.setCurrent(main_list);

    }
public void commandAction(Command com, Displayable dis) {
    if (com == exit){                                              //exit triggered from the main form
        destroyApp(false);
        notifyDestroyed();
    }
    if (com == List.SELECT_COMMAND){
        if (dis == main_list){                                     //select triggered from the main from
            if (main_list.getSelectedIndex() &#62;= 0){                //find devices
                FindDevices();
                do_alert("Searching for devices...", Alert.FOREVER);
            }
        }
        if (dis == dev_list){                                      //select triggered from the device list
            StreamConnection conn = null;
            ServiceRecord service = (ServiceRecord)
                            services.elementAt(dev_list.getSelectedIndex());
            String url = service.getConnectionURL(
                                   ServiceRecord.NOAUTHENTICATE_NOENCRYPT,
                                   false);
            try {
                conn = (StreamConnection) Connector.open(url);       //establish the connection
                dout = new DataOutputStream(conn.openOutputStream());//Get the output stream
                display.setCurrent(cmd);                             //Show the textbox
            } catch (Exception e) {this.do_alert("Error Connecting" , 4000);}

        }
     }
    if(com == ok){                                                  //the user is sending a command
        try{
            dout.writeChars(cmd.getString() + "\n");
            dout.flush();
            cmd.setString("");
        } catch (Exception e) {this.do_alert("Error sending data" , 4000);}
    }
}

public void FindDevices(){
    try{
        devices              = new java.util.Vector();
        LocalDevice local    = LocalDevice.getLocalDevice();
        DiscoveryAgent agent = local.getDiscoveryAgent();
        agent.startInquiry(DiscoveryAgent.GIAC,this);
    }catch(Exception e){this.do_alert("Erron in initiating search" , 4000);}
 }

public void FindServices(RemoteDevice device){
    try{
        UUID[] uuids  = new UUID[1];
        uuids[0]      = new UUID("27012f0c68af4fbf8dbe6bbaf7aa432a",false);    //The UUID of the ech service
        local         = LocalDevice.getLocalDevice();
        agent         = local.getDiscoveryAgent();
        agent.searchServices(null,uuids,device,this);
    }catch(Exception e){this.do_alert("Erron in initiating search" , 4000);}
}

public void deviceDiscovered(RemoteDevice remoteDevice,DeviceClass deviceClass) {
    devices.addElement(remoteDevice);
}

public void servicesDiscovered(int transID,ServiceRecord[] serviceRecord) {
    for (int x = 0; x &#60; serviceRecord.length; x++ )
        services.addElement(serviceRecord[x]);
    try{
        dev_list.append(((RemoteDevice)devices.elementAt(currentDevice)).
                                            getFriendlyName(false),null);
    }catch(Exception e){this.do_alert("Erron in initiating search" , 4000);}
}
public void inquiryCompleted(int param){
    switch (param) {
        case DiscoveryListener.INQUIRY_COMPLETED:    //Inquiry completed normally
            if (devices.size() &#62; 0){                 //Atleast one device has been found
                services = new java.util.Vector();
                this.FindServices((RemoteDevice)
                         devices.elementAt(0));     //Check if the first device offers the service
            }else
                do_alert("No device found in range",4000);
        break;
        case DiscoveryListener.INQUIRY_ERROR:       // Error during inquiry
            this.do_alert("Inqury error" , 4000);
        break;
        case DiscoveryListener.INQUIRY_TERMINATED:  // Inquiry terminated by agent.cancelInquiry()
             this.do_alert("Inqury Canceled" , 4000);
        break;
       }
}

public void serviceSearchCompleted(int transID, int respCode) {
    switch(respCode) {
        case DiscoveryListener.SERVICE_SEARCH_COMPLETED:
            if(currentDevice == devices.size() -1){ //all devices have been searched
                if(services.size() &#62; 0){
                    display.setCurrent(dev_list);
                }else
                    do_alert("The service was not found",4000);
            }else{                               //search next device
                currentDevice++;
                this.FindServices((RemoteDevice)devices.elementAt(currentDevice));
            }
        break;
        case DiscoveryListener.SERVICE_SEARCH_DEVICE_NOT_REACHABLE:
             this.do_alert("Device not Reachable" , 4000);
        break;
        case DiscoveryListener.SERVICE_SEARCH_ERROR:
             this.do_alert("Service serch error" , 4000);
        break;
        case DiscoveryListener.SERVICE_SEARCH_NO_RECORDS:
            this.do_alert("No records returned" , 4000);
        break;
        case DiscoveryListener.SERVICE_SEARCH_TERMINATED:
            this.do_alert("Inqury Cancled" , 4000);
        break;
     }
}

public void do_alert(String msg,int time_out){
    if (display.getCurrent() instanceof Alert ){
        ((Alert)display.getCurrent()).setString(msg);
        ((Alert)display.getCurrent()).setTimeout(time_out);
    }else{
        Alert alert = new Alert("Bluetooth");
        alert.setString(msg);
        alert.setTimeout(time_out);
        display.setCurrent(alert);
    }
}

public void pauseApp() {}

public void destroyApp(boolean unconditional) {}

}</pre>
</pre>
<p>Silakan anda juga membaca:<a href="http://www.miniware.net/articles/viewarticle.php?id=22" target="_blank"> http://www.miniware.net/articles/viewarticle.php?id=22</a></p>
<p>-= Sapto Sutardi =-<br />
Mataram, 4 November 2009</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[STRINGS IN JAVA]]></title>
<link>http://gilbertadjin.wordpress.com/2009/10/30/strings-in-java/</link>
<pubDate>Fri, 30 Oct 2009 08:30:00 +0000</pubDate>
<dc:creator>Gilbert Adjin Frimpong</dc:creator>
<guid>http://gilbertadjin.wordpress.com/2009/10/30/strings-in-java/</guid>
<description><![CDATA[“Wow !!!! Now Thus Intereeessssting” That was how i exclaimed when i saw these interesting features ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>“Wow !!!! Now Thus Intereeessssting” That was how i exclaimed when i saw these interesting features of the STRING class in java. All this while when i wanted to convert a character array to a string , i had to go through a loop. For example</p>
<p><span style="color:#0000ff;font-size:x-small;"><strong>String password = “” ;<br />
char[] pass = this.txtPassword.getPassword();<br />
for (int i = 0; i &#60; pass.length; i++) {<br />
password = password + pass[i];<br />
}</strong></span></p>
<p>But this char[] pass can easily be converted to string by just a line of code:</p>
<p><span style="color:#0000ff;font-size:x-small;"><strong>char[] pass = this.txtPassword.getPassword();<br />
String password=new String(pass);</strong></span></p>
<p>Also another interesting feature of the string class is that you can easily get the string value out of a byte array and vice versa with so much ease. check this.</p>
<p><span style="color:#0000ff;font-size:x-small;"><strong>byte[] array=&#8221;sdfdfd&#8221;.getBytes();<br />
String string=new String(array);</strong></span></p>
<p>These are not all, there are more interesting features, exploree!!!!</p>
<p>Fellows, enjoy the weekend</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Calling all Core Java Developers (looking for work)....]]></title>
<link>http://londonjavacommunity.wordpress.com/2009/10/27/calling-all-core-java-developers-looking-for-work/</link>
<pubDate>Tue, 27 Oct 2009 09:44:35 +0000</pubDate>
<dc:creator>barrycranford</dc:creator>
<guid>http://londonjavacommunity.wordpress.com/2009/10/27/calling-all-core-java-developers-looking-for-work/</guid>
<description><![CDATA[http://www.recruitersoft.com/online/clearview/ViewJob.aspx?JobId=706 Core Java, J2SE, SQL, Gaming, S]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.recruitersoft.com/online/clearview/ViewJob.aspx?JobId=706">http://www.recruitersoft.com/online/clearview/ViewJob.aspx?JobId=706</a><a href="http://londonjavacommunity.wordpress.com/files/2009/10/logo.gif?w=150"><img class="size-thumbnail wp-image-28 alignright" title="logo" src="http://londonjavacommunity.wordpress.com/files/2009/10/logo.gif?w=150" alt="logo" width="150" height="56" /></a></p>
<p><strong>Core Java, J2SE, SQL, Gaming, Server Side, Central London, 45k</strong></p>
<p>I have a number of positions working within a rapidly growing gaming company. My client are looking to grow by recruiting server side Java developers with exceptional design and development skills in Core Java &#38; SQL. The role will involve focusing on core programming requirements around performance, reliability, scalability and security.</p>
<p>The ideal candidates they are looking for will need to have at least 4 years experience in Java J2SE &#38; SQL. They are looking for people prepared to work as part of a hardworking focused team. The role is based in Central London and paying up to 45k.</p>
<p>For more information send me an email at <a href="mailto:b.cranford@clearview-itrs.co.uk">b.cranford@clearview-itrs.co.uk</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Bluecove di Eclipse]]></title>
<link>http://shaff.wordpress.com/2009/10/25/bluecove-di-eclipse/</link>
<pubDate>Sat, 24 Oct 2009 23:07:08 +0000</pubDate>
<dc:creator>shaff</dc:creator>
<guid>http://shaff.wordpress.com/2009/10/25/bluecove-di-eclipse/</guid>
<description><![CDATA[Sebelumnya saya menggunakan Netbeans untuk melakukan programming blutooth untuk J2SE. Iseng-iseng me]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Sebelumnya saya menggunakan Netbeans untuk melakukan programming blutooth untuk J2SE. Iseng-iseng menggunakan Eclipese (Pulsar Edition). Berikut ini cara menambahkan library bluecove/avetana di Eclipse:<br />
1.	Package Exploler<br />
2.	Klik kanan di nama folder project<br />
3.	Properties<br />
4.	Java Build Path<br />
5.	Add External JARs<br />
6.	Cari file Bluecove Anda<br />
7.	Open<br />
8.	OK</p>
<p>-= Sapto Sutardi =-<br />
Mataram, 25 Oktober 2009</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[VisualVM/JConsole genom ssh SOCKS tunnel]]></title>
<link>http://stacktrace.se/2009/10/23/visualvmjconsole-genom-ssh-socks-tunnel/</link>
<pubDate>Fri, 23 Oct 2009 06:40:58 +0000</pubDate>
<dc:creator>Anders Hedström</dc:creator>
<guid>http://stacktrace.se/2009/10/23/visualvmjconsole-genom-ssh-socks-tunnel/</guid>
<description><![CDATA[Om man vill använda JConsole eller VisualVM för att övervaka en JVM som ligger på en dator som man i]]></description>
<content:encoded><![CDATA[Om man vill använda JConsole eller VisualVM för att övervaka en JVM som ligger på en dator som man i]]></content:encoded>
</item>
<item>
<title><![CDATA[FORM.SHOWDIALOG() IN JAVA]]></title>
<link>http://gilbertadjin.wordpress.com/2009/10/21/form-showdialog-in-java/</link>
<pubDate>Wed, 21 Oct 2009 16:35:24 +0000</pubDate>
<dc:creator>Gilbert Adjin Frimpong</dc:creator>
<guid>http://gilbertadjin.wordpress.com/2009/10/21/form-showdialog-in-java/</guid>
<description><![CDATA[Have you wondered how to show a panel(form) as a dialog in java applications as done in .NET applica]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Have you wondered how to show a panel(form) as a dialog in java applications  as done in .NET applications by using the form.showDialog() method?  For example, when a user selects “Add New” from a Customer combobox, the customer panel shows as a dialog for a new entry before the user can continue. If you have been searching for this, here is your stop.</p>
<p>We will be making use of one JDialog, and your FORMS(JPanels in this sense).</p>
<p>To implement this add a JDialog to your application. Declare a variable contentPane and add the constructor like the one specified below.</p>
<p><span style="color:#000000;font-size:small;"><strong>private Container contentPane = null;</strong></span></p>
<p><span style="color:#000000;font-size:small;"><strong>public popupsjdialog(java.awt.Frame parent, JPanel panel, boolean modal) {<br />
//super(parent, modal);<br />
contentPane = this.getContentPane();<br />
initComponents();<br />
this.setSize(panel.getSize().width + 30, panel.getSize().width + 50);<br />
panel.setLocation(10, 30);<br />
contentPane.add(panel);<br />
repaint();<br />
this.setLocationRelativeTo(null); </strong></span></p>
<p><span style="color:#000000;font-size:small;"><strong> } </strong></span></p>
<p>Your are now done. Now to show any JPanel as a dialog add the following code to your event.</p>
<p><strong><span style="font-size:small;">helpdetailpanel hd = new helpdetailpanel(helpContent);<br />
hd.setSize(700, 700);<br />
popupsjdialog d = new popupsjdialog(null, hd, true);<br />
d.setVisible(true);</span></strong></p>
<p>Helpdetailpanel is a Jpanel (form) you want to show as a dialog and the popupsjdialog is an instance of the Jdialog we created its constructot above.</p>
<p>Cheers !!!!!!!!!!!!!!!!!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Decimal Input JTextField ]]></title>
<link>http://shaff.wordpress.com/2009/10/17/decimal-input-jtextfield/</link>
<pubDate>Sat, 17 Oct 2009 15:53:40 +0000</pubDate>
<dc:creator>shaff</dc:creator>
<guid>http://shaff.wordpress.com/2009/10/17/decimal-input-jtextfield/</guid>
<description><![CDATA[JTextField akan menerima semua tipe input text. Semua tipe, baik angka atau huruf. Jika Anda menging]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>JTextField akan menerima semua tipe input text. Semua tipe, baik angka atau huruf. Jika Anda menginginkan JTextField hanya menerima input angka saja. Maka berikut ini ada source codenya:</p>
<p>import java.awt.*;<br />
import java.awt.event.*;<br />
import java.text.*;<br />
import javax.swing.*;<br />
import javax.swing.text.NumberFormatter;</p>
<p>public class Decimal extends JFrame {<br />
  JFormattedTextField ftf1 = new JFormattedTextField();<br />
  JFormattedTextField ftf2 = new JFormattedTextField();</p>
<p>  public Decimal() {<br />
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);<br />
    setSize(200, 150);<br />
    try {<br />
      NumberFormat nf = NumberFormat.getNumberInstance();<br />
      nf.setMinimumIntegerDigits(1);<br />
      nf.setMaximumFractionDigits(2);<br />
      nf.setMinimumFractionDigits(2);<br />
      NumberFormatter formatter = new NumberFormatter(nf);<br />
      formatter.setAllowsInvalid(false);<br />
      ftf1 = new JFormattedTextField(formatter);<br />
      ftf1.setHorizontalAlignment(SwingConstants.RIGHT);<br />
      ftf1.setValue(new Double(0.));<br />
//      Doesn&#8217;t work, even when put in SwingUtilities.invokeLater(&#8230;).<br />
//      ftf1.setCaretPosition(1);<br />
    }<br />
    catch (Exception ex) {<br />
      System.out.println(ex);<br />
    }</p>
<p>    try {<br />
      NumberFormatter formatter = new NumberFormatter(<br />
						new DecimalFormat(&#8220;#,##0.00&#8243;));<br />
      formatter.setAllowsInvalid(false);<br />
      ftf2 = new JFormattedTextField(formatter);<br />
      ftf2.setHorizontalAlignment(SwingConstants.RIGHT);<br />
      ftf2.setValue(new Double(0.));<br />
    }<br />
    catch (Exception ex) {<br />
      System.out.println(ex);<br />
    }</p>
<p>    Container cp= getContentPane();<br />
    cp.setLayout(null);<br />
    ftf1.setBounds(20, 11, 139, 20);<br />
    ftf2.setBounds(20, 41, 139, 20);<br />
    cp.add(ftf1);<br />
    cp.add(ftf2);<br />
    setVisible(true);<br />
  }</p>
<p>  public static void main(String[] args) {<br />
    EventQueue.invokeLater(new Runnable() {<br />
      public void run() {<br />
	new Decimal();<br />
      }<br />
    });<br />
  }</p>
<p>}</p>
<p>Sumber: <a href="http://forums.sun.com/thread.jspa?threadID=5333895">http://forums.sun.com/thread.jspa?threadID=5333895</a></p>
<p>-= Sapto Sutardi =-<br />
Mataram, 17 Okt. 2009</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cek Bluetooth HP dll]]></title>
<link>http://shaff.wordpress.com/2009/10/17/cek-bluetooth-hp-dll/</link>
<pubDate>Sat, 17 Oct 2009 14:57:34 +0000</pubDate>
<dc:creator>shaff</dc:creator>
<guid>http://shaff.wordpress.com/2009/10/17/cek-bluetooth-hp-dll/</guid>
<description><![CDATA[1. Untuk melihat apakah HP anda mendukung jSR-82: try{ Class.forName(&#8220;javax.bluetooth.LocalDev]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><span style="color:#993300;"><strong>1. Untuk melihat apakah HP anda mendukung jSR-82:</strong></span><br />
try{<br />
Class.forName(&#8220;javax.bluetooth.LocalDevice&#8221;);<br />
}<br />
catch(Exception ex){<br />
System.out.println(&#8220;No support for JSR-82&#8243;);<br />
}<br />
<strong><span style="color:#993300;">2. Mulai mencari HP/alat yang mendukung Bluetooth, maka  gunakan &#8220;DiscoveryAgent&#8221;: </span></strong><br />
LocalDevice localDevice = LocalDevice.getLocalDevice();<br />
discoveryAgent = localDevice.getDiscoveryAgent();<br />
discoveryAgent.startInquiry(DiscoveryAgent.GIAC, this);<br />
<strong><span style="color:#993300;"><br />
3. Method &#8220;deviceDiscovered&#8221; dipanggil ketika HP/Alat ditemukan: </span></strong><br />
public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass cod) {<br />
try{<br />
remoteDevices.addElement(remoteDevice);<br />
} catch(Exception e){<br />
e.printStackTrace();<br />
}<br />
}<br />
<strong><span style="color:#993300;">4.</span></strong><span style="color:#993300;"><strong> Ketika HP/Alat ditemukan maka untuk mencari servis/layanan maka kita menggunakan:</strong></span><br />
LocalDevice localDevice = LocalDevice.getLocalDevice();<br />
DiscoveryAgent discoveryAgent = localDevice.getDiscoveryAgent();<br />
discoveryAgent.searchServices(attrSet, uuidSet, remoteDevice, this);<br />
And the servicesDiscovered method is called when a service is found:<br />
public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {<br />
for(int i = 0; i &#60; servRecord.length; i++) {<br />
DataElement serviceNameElement =<br />
servRecord[i].getAttributeValue(0&#215;0100);<br />
String temp_serviceName =<br />
(String)serviceNameElement.getValue();<br />
String serviceName = temp_serviceName.trim();<br />
}<br />
}</p>
<p>Sumber: <a href="http://developer.sonyericsson.com/site/global/techsupport/tipstrickscode/java/p_bluetooth_probe_jsr82.jsp" target="_blank">http://developer.sonyericsson.com/site/global/techsupport/tipstrickscode/java/p_bluetooth_probe_jsr82.jsp</a></p>
<p>-= Sapto Sutardi =-</p>
<p>Mataram, 17 Okt. 2009</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Contoh Aplikasi Bluetooh dari bluecove.org]]></title>
<link>http://shaff.wordpress.com/2009/10/16/contoh-aplikasi-bluetooh-dari-bluecove-org/</link>
<pubDate>Fri, 16 Oct 2009 06:16:10 +0000</pubDate>
<dc:creator>shaff</dc:creator>
<guid>http://shaff.wordpress.com/2009/10/16/contoh-aplikasi-bluetooh-dari-bluecove-org/</guid>
<description><![CDATA[Berikut ini beberapa contoh penggunaan bluecove: Jika komputer Anda belum terinstal bluecove silakan]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3>Berikut ini beberapa contoh penggunaan bluecove:</h3>
<p>Jika komputer Anda belum terinstal bluecove silakan <a title="Bluecove install" href="http://shaff.wordpress.com/2009/10/16/install-bluecove-di-windows-xp/" target="_blank">kesini</a></p>
<h3><a name="DeviceDiscovery">1. Remote Device Discovery</a></h3>
<p>The LocalDevice class provides method &#8216;getDiscoveryAgent&#8217; that returns an instance of the DiscoveryAgent.     This DiscoveryAgent can then be used to discover remote bluetooth devices (start HCI inquiry).</p>
<pre>import java.io.IOException;
import java.util.Vector;
import javax.bluetooth.*;

/**
 * Minimal Device Discovery example.
 */
public class RemoteDeviceDiscovery {

    public static final Vector/*&#60;RemoteDevice&#62;*/ devicesDiscovered = new Vector();

    public static void main(String[] args) throws IOException, InterruptedException {

        final Object inquiryCompletedEvent = new Object();

        devicesDiscovered.clear();

        DiscoveryListener listener = new DiscoveryListener() {

            public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
                System.out.println("Device " + btDevice.getBluetoothAddress() + " found");
                devicesDiscovered.addElement(btDevice);
                try {
                    System.out.println("     name " + btDevice.getFriendlyName(false));
                } catch (IOException cantGetDeviceName) {
                }
            }

            public void inquiryCompleted(int discType) {
                System.out.println("Device Inquiry completed!");
                synchronized(inquiryCompletedEvent){
                    inquiryCompletedEvent.notifyAll();
                }
            }

            public void serviceSearchCompleted(int transID, int respCode) {
            }

            public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
            }
        };

        synchronized(inquiryCompletedEvent) {
            boolean started = LocalDevice.getLocalDevice().getDiscoveryAgent().startInquiry(DiscoveryAgent.GIAC, listener);
            if (started) {
                System.out.println("wait for device inquiry to complete...");
                inquiryCompletedEvent.wait();
                System.out.println(devicesDiscovered.size() +  " device(s) found");
            }
        }
    }

}
</pre>
<h3><a name="ServicesSearch">2. Services Search</a></h3>
<p>The following example shows how to use the DiscoveryAgent to find OBEX Push bluetooth service.     Class from DeviceDiscovery example is used to find Bluetooth Devices.</p>
<pre>import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;
import javax.bluetooth.*;

/**
 *
 * Minimal Services Search example.
 */
public class ServicesSearch {

    static final UUID OBEX_FILE_TRANSFER = new UUID(0x1106);

    public static final Vector/*&#60;String&#62;*/ serviceFound = new Vector();

    public static void main(String[] args) throws IOException, InterruptedException {

        // First run RemoteDeviceDiscovery and use discoved device
        RemoteDeviceDiscovery.main(null);

        serviceFound.clear();

        UUID serviceUUID = OBEX_OBJECT_PUSH;
        if ((args != null) &#38;&#38; (args.length &#62; 0)) {
            serviceUUID = new UUID(args[0], false);
        }

        final Object serviceSearchCompletedEvent = new Object();

        DiscoveryListener listener = new DiscoveryListener() {

            public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
            }

            public void inquiryCompleted(int discType) {
            }

            public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
                for (int i = 0; i &#60; servRecord.length; i++) {
                    String url = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
                    if (url == null) {
                        continue;
                    }
                    serviceFound.add(url);
                    DataElement serviceName = servRecord[i].getAttributeValue(0x0100);
                    if (serviceName != null) {
                        System.out.println("service " + serviceName.getValue() + " found " + url);
                    } else {
                        System.out.println("service found " + url);
                    }
                }
            }

            public void serviceSearchCompleted(int transID, int respCode) {
                System.out.println("service search completed!");
                synchronized(serviceSearchCompletedEvent){
                    serviceSearchCompletedEvent.notifyAll();
                }
            }

        };

        UUID[] searchUuidSet = new UUID[] { serviceUUID };
        int[] attrIDs =  new int[] {
                0x0100 // Service name
        };

        for(Enumeration en = RemoteDeviceDiscovery.devicesDiscovered.elements(); en.hasMoreElements(); ) {
            RemoteDevice btDevice = (RemoteDevice)en.nextElement();

            synchronized(serviceSearchCompletedEvent) {
                System.out.println("search services on " + btDevice.getBluetoothAddress() + " " + btDevice.getFriendlyName(false));
                LocalDevice.getLocalDevice().getDiscoveryAgent().searchServices(attrIDs, searchUuidSet, btDevice, listener);
                serviceSearchCompletedEvent.wait();
            }
        }

    }

}
</pre>
<h3><a name="OBEXPutClient">3. OBEX Put Client</a></h3>
<pre>import java.io.IOException;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.obex.*;

public class ObexPutClient {

    public static void main(String[] args) throws IOException, InterruptedException {

        String serverURL = null; // = "btgoep://0019639C4007:6";
        if ((args != null) &#38;&#38; (args.length &#62; 0)) {
            serverURL = args[0];
        }
        if (serverURL == null) {
            String[] searchArgs = null;
            // Connect to OBEXPutServer from examples
            // searchArgs = new String[] { "11111111111111111111111111111123" };
            ServicesSearch.main(searchArgs);
            if (ServicesSearch.serviceFound.size() == 0) {
                System.out.println("OBEX service not found");
                return;
            }
            // Select the first service found
            serverURL = (String)ServicesSearch.serviceFound.elementAt(0);
        }

        System.out.println("Connecting to " + serverURL);

        ClientSession ClientSession "&#62;clientSession = (ClientSession) Connector.open(serverURL);
        HeaderSet hsConnectReply = clientSession.connect(null);
        if (hsConnectReply.getResponseCode() != ResponseCodes.OBEX_HTTP_OK) {
            System.out.println("Failed to connect");
            return;
        }

        HeaderSet hsOperation = clientSession.createHeaderSet();
        hsOperation.setHeader(HeaderSet.NAME, "Hello.txt");
        hsOperation.setHeader(HeaderSet.TYPE, "text");

        //Create PUT Operation
        Operation putOperation = clientSession.put(hsOperation);

        // Send some text to server
        byte data[] = "Hello world!".getBytes("iso-8859-1");
        OutputStream os = putOperation.openOutputStream();
        os.write(data);
        os.close();

        putOperation.close();

        clientSession.disconnect(null);

        clientSession.close();
    }
}
</pre>
<h3><a name="OBEXPutServer">4. OBEX Put Server</a></h3>
<p>This class will start an OBEX service that will accept Put commands and print it to standard out.</p>
<pre>import java.io.IOException;
import java.io.InputStream;

import javax.bluetooth.*;
import javax.microedition.io.Connector;
import javax.obex.*;

public class OBEXPutServer {

    static final String serverUUID = "11111111111111111111111111111123";

    public static void main(String[] args) throws IOException {

        LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.GIAC);

        SessionNotifier SessionNotifier "&#62;serverConnection = (SessionNotifier) Connector.open("btgoep://localhost:"
                + serverUUID + ";name=ObexExample");

        int count = 0;
        while(count &#60; 2) {
            RequestHandler handler = new RequestHandler();
            serverConnection.acceptAndOpen(handler);
            System.out.println("Received OBEX connection " + (++count));
        }
    }

    private static class RequestHandler extends ServerRequestHandler {

        public int onPut(Operation op) {
            try {
                HeaderSet hs = op.getReceivedHeaders();
                String name = (String) hs.getHeader(HeaderSet.NAME);
                if (name != null) {
                    System.out.println("put name:" + name);
                }

                InputStream is = op.openInputStream();

                StringBuffer StringBuffer "&#62;buf = new StringBuffer();
                int data;
                while ((data = is.read()) != -1) {
                    buf.append((char) data);
                }

                System.out.println("got:" + buf.toString());

                op.close();
                return ResponseCodes.OBEX_HTTP_OK;
            } catch (IOException e) {
                e.printStackTrace();
                return ResponseCodes.OBEX_HTTP_UNAVAILABLE;
            }
        }
    }
}

Sumber: <a title="Bluecove example" href="http://www.bluecove.org/bluecove/apidocs/overview-summary.html" target="_blank">http://www.bluecove.org/bluecove/apidocs/overview-summary.html</a>

-= Sapto Sutardi =-
 Mataram, 16 Okt 2009
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Software Engineers]]></title>
<link>http://thewalkin.wordpress.com/2009/10/12/software-engineers/</link>
<pubDate>Mon, 12 Oct 2009 01:40:27 +0000</pubDate>
<dc:creator>The Editor</dc:creator>
<guid>http://thewalkin.wordpress.com/2009/10/12/software-engineers/</guid>
<description><![CDATA[Nihar Info Global Limited are looking for fresh BE/B.Tech/MCA /B.Sc Comp/BCA/BIT- 2006,2007,2008 ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Nihar Info Global Limited are looking for fresh <strong>BE/B.Tech/MCA /B.Sc Comp/BCA/BIT- 2006,2007,2008 &#38; 2009 batch</strong> for Software Engineer position. If any body has this qualification and looking for Software Engineer Career on latest technologies platform. i.e. FileNet, J2EE and ECM solution etc.</p>
<p><strong>Walk-in Interviews from 12th till 16th Oct for Software Engineers from 10.30AM to 1.00PM</strong><br />
Gayatri Mane<br />
HR- Manager<br />
Nihar Info Global Limited<br />
Plot-34 &#124; Nihar House &#124; Ganesh Nagar Colony &#124; West Marredpally &#124; Secunderabad -500026 &#124; AP &#124; India</p>
<p><a href="http://www.freshershome.com/jobs/index.php?post_id=16867" target="_blank"><strong>Please Click Here for more details</strong></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tetraminoes Applet 1.1, actualizado en la web]]></title>
<link>http://gorkasg.wordpress.com/2009/10/02/tetraminoes-applet-1-1-actualizado-en-la-web/</link>
<pubDate>Fri, 02 Oct 2009 11:23:13 +0000</pubDate>
<dc:creator>gorkasg</dc:creator>
<guid>http://gorkasg.wordpress.com/2009/10/02/tetraminoes-applet-1-1-actualizado-en-la-web/</guid>
<description><![CDATA[Muchas gracias a Fenris78 otra vez, por haberse molestado en actualizar el applet del tetraminoes en]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Muchas gracias a <a href="http://fenris78.blogspot.com/" target="_blank">Fenris78</a> otra vez, por haberse molestado en actualizar el applet del tetraminoes en su web. Para el que no lo haya probado, y quiera hacerlo, lo podeis encontrar en <a href="http://www.siliconcreatures.com/gorkin/applets/tetris.html" target="_blank">esta dirección</a>.</p>
<p>Un saludo,<br />
Gorka Suárez.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tetraminoes terminado]]></title>
<link>http://gorkasg.wordpress.com/2009/10/01/tetraminoes-terminado/</link>
<pubDate>Thu, 01 Oct 2009 12:42:52 +0000</pubDate>
<dc:creator>gorkasg</dc:creator>
<guid>http://gorkasg.wordpress.com/2009/10/01/tetraminoes-terminado/</guid>
<description><![CDATA[Hoy por fin, he terminado de documentar un poco el código de la versión para móviles de este juego q]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hoy por fin, he terminado de documentar un poco el código de la versión para móviles de este juego que estaba programando. Básicamente lo terminé ayer por la noche, pero como no había ni un comentario, pensé que lo mismo dejar el código así solo provocaría que aquel que lo leyera se acordara de toda mi familia xD Así que terminado esto, tan solo me queda esperar a ver si alguien encuentra algún fallo grave que deba corregir.</p>
<p>Aparezcan fallos o no, que luego corrija, doy ya por finalizado el proyecto. La verdad es que me siento bastante aliviado de haber terminado esto y que no haya sido tan costoso como por ejemplo haber programado el pac-man. Además, con esto terminan mis proyectos amateurs programados en java por una muy larga temporada, si es que no terminan para siempre (que otra cosa es que me paguen por ello xD). De hecho no pienso programar ningún juego en java, salvo que quizás me pusiera a aprender a programar para el Android, pero de momento no es algo que tenga contemplado a corto plazo.</p>
<p>El juego tanto la versión applet como la versión para móviles la podeis encontrar en <a href="http://gorkasg.wordpress.com/juegos/tetraminoes/">esta página</a>. No se cuantos días tardarán en subir la nueva versión del applet a la página web de Fenris78, pero cuando esté ya avisaré en el blog. Para cualquier cosa podeis dejar un comentario aquí o en el <a href="http://www.stratos-ad.com/forums/index.php?topic=12562" target="_blank">foro de stratos</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tetraminoes finalmente colgado en la web]]></title>
<link>http://gorkasg.wordpress.com/2009/09/30/tetraminoes-finalmente-colgado-en-la-web/</link>
<pubDate>Wed, 30 Sep 2009 10:27:13 +0000</pubDate>
<dc:creator>gorkasg</dc:creator>
<guid>http://gorkasg.wordpress.com/2009/09/30/tetraminoes-finalmente-colgado-en-la-web/</guid>
<description><![CDATA[Gracias a Fenris78 podeis probar el juego desde aquí sin tener que descargarlo, un gesto desinteresa]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Gracias a <a href="http://fenris78.blogspot.com/" target="_blank">Fenris78</a> podeis probar el juego <a href="http://www.siliconcreatures.com/gorkin/applets/tetris.html" target="_blank">desde aquí</a> sin tener que descargarlo, un gesto desinteresado que agradezco profundamente ^_^ El caso es que ya van al menos 2 que se me han quejado del manejo de las teclas en el juego, por lo que para la próxima semana, cuando haya terminado de protarlo al móvil, me imagino que me pondré a modificar el control a ver si lo hago un poco menos lamentable para el resto de mis congéneres humanos.</p>
<p>Y bueno, ya he empezado la conversión a la versión de móvil. Es una tarea bastante lamentable, porque básicamente estoy pasando de orientado a objetos a programación estructurada, con lo que ello implica. Además si esto lo vieran los profesores de la universidad que enseñan programación en primero, se arrancarían los ojos. Pero es lo que tiene el J2ME si quieres evitar a toda costa que pudiera ir petado y a trompicones. En fin, a ver si salgo más o menos cuerdo de este proceso lastimero.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
