<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Çağdaş&#039;ın Günlüğü &#187; java</title>
	<atom:link href="http://www.cagdastopcu.com/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cagdastopcu.com</link>
	<description>THE GNU HARDWARE DEVELOPER</description>
	<lastBuildDate>Tue, 04 Oct 2011 14:50:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Java ile Thread Kullanarak Socket Programlama</title>
		<link>http://www.cagdastopcu.com/java-ile-thread-kullanarak-socket-programlama.html</link>
		<comments>http://www.cagdastopcu.com/java-ile-thread-kullanarak-socket-programlama.html#comments</comments>
		<pubDate>Fri, 30 Sep 2011 13:32:42 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[GNU]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[programlama]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/?p=469</guid>
		<description><![CDATA[Bu yazımda çok işlevsel olmasa da Android için telnet client&#8217;ı yazarken kullandığım echo server kodlarını anlatacağım. NIO paketini kullanmadığım için aslında çok da sağlıklı değil ve her bağlantı için ayrıca bir thread oluşturulmaktadır. Bu nedenle çok fazla yüklenmelere dayanamayacak bir server olacak bizimkisi. Önce Java&#8217;da socket işleri nasıl yürüyor ona bakalım. Javada ServerSocket ve Socket &#8230; </p><p><a class="more-link block-button" href="http://www.cagdastopcu.com/java-ile-thread-kullanarak-socket-programlama.html">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Bu yazımda çok işlevsel olmasa da Android için telnet client&#8217;ı yazarken kullandığım echo server kodlarını anlatacağım. NIO paketini kullanmadığım için aslında çok da sağlıklı değil ve her bağlantı için ayrıca bir thread oluşturulmaktadır. Bu nedenle çok fazla yüklenmelere dayanamayacak bir server olacak bizimkisi.</p>
<p>Önce Java&#8217;da socket işleri nasıl yürüyor ona bakalım. Javada ServerSocket ve Socket olmak üzere kullanıma hazır iki socket türü var(Aslında LocalSocket de var). Server sürekli bekleme işini yaptığımız ve dışardan birisi bağlanırsa ona gereken cevabı verdirttiğimiz makinede sürekli çalışmak zorunda olan programımız. ServerSocket sınıfının constructoru ile hangi porttan bu server hizmetini vereceğimizi belirlememiz gerekiyor.</p>
<p><strong>Olay ise şundan ibaret:</strong></p>
<p>1- ServerSocket&#8217;imiz bir portu izler durur.</p>
<p>2- Client bir Socket yardımıyla bizim Server&#8217;ımızın portuna naber der.</p>
<p>3- ServerSocket bu bağlantıyı accept() static methoduyla aldıktan sonra bir socket oluşturur.</p>
<p>4- Bu oluşturulan socket ile haberleşirler. Ve mutlu son <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Neden Thread Kullanmalıyım?</strong></p>
<p>Çok basit! Server&#8217;a birden fazla client&#8217;ın bağlanabilmesi için bu yapılır. Client tarafından gelen verinin ne kadar sürede geleceği belli değildir. Bu sebeple o verilerin alınma işlemleri bir thread&#8217;ın run methodunun içine gömülür. Ardından serverda start() static methodu ile thread çalıştırılır.</p>
<p><strong>Server&#8217;ımızın Kodu:</strong></p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.cagdas.network</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.InetAddress</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.ServerSocket</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.Socket</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EnterpriseEchoServer <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param args
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">ServerSocket</span> ss<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			ss <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ServerSocket</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">23</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">InetAddress</span>.<span style="color: #006633;">getLocalHost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; hazir&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #003399;">Socket</span> s <span style="color: #339933;">=</span> ss.<span style="color: #006633;">accept</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>s.<span style="color: #006633;">getInetAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHostName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; &quot;</span>
						<span style="color: #339933;">+</span> s.<span style="color: #006633;">getInetAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHostAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; baglandi&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">new</span> EESThreadPart<span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span>
			e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">// Telnet hizmeti</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Burada 23 numaralı telnet portunu seçtim. Kodda görüldüğü üzere s socketi serversocketinin accept metodu ile gelen isteği kabul edilip oluşturuluyor. getInetAdress() methodu ile bağlanan kişinin bilgileri HostName ve HostAdress gibi bilgileri alınabiliyor. Ardından s socketi thread&#8217;li kısma gönderiliyor.</p>
<p>&nbsp;</p>
<p><strong>Thread kullanılan Sınıf</strong></p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.cagdas.network</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.PrintStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.Socket</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Scanner</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EESThreadPart <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">Thread</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Socket</span> s<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> EESThreadPart<span style="color: #009900;">&#40;</span><span style="color: #003399;">Socket</span> s<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">s</span> <span style="color: #339933;">=</span> s<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">PrintStream</span> pr<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			pr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">PrintStream</span><span style="color: #009900;">&#40;</span>s.<span style="color: #006633;">getOutputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			Scanner sc <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scanner<span style="color: #009900;">&#40;</span>s.<span style="color: #006633;">getInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			pr.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Server'a baglandiniz. Cikmak icin bye yazin.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Client'a</span>
			<span style="color: #003399;">String</span> gelen<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// gonderiliyor</span>
			<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// sonsuz dongu</span>
				gelen <span style="color: #339933;">=</span> sc.<span style="color: #006633;">nextLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// client'dan geliyor</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>gelen.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;bye&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Client:&quot;</span> <span style="color: #339933;">+</span> gelen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				pr.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Echo:&quot;</span> <span style="color: #339933;">+</span> gelen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			s.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>
					.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>s.<span style="color: #006633;">getInetAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHostName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; &quot;</span>
							<span style="color: #339933;">+</span> s.<span style="color: #006633;">getInetAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHostAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
							<span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; serverdan cikti!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span>
			e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Burada PrintStream kullanılarak Client&#8217;a veri gönderilmiş ve ondan gelenler de Scanner yardımıyla sonsuz döngü içerisinde beklenmiştir. Bye yazıca client ile bağlantıyı sağlayan socket sonlandırılmakta.</p>
<p><strong>Server&#8217;ımızı Nasıl Deneriz?</strong></p>
<p>Telnet portunu (23) kullanmamızın bir nedeni vardı <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Herhangi bir telnet clientı ile programınız çalışıyorken denemelerinizi yapabilirsiniz. Mesela ubuntuda şöyle kullanılabilir:</p>
<p>cagdas@cagdas-K53SV:~$ telnet<br />
telnet&gt; open localhost<br />
Trying 127.0.0.1&#8230;<br />
Connected to localhost.<br />
Escape character is &#8216;^]&#8217;.<br />
Server&#8217;a baglandiniz. Cikmak icin bye yazin.</p>
<div class="shr-publisher-469"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/java-ile-thread-kullanarak-socket-programlama.html&via=cagdastopcucom&text=Java ile Thread Kullanarak Socket Programlama&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/java-ile-thread-kullanarak-socket-programlama.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My First Design Pattern in Java : Singleton</title>
		<link>http://www.cagdastopcu.com/my-first-design-pattern-in-java-singleton.html</link>
		<comments>http://www.cagdastopcu.com/my-first-design-pattern-in-java-singleton.html#comments</comments>
		<pubDate>Wed, 29 Jun 2011 19:13:36 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[programlama]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/?p=382</guid>
		<description><![CDATA[I learned my first design pattern at my oop based java lesson. If you need to create only one instance  and reuse this instance forever (or some classes need only one instance who knows?) you can use this pattern. This pattern was published by GoF. Where we can use? Some application need unique items. For &#8230; </p><p><a class="more-link block-button" href="http://www.cagdastopcu.com/my-first-design-pattern-in-java-singleton.html">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I learned my first design pattern at my oop based java lesson. If you need to create only one instance  and reuse this instance forever (or some classes need only one instance who knows?) you can use this pattern. This pattern was published by GoF.</p>
<p>Where we can use?</p>
<p>Some application need unique items. For example, my company use unique billing system in crm program because we need a unique reference.</p>
<p>How can I use?</p>
<p>First we add private constructor at our claas. It means that we can not use &#8220;new&#8221; operator at other class. Because when we use &#8220;new&#8221; operator, it calls class&#8217;s constructor for creating instance. Actually, if I can not use new operator at other class and how can I create new instance? Static keyword is the answer of the question. I write a static and public method for getting a new object and then I can create new objects. Then we can count creating of instances via a static integer field (I call it count in my piece of code).  Finally, I use if statement for creating my instance in static getCagdasSingleton() method.</p>
<p>Blueprint of CagdasSingleton class:</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.cagdastopcu.com/wp-content/uploads/2011/06/CagdasSingleton.jpg"><img class="size-medium wp-image-396 aligncenter" title="CagdasSingleton Blueprint UML Diagram" src="http://www.cagdastopcu.com/wp-content/uploads/2011/06/CagdasSingleton-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p>&nbsp;</p>
<p>and finally simple java code of my singleton class:</p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 */</span>
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.cagdastopcu.designpatterns</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author cagdas
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CagdasSingleton <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> count<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> nediryani<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> index<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> CagdasSingleton single<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> CagdasSingleton<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		index <span style="color: #339933;">=</span> count<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> CagdasSingleton getCagdasSingleton<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// if (single == null)</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>count<span style="color: #339933;">++</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Is it the first creation?</span>
			single <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CagdasSingleton<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// if yes we create our instance</span>
		<span style="color: #000000; font-weight: bold;">return</span> single<span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// if no we use old instance :)</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> setNediryani<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		nediryani <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">int</span> getLan<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> nediryani<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">int</span> getIndex<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> index<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>&nbsp;</p>
<p>This is the test class:</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.cagdastopcu.designpatterns</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CagdasSingletonDriver <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		CagdasSingleton mySingleton1 <span style="color: #339933;">=</span> CagdasSingleton.<span style="color: #006633;">getCagdasSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton1.<span style="color: #006633;">getIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		CagdasSingleton mySingleton2 <span style="color: #339933;">=</span> CagdasSingleton.<span style="color: #006633;">getCagdasSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton2.<span style="color: #006633;">getIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		CagdasSingleton mySingleton3 <span style="color: #339933;">=</span> CagdasSingleton.<span style="color: #006633;">getCagdasSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton3.<span style="color: #006633;">getIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		CagdasSingleton mySingleton4 <span style="color: #339933;">=</span> CagdasSingleton.<span style="color: #006633;">getCagdasSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton4.<span style="color: #006633;">getIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton3<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>mySingleton4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>Output:</p>
<p>&nbsp;</p>

<div class="wp-terminal">cagdas@zanpakutou:$ <br/><br/>1<br/>1<br/>1<br/>1<br/>com.cagdastopcu.designpatterns.CagdasSingleton@30c221<br/>com.cagdastopcu.designpatterns.CagdasSingleton@30c221<br/>com.cagdastopcu.designpatterns.CagdasSingleton@30c221<br/>com.cagdastopcu.designpatterns.CagdasSingleton@30c221<br/></div>

<p>&nbsp;</p>
<p>I tested my singleton design pattern with print reference fields. They point to same heap adress.</p>
<div class="shr-publisher-382"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/my-first-design-pattern-in-java-singleton.html&via=cagdastopcucom&text=My First Design Pattern in Java : Singleton&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/my-first-design-pattern-in-java-singleton.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java BlackBerry Eclipse Plugin</title>
		<link>http://www.cagdastopcu.com/java-blackberry-eclipse-plugin.html</link>
		<comments>http://www.cagdastopcu.com/java-blackberry-eclipse-plugin.html#comments</comments>
		<pubDate>Wed, 20 Apr 2011 22:14:25 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[programlama]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[indir]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[yükle]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/?p=365</guid>
		<description><![CDATA[Kendi sitesinden indirmek sürekli donmalar olduğu için biraz sıkıntılıydı. İkinci bir link olmasını istedim. Java BlackBerry Eclipse Plugin 1.3 versiyonunu şu linkten indirebilirsiniz: Java BlackBerry Eclipse Plugin 1.3 Maalesef linux versiyonu olmadığından BlackBerry için ubuntuda kod yazmak sıkıntılı. Virtual Machine üzerinden bu tarz atraksiyonlara girilebilir ancak. Gereksinimleri: Eclipse 3.6 Helios 32-bit Windows® XP, Windows Vista® &#8230; </p><p><a class="more-link block-button" href="http://www.cagdastopcu.com/java-blackberry-eclipse-plugin.html">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a href="http://www.cagdastopcu.com/wp-content/uploads/2011/04/blackberryicon.jpg"><img class="alignleft size-medium wp-image-366" title="blackberryicon" src="http://www.cagdastopcu.com/wp-content/uploads/2011/04/blackberryicon-300x300.jpg" alt="" width="180" height="180" /></a></p>
<p>Kendi sitesinden indirmek sürekli donmalar olduğu için biraz sıkıntılıydı. İkinci bir link olmasını istedim.</p>
<p>Java BlackBerry Eclipse Plugin 1.3 versiyonunu şu linkten indirebilirsiniz:</p>
<p><a title="Java BlackBerry Eclipse Plugin 1.3 indir download" href="http://hotfile.com/dl/115225891/c37be37/BlackBerry_JDE_PluginFull_1.3.0.201102031007-19.exe.html">Java BlackBerry Eclipse Plugin 1.3</a></p>
<p>Maalesef linux versiyonu olmadığından BlackBerry için ubuntuda kod yazmak sıkıntılı. Virtual Machine üzerinden bu tarz atraksiyonlara girilebilir ancak.</p>
<p>Gereksinimleri:</p>
<ul>
<li>Eclipse 3.6 Helios</li>
<li>32-bit Windows® XP, Windows Vista® veya Windows 7 (<strong>Note:</strong> 64-bit versionlar 32-bit Java® ve Eclipse&#8217;e ihtiyaç duyar)</li>
<li>Java SE Development Kit (JDK) 6, update 10 veya daha üstü</li>
</ul>
<p>Programlama manueli:</p>
<p><a href="http://www.blackberry.com/developers/docs/6.0.0api/">http://www.blackberry.com/developers/docs/6.0.0api/</a></p>
<div class="shr-publisher-365"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/java-blackberry-eclipse-plugin.html&via=cagdastopcucom&text=Java BlackBerry Eclipse Plugin&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/java-blackberry-eclipse-plugin.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Android XML Uygulaması</title>
		<link>http://www.cagdastopcu.com/android-xml-uygulamasi.html</link>
		<comments>http://www.cagdastopcu.com/android-xml-uygulamasi.html#comments</comments>
		<pubDate>Sun, 03 Apr 2011 15:04:24 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[GNU]]></category>
		<category><![CDATA[programlama]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[izleme]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/?p=357</guid>
		<description><![CDATA[Android işletim sistemi üzerine çalışırken working with xml on android makalesine denk geldim. XML parsing üzerine yazılmış çok güzel bir yazı. Buradaki proje dosyasını indirip bazı geliştirmeler yaparak kısa sürede internetten xml dosyasını çekip bunun üzerinde işlemlerinizi yapabilirsiniz. XML parsing internet sitelerinde kullanılabileceği gibi bir endüstriyel otomasyon sistemlerinden verilerin anlık olarak android telefon üzerinden izlenmesini &#8230; </p><p><a class="more-link block-button" href="http://www.cagdastopcu.com/android-xml-uygulamasi.html">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Android işletim sistemi üzerine çalışırken <a href="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82">working with xml on android</a> makalesine denk geldim. XML parsing üzerine yazılmış çok güzel bir yazı. Buradaki proje dosyasını indirip bazı geliştirmeler yaparak kısa sürede internetten xml dosyasını çekip bunun üzerinde işlemlerinizi yapabilirsiniz. XML parsing internet sitelerinde kullanılabileceği gibi bir endüstriyel otomasyon sistemlerinden verilerin anlık olarak android telefon üzerinden izlenmesini de mümkün hale getiriyor. Yani uygulama alanı sınırsız bir konu =)</p>
<p>Projede FeedParserFactory.java ve string.xml dosyalarını değiştirerek hızlıca çalışıp çalışmadığını kontrol edebilirsiniz. Kendi sitemin /feed.xml dosyasını çektim ve aşağıdaki rss beslemesini elde ettim. Ayrıca konu başlıklarına tıklayarak sitenin kendisine bağlanmak da mümkün.</p>
<p><a href="http://www.ibm.com/developerworks/apps/download/index.jsp?contentid=398121&amp;filename=AndroidXml.zip&amp;method=http&amp;locale=worldwide">Android XML parsing apisini</a> indirip sizde xml işlemlerine başlayabilirsiniz.</p>
<p><a href="http://www.cagdastopcu.com/wp-content/uploads/2011/04/xmlonandroid.png"><img class="aligncenter size-medium wp-image-358" title="xmlonandroid" src="http://www.cagdastopcu.com/wp-content/uploads/2011/04/xmlonandroid-260x300.png" alt="" width="260" height="300" /></a></p>
<p>Basit bir şekilde renk ve tema değişikliğiyle biraz şeffaf, esc tuşuyla ana ekrana hızlıca geçilen daha kullanışlı bir hale getirebiliriz.</p>
<p>AndroidMainfest.xml dosyasında şu değişikliği yapmak lazım temayı değişirmek için:</p>
<blockquote><p>&lt;activity android:name=&#8221;.MessageList&#8221;<br />
android:label=&#8221;@string/app_name&#8221;<br />
android:theme=&#8221;@android:style/Theme.Dialog&#8221;&gt;</p></blockquote>
<p>Sonuç çok güzel <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.cagdastopcu.com/wp-content/uploads/2011/04/androidxml1.png"><img class="aligncenter size-medium wp-image-362" title="androidxml1" src="http://www.cagdastopcu.com/wp-content/uploads/2011/04/androidxml1-184x300.png" alt="" width="184" height="300" /></a></p>
<div class="shr-publisher-357"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/android-xml-uygulamasi.html&via=cagdastopcucom&text=Android XML Uygulaması&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/android-xml-uygulamasi.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>İlk Android Programım</title>
		<link>http://www.cagdastopcu.com/ilk-android-programi.html</link>
		<comments>http://www.cagdastopcu.com/ilk-android-programi.html#comments</comments>
		<pubDate>Thu, 24 Mar 2011 22:51:35 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[GNU]]></category>
		<category><![CDATA[programlama]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[yazılım]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/?p=348</guid>
		<description><![CDATA[Sonunda ilk kodumu çalıştırmayı başardım. Google Android SDK ile gelen emulatör 15 dakikada açılıyor ve programlarımı çalıştıramıyordum. Biraz araştırınca bu sorunun herkeste olduğunu gördüm. Ardından bilgisayarımı yedekleyip formatı çaktım Daha hızlandı mı dersiniz? Eh 15 dakika olmasa da 5 dakikada açılıyor artık android oyuncağım. İşin püf noktası emulatörü sadece bir defa açıp uygulamaları modifiye ettikçe &#8230; </p><p><a class="more-link block-button" href="http://www.cagdastopcu.com/ilk-android-programi.html">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a href="http://www.cagdastopcu.com/wp-content/uploads/2011/03/ilkandroid.png"><img class="aligncenter size-medium wp-image-349" title="ilkandroid" src="http://www.cagdastopcu.com/wp-content/uploads/2011/03/ilkandroid-300x278.png" alt="Android İlk Projem" width="300" height="278" /></a></p>
<p>Sonunda ilk kodumu çalıştırmayı başardım. Google Android SDK ile gelen emulatör 15 dakikada açılıyor ve programlarımı çalıştıramıyordum. Biraz araştırınca bu sorunun herkeste olduğunu gördüm. Ardından bilgisayarımı yedekleyip formatı çaktım <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Daha hızlandı mı dersiniz? Eh 15 dakika olmasa da 5 dakikada açılıyor artık android oyuncağım. İşin püf noktası emulatörü sadece bir defa açıp uygulamaları modifiye ettikçe onda uygulamakmış. Eclipse&#8217;e o kadar da hakim olmamamdan kaynaklanan bir durum aslında bu. Projenin üzerine sağ tıklayıp run as android application&#8217;u tıklamamız yeterliymiş <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) top komutuyla aldığım çıktıda cpu %23 bellek de %16 çıktı. Bu da benim eski bilgisayarım için yeterli bir değer <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>cagdas    20   0  403m 158m 7640 R   23 16.0   5:44.53 emulator</p>
<p>SDK&#8217;nın kurulumunda kullandığım belgeler:</p>
<p>http://www.helloandroid.com/tutorials/how-set-eclipse-android-sdk-ubuntu-linux-904910-updated</p>
<p>Hello World Programı:</p>
<p>http://developer.android.com/resources/tutorials/hello-world.html</p>
<p>Android Emulatörün Eclipse ile kullanımını anlatan güzel bir video:</p>
<p><object width="590" height="357"><param name="movie" value="http://www.youtube.com/v/SVZ1P35xgNQ?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SVZ1P35xgNQ?version=3" type="application/x-shockwave-flash" width="590" height="357" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>&nbsp;</p>
<p>Devamında XML öğrenmem gerektiğini farkettim. XML ile şöyle bir arayüzü yapmamız bir iki dakikalık iş <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p><a href="http://www.cagdastopcu.com/wp-content/uploads/2011/03/deneme1.png"><img class="aligncenter size-medium wp-image-353" title="deneme1" src="http://www.cagdastopcu.com/wp-content/uploads/2011/03/deneme1-185x300.png" alt="android gui arayüz tasarımı xml" width="185" height="300" /></a></p>
<div class="shr-publisher-348"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/ilk-android-programi.html&via=cagdastopcucom&text=İlk Android Programım&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/ilk-android-programi.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Yeni Yılı Java Me (MIDP) ile kutlamak</title>
		<link>http://www.cagdastopcu.com/yeni-yili-java-me-midp-ile-kutlamak.html</link>
		<comments>http://www.cagdastopcu.com/yeni-yili-java-me-midp-ile-kutlamak.html#comments</comments>
		<pubDate>Fri, 01 Jan 2010 00:05:57 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[GNU]]></category>
		<category><![CDATA[pragramlama]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[k550i]]></category>
		<category><![CDATA[konfigürasyon]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[sony]]></category>
		<category><![CDATA[toolkit]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/yeni-yili-java-me-midp-ile-kutlamak.html</guid>
		<description><![CDATA[Sony Ericsson k550i de Java konfigürasyonlarını girmemiz gerekiyor. Profiles MIDP-2.0 Configuration CLDC-1.1 JTWI version 1.0 Screen resolution 176&#215;176 Color screen Yes Bu ayarları netbeans da konfigürasyonlardan elle girmek çok kolay. Ardından jar dosyamızı atıp keyfimize bakıyoruz. Tweet]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Sony Ericsson k550i de Java konf<a href="http://www.cagdastopcu.com/wp-content/uploads/2009/12/javaconf.png"><img class="size-full wp-image-172 alignleft" title="java, toolkit, k550i, netbeans, konfigurasyon, MIDP" src="http://www.cagdastopcu.com/wp-content/uploads/2009/12/javaconf.png" alt="java, toolkit, k550i, netbeans, konfigurasyon, MIDP" width="220" height="398" /></a>igürasyonlarını girmemiz gerekiyor.</p>
<p>Profiles MIDP-2.0<br />
Configuration CLDC-1.1<br />
JTWI version 1.0<br />
Screen resolution 176&#215;176<br />
Color screen Yes</p>
<p>Bu ayarları netbeans da konfigürasyonlardan elle girmek çok kolay. Ardından jar dosyamızı atıp keyfimize bakıyoruz.</p>
<div class="shr-publisher-173"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/yeni-yili-java-me-midp-ile-kutlamak.html&via=cagdastopcucom&text=Yeni Yılı Java Me (MIDP) ile kutlamak&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/yeni-yili-java-me-midp-ile-kutlamak.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetBeans ile Mobil Geliştirme Araçlarının Kurulumu (SJWK, J2ME)</title>
		<link>http://www.cagdastopcu.com/netbeans-ile-mobil-gelistirme-araclarinin-kurulumu-sjwk-j2me.html</link>
		<comments>http://www.cagdastopcu.com/netbeans-ile-mobil-gelistirme-araclarinin-kurulumu-sjwk-j2me.html#comments</comments>
		<pubDate>Mon, 22 Jun 2009 12:00:15 +0000</pubDate>
		<dc:creator>cagdas</dc:creator>
				<category><![CDATA[GNU]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mobil]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[programlama]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[toolkit]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.cagdastopcu.com/netbeans-ile-mobil-gelistirme-araclarinin-kurulumu-sjwk-j2me.html</guid>
		<description><![CDATA[Kısa zaman önce yine Ubuntuma geçtim. Öyle mutluyum ki her şey oluyor. USB bluetoothu taktım telefonumla haberleştirdim ardından javaya başlamak için bir amaç aranıp duruyordum ve neden java mobile edition olmasın dedim (J2ME diyo avropalolar). Biraz bakınalım neler olmuş kurulum aşamasında. Netbeansı ilk defa kurmuştum bilgisayarıma soora kurcalarken plugins siye bişiler buldum. Ahaha java web &#8230; </p><p><a class="more-link block-button" href="http://www.cagdastopcu.com/netbeans-ile-mobil-gelistirme-araclarinin-kurulumu-sjwk-j2me.html">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><div class="wp-caption alignnone" style="width: 622px"><img title="netbeans java mobil" src="http://blogs.sun.com/geertjan/resource/mobile-game-designer2.png" alt="netbeans java mobil" width="612" height="408" /><p class="wp-caption-text">netbeans java mobil</p></div>
<p>Kısa zaman önce yine Ubuntuma geçtim. Öyle mutluyum ki her şey oluyor. USB bluetoothu taktım telefonumla haberleştirdim ardından javaya başlamak için bir amaç aranıp duruyordum ve neden java mobile edition olmasın dedim (J2ME diyo avropalolar). Biraz bakınalım neler olmuş kurulum aşamasında.</p>
<p>Netbeansı ilk defa kurmuştum bilgisayarıma soora kurcalarken plugins siye bişiler buldum. Ahaha java web de kurdum onu da kurdum bunu da kurdum derken bu kurduklarımı nasıl kullanacağıma bakmaya başladım. Netbeans&#8217; in mobility ile ilgili herbir şeyini kurdum. Ancak NetBeans&#8217; in sitesindeki örnek uygulamaları yapamıyordum. Mobile den  seçtiğim herhangi bir uygulamada J2ME bulunamadı istersen kuralım diyordu. Hayret bişi kurmuştum halbuki. Sonra nette biraz dolaşınca kimsenin pluginle yapmadığını gördüm. <strong>Sun Java Wireless Toolki</strong><strong>t</strong> kurup ardından bunu NetBeans a tanıtıyorlardı. Ben de öyle yaptım. Önce şurdan son versiyon SJWK yı indirdim.</p>
<p><a href="http://java.sun.com/products/sjwtoolkit/download.html?feed=JSC">http://java.sun.com/products/sjwtoolkit/download.html?feed=JSC</a></p>
<p>Ardından home/cagdas dizinine taşıyıp kuruluma başladım.</p>
<p>Bu kitle aşağıdaki modüller gelicektir ki bu da eski teknoloji telefonların programlanması için yeterlidir (CLDC ve MIDP cihazlar)</p>
<ul>
<li>Mobile Service Architecture (JSR 248)</li>
<li>Java Technology for the Wireless Industry (JTWI) (JSR 185)</li>
<li>Connected Limited Device Configuration (CLDC) 1.1 (JSR 139)</li>
<li>Mobile Information Device Profile (MIDP) 2.0 (JSR 118)</li>
<li>PDA Optional Packages for the J2ME Platform (JSR 75)</li>
<li>Java APIs for Bluetooth (JSR 82)</li>
<li>Mobile Media API (MMAPI) (JSR 135)</li>
<li>J2ME Web Services Specification (JSR 172)</li>
<li>Security and Trust Services API for J2ME (JSR 177)</li>
<li>Location API for J2ME (JSR 179)</li>
<li>SIP API for J2ME (JSR 180)</li>
<li>Mobile 3D Graphics API for J2ME (JSR 184)</li>
<li>Wireless Messaging API (WMA) 2.0 (JSR 205)</li>
<li>Content Handler API (JSR 211)</li>
<li>Scalable 2D Vector Graphics API for J2ME (JSR 226)</li>
<li>Payment API (JSR 229)</li>
<li>Advanced Multimedia Supplements (JSR 234)</li>
<li>Mobile Internationalization API (JSR 238)</li>
<li>Java Binding for the OpenGL(R) ES API (JSR 239)</li>
</ul>
<p>Ubuntuda (veya herhangi bir GNU/Linux dağıtımında) sh uzantılı binary dosyaların kurulumu oldukça kolay. Terminali açıp içine sh yazdıktan sonra fareyle kuracağım dosyayı taşıyorum. Böylece sh komutunun istediğim uzantıdaki istediğim dosyada çalışabilmesini sağlıyorum. Lisans anlaşması çıkıyor ve sonunda soruyor hangi java sdk ile kuralım. Daha önceden kurduğum java sdk nın dizinini bulmam gerekiyor. Başka bir şey için lazım olmuştu ve biliyorum. Eğer sizde paket yöneticisiyle kurmuşsanız sun java 6 sdk yı aynı dizinde olması muhtemeldir.</p>
<p>Enter a path to the Java 2 SDK: /usr/lib/jvm/java-6-sun/bin</p>
<p>İle dizini belirtiorum. Ardından bir kaç soru daha sorup kurmaya başlıyor. Kurulum yerini değiştirmedim /home/cagdas/ in içine kurdu. Kurulumdan sonra</p>
<p>cagdas@cagdas:~$ /home/cagdas/WTK2.5.2/bin/ktoolbar</p>
<p>dediğimde bir proje yöneticisi açıldı ve proje yapmaya hazır hale geldiğini görmüş oldum. İşte ordan kareler <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Sun Microsystems&#8217;ın logo sayfası çok güzel olmuş <img src='http://www.cagdastopcu.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="attachment_218" class="wp-caption aligncenter" style="width: 600px"><a href="http://www.cagdastopcu.com/wp-content/uploads/2009/06/midpresim2.png"><img class="size-full wp-image-218" title="wireless toolkit for cldc midp sun java resim 2.5.2" src="http://www.cagdastopcu.com/wp-content/uploads/2009/06/midpresim2.png" alt="sun java wireless toolkit for cldc" width="590" height="379" /></a><p class="wp-caption-text">sun java wireless toolkit for cldc</p></div>
<p>ve proje yöneticisi</p>
<div id="attachment_220" class="wp-caption aligncenter" style="width: 508px"><a href="http://www.cagdastopcu.com/wp-content/uploads/2009/06/midpresim31.png"><img class="size-full wp-image-220" title="Java Wireless Toolkit for CLDC Proje Yöneticisi" src="http://www.cagdastopcu.com/wp-content/uploads/2009/06/midpresim31.png" alt="Java Wireless Toolkit for CLDC Proje Yöneticisi" width="498" height="191" /></a><p class="wp-caption-text">Java Wireless Toolkit for CLDC Proje Yöneticisi</p></div>
<p>Ardından NetBeans a geçtim. Yine mobil uygulaması başlatmaya çalıştım ardından sordu yine hangi sdk olsun. Java SE nin dışında bir SDK kuracaktım ve bu yüzden add dedim. Az önce ktoolbarı çalıştırırken kullandığım dizini kullandım /home/cagdas/WTK2.5.2/ ile J2ME SDK yı belirtmiş oldum ve projem açıldı. Umarım işinize yarar. Kolay gelsin.</p>
<div class="shr-publisher-82"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom --><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.cagdastopcu.com/netbeans-ile-mobil-gelistirme-araclarinin-kurulumu-sjwk-j2me.html&via=cagdastopcucom&text=NetBeans ile Mobil Geliştirme Araçlarının Kurulumu (SJWK, J2ME)&related=cagdastopcu.com:official twitter of cagdastopcu.com&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.cagdastopcu.com/netbeans-ile-mobil-gelistirme-araclarinin-kurulumu-sjwk-j2me.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.958 seconds -->

