PDA

Tam Sürümünü Görmek İçin : cep telefonlarina oyun nasil yazilir...


sali
08/07/2004, 17:34
java destekli cep telefonlarina nasil program oyun yaziliyor... yazilan program nasil yükleniyor telefona... bu konuda bilgisi olan arkadaslarimiz varsa beni bilgilendirebilir mi... ve de sanirsam bunun icin "javax.microedition" paketi lazim... bunu nerden nasil bulabiliriz... tesekkürler...


JJ
08/07/2004, 18:06
burdan (http://java.sun.com/products/j2mewtoolkit/download-2_1.html) J2ME Wireless Toolkit'i indirerek baslayabilirsin.

JJ
08/07/2004, 18:07
daha sonra da http://forum.nokia.com adresine gidebilirsin, orada guzel dokumanlar var.

Getting Started (http://www.forum.nokia.com/html_reader/main/1,,3639,00.html)
What’s in MIDP 2.0: A Guide for Java™ Developers (http://nds1.forum.nokia.com/nnds/ForumDownloadServlet?id=3632&name=WhatsinMIDP2%5F0%5Fv1%5F0%2Epdf)

sali
08/07/2004, 19:29
verdiginiz adresten J2MM Wireless Toolkit i indirdim... kurdum... elimde bi kod var... onu nasil derleyip calistiracagim simdi... normal compile ediyorum... javax.microedition u göremiyor... yani yok diyor böyle bi sey... ???

JJ
08/07/2004, 20:05
J2ME Wireless Toolkit'in KToolbar diye bir uygulamasi var. Onunla yeni bir proje yaratip C:/WTK21/apps/[PROJE ADI]/src klasorune kaynak kodlari koyup onunla derlemeyi deneyin bir de.

sali
08/07/2004, 23:23
verdiginiz bilgiler icin cok tesekkür ederim...
ama dogru dürüst bi programi calistirip da göremedim nasil oluyor... hep hata veriyor... kendi demo kodlari var... onlar calisiyor... ama benim kendi derlemek istediklerim hep hata veriyor... bana calisan kücük bi program gönderebilir misiniz...

sali
08/07/2004, 23:43
ve de ayri bi konu... bu yapilan programlari nasil yüklüyoruz telefona...

JJ
09/07/2004, 00:23
What’s in MIDP 2.0: A Guide for Java™ Developers (http://nds1.forum.nokia.com/nnds/ForumDownloadServlet?id=3632&name=WhatsinMIDP2%5F0%5Fv1%5F0%2Epdf)'dan bir alinti:

3.3 Deploying Your MIDlet
3.3.1 Compiling
MIDlets are compiled using the standard Java SDK. Of course, there are many tools available to aid
developers. Developers can use their favorite IDE, or work with the KToolBar application, which comes
with the J2ME Wireless Toolkit. Nokia Developer’s Suite for J2ME™, Version 2.0, doesn’t include a
compiler, but provides a lot of useful tools for creating new classes and MIDlet suites, deploying
MIDlets to devices, and so on.

3.3.2 Preverifying
As discussed in Section 2.3.2, “Class loader,” the class loader for MIDP devices is very limited. Therefore,
it is necessary to preverify the .class files before they are packaged. This ensures the classes are
compatible with the J2ME virtual machine. The tools included with the J2ME Wireless Toolkit or the
Nokia Developer’s Suite will handle the preverify step.

3.3.3 Emulating
The J2ME Wireless Toolkit and the Nokia Developer’s Suite also include emulators for a variety of
devices. Developers can test and debug MIDlets on the emulators until they are satisfied with their
MIDlets’ basic operation. Emulators also give the developer the ability to see how the user interface
will operate in different devices.
Nokia provides two types of emulators: ones supplied with “concept” SDKs, and ones supplied with
SDKs using real phone software. The latter more closely emulate the target devices. However, it must
be remembered that there is no substitute for testing on real target devices, because PCs are different
from mobile phones, both in technical capability and in UI (mouse and keyboard vs. phone keypad).

3.3.4 Packaging
In order to deploy a MIDlet to a real device, it must be packaged into a suite. A suite is a compilation of
one or more MIDlets into a collection of related classes and resources such as graphics, sound files, and
RMS data. The package helps to save space on the device.
The Nokia Developer’s Suite and the J2ME Wireless Toolkit both provide the functionality to create this
package. The Nokia Developer’s Suite provides the capability to deploy the suite to a Nokia phone.

3.3.5 Over-the-Air provisioning
During the course of development, MIDlet suites can be deployed in a variety of ways; however,
commercially it is usually best to deploy applications Over the Air (OTA). With MIDP 2.0, compliant
devices are now required to implement and support OTA deployment. In MIDP 2.0-compliant devices it
is possible to use MIDlet-Install-Notify and MIDlet-Delete-Notify attributes to return a
code to the deployment server whenever a MIDP 2.0 MIDlet is installed or deleted. This allows
developers and publishers to more easily track usage of MIDlets.
For information on configuring a server to deploy MIDlets over the air to Nokia devices, see the
document Settings for OTA Download of MIDlets at the Forum Nokia Web site (it can be found on the
Game Programmers page, accessible through http://www.forum.nokia.com/games ).

sali
09/07/2004, 00:35
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
import java.util.*;

public class PointerTestMidlet extends MIDlet{
public void startApp(){
TestCanvas canvas=new TestCanvas(this);
Display.getDisplay(this).setCurrent(canvas);
}
public void pauseApp(){}
public void destroyApp(boolean b){}
public void exit(){
destroyApp(false);
notifyDestroyed();
}
class TestCanvas extends Canvas implements CommandListener{
private PointerTestMidlet middlet;
private Command exitCommand=new Command("Exit",Command.EXIT,1);
String s="";
public TestCanvas(PointerTestMidlet middlet){
this.middlet=middlet;
addCommand(exitCommand);
setCommandListener(this);
}
public void commandAction(Command c, Displayable d){
if(c==exitCommand){
middlet.exit();
}
}
public void paint(Graphics g){
System.out.print("Paint");
clear(g);
g.drawString(s,30,30,Graphics.BASELINE|Graphics.HC ENTER);
}
public void pointerPressed(int x,int y){
System.out.println(" Pressed X: "+x+" Y: "+y);
s=" Pressed X: "+x+" Y: "+y;
repaint();
}
public void pointerReleased(int x,int y){
System.out.println(" Released X: "+x+" Y: "+y);
s=" Pressed X: "+x+" Y: "+y;
repaint();
}
public void pointerDragged(int x,int y){
System.out.println(" Dragged X: "+x+" Y: "+y);
s=" Pressed X: "+x+" Y: "+y;
repaint();
}
private void clear(Graphics g){
System.out.print("C Aloo");
g.setColor(255,255,255);
g.fillRect(0,0,getWidth(),getHeight());
g.setColor(0,0,0);
}
}
}


programi buraya yazdim.... derleyemiyorum bunu... hata veriyor...
veridigi hata :

C:\WTK21\apps\sali\src\PointerTestMidlet.java:38: cannot access java.lang.StringBuilder
file java\lang\StringBuilder.class not found
System.out.println(" Pressed X: "+x+" Y: "+y);
^
Fatal Error: Unable to find method <init>
com.sun.kvem.ktools.ExecutionException
Build failed

JJ
09/07/2004, 00:43
Yazdiginiz programi KToolbar ile derledim ve calistirdim, bir hata vermedi. Sisteminizde J2SE kurulu mu?

sali
09/07/2004, 01:38
evet kurulu

d_baggio
09/07/2004, 01:51
bildigim kadari ile cogu cep telefonu icin farkli kodlar yaziliyor;(en azindan farkli sekilde compile ediliyor) ornegin nokia benzeri 6610 ve turevleri icin *.jad,*.jar olarak, 6600 icin class olarak derleniyor.sizin hangi tur platformda kullanmak icin ugrastiginizi ogrenebilirmiyiz?

sali
09/07/2004, 01:57
ben *.jad *.jar olusturmak istiyorum...

sali
09/07/2004, 01:59
tool kit icin acaba ayar filan gerekiyor mu?
acaba ben ktoolbar i mi yanlis kullaniyorum...

d_baggio
09/07/2004, 02:04
*.jad *.jar derlemek kolay. class kodlarin dogru oldugunu varsayarsak bunun icin dj java decomplier sorununu cozebilir.bakiniz. http://members.fortunecity.com/neshkov/dj.html

JJ
09/07/2004, 02:05
ben toolkit'e ayar yaptigimi hatirlamiyorum.

sali
09/07/2004, 02:10
ben simdi ktoolbarda nasil ilerledigimi söyleyim... belki vardir bi hatam...

new projekt deyip herhangi bir proje ismi giriyor ve de calistiracagim .java dosyasini ismini MIDlet Class Name karisina yaziyorum.... bunu ok leyip ardindan gelen sayfada hic degisiklik yapmadan okliyorum... sonra .java dosyasini [projeismi]/src adizini altina koyup derliyorum... ve hata veriyor... acaba benim hic degisiklik yapmadan okledigim sayfada mi bi degisiklik yapcaz?

d_baggio
09/07/2004, 02:11
toollkit i bende gorebilirmiyim acep

sali
09/07/2004, 02:12
http://java.sun.com/products/j2mewtoolkit/download-2_1.html

burdan indirebilirsiniz

redial
09/07/2004, 09:21
derlemeye calistiginiz kodu, ve derlerken aldiginiz hata mesajlarini buraya eklerseniz daha hizli hardim alabilirsiniz.

sali
09/07/2004, 10:27
derlemeyi calistigim kodu ve verdigi hatayi 1. sayfada bulabilirsiniz...

sali
09/07/2004, 11:52
bi önceki örnegi bosverelim.... yeni basit bi örnek yaziyorum...

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloWorld extends MIDlet{
protected void startApp(){
TextBox box=new TextBox("hello","Hello MIDlet",100,TextField.ANY);
Display.getDisplay(this).setCurrent(box);
}
protected void pauseApp(){}
protected void destroyApp(boolean boolean0){}
}


bunu compiler ediyorum... hata vermiyor... ama bu sefer run deyince hic bisey yapmadan görüntü gidiyor.... kToolbarda da su yazilar cikiyor....

Running with storage root DefaultColorPhone
Method............: 100d2aa8 'com/sun/midp/midlet/MIDletState.createMIDlet (static)'
Stack Chunk.......: e57b50
Frame Pointer.....: e57bac
Current IP........: 10128592 = 10128584 + offset 14
Previous Frame....: e57b70
Previous IP.......: 1012052b (offset 22)
Frame size........: 8 (1 arguments, 7 local variables)
Argument[0].......: e59620
Local[1]..........: 0
Local[2]..........: e57b70
Local[3]..........: e68804
Local[4]..........: e57b84
Local[5]..........: 100dcdd0
Local[6]..........: e57b50
Local[7]..........: 1015f0a0
Operand[1]........: e59620

Method............: 100cd0e4 'com/sun/midp/midlet/Selector.run (virtual)'
Stack Chunk.......: e57b50
Frame Pointer.....: e57b70
Current IP........: 1012052b = 10120515 + offset 22
Previous Frame....: 0
Previous IP.......: 1
Frame size........: 6 (1 arguments, 5 local variables)
Argument[0].......: e59864
Local[1]..........: e68a14
Local[2]..........: e59620
Local[3]..........: 0
Local[4]..........: 0
Local[5]..........: 0
Operand[1]........: e68a14

VM status:
Instruction pointer.: 10128592 (offset within invoking method: 14)
Next instruction....: 0x4c
Frame pointer.......: e57bac
Local pointer.......: e57b8c
Stack size..........: 128; sp: e57bc4; ranges: e57b58-e57d58;
Contents of the current stack frame:
e57b8c: e59620 (lp)
e57b90: 0
e57b94: e57b70
e57b98: e68804
e57b9c: e57b84
e57ba0: 100dcdd0
e57ba4: e57b50
e57ba8: 1015f0a0
e57bac: e57b70 (fp)
e57bb0: 1012052b
e57bb4: e57b88
ALERT: java/lang/ClassFormatError: Bad version information.

e57bb8: 100d2aa8
e57bbc: e57b50
e57bc0: 0 (end of frame)
e57bc4: e59620 (sp)
Execution stack contains 112 items:
e59864
e68a14
e59620
0
0
0
0
1
e57b54
100cd0e4
e57b50
0
e68a14
e59620
0
e57b70
e68804
e57b84
100dcdd0
e57b50
1015f0a0
e57b70
1012052b
e57b88
100d2aa8
e57b50
0
e59620

Execution completed.
440543 bytecodes executed
8 thread switches
486 classes in the system (including system classes)
2479 dynamic objects allocated (73500 bytes)
1 garbage collections (0 bytes collected)
Execution completed.
440543 bytecodes executed
8 thread switches
486 classes in the system (including system classes)
2479 dynamic objects allocated (73500 bytes)
1 garbage collections (0 bytes collected)
Running with storage root DefaultColorPhone
Method............: 100d2aa8 'com/sun/midp/midlet/MIDletState.createMIDlet (static)'
Stack Chunk.......: e57b50
Frame Pointer.....: e57bac
Current IP........: 10128592 = 10128584 + offset 14
Previous Frame....: e57b70
Previous IP.......: 1012052b (offset 22)
Frame size........: 8 (1 arguments, 7 local variables)
Argument[0].......: e59620
Local[1]..........: 0
Local[2]..........: e57b70
Local[3]..........: e68804
Local[4]..........: e57b84
Local[5]..........: 100dcdd0
Local[6]..........: e57b50
Local[7]..........: 1015f0a0
Operand[1]........: e59620

Method............: 100cd0e4 'com/sun/midp/midlet/Selector.run (virtual)'
Stack Chunk.......: e57b50
Frame Pointer.....: e57b70
Current IP........: 1012052b = 10120515 + offset 22
Previous Frame....: 0
Previous IP.......: 1
Frame size........: 6 (1 arguments, 5 local variables)
Argument[0].......: e59864
Local[1]..........: e68a14
Local[2]..........: e59620
Local[3]..........: 0
Local[4]..........: 0
Local[5]..........: 0
Operand[1]........: e68a14

VM status:
Instruction pointer.: 10128592 (offset within invoking method: 14)
Next instruction....: 0x4c
Frame pointer.......: e57bac
Local pointer.......: e57b8c
Stack size..........: 128; sp: e57bc4; ranges: e57b58-e57d58;
Contents of the current stack frame:
e57b8c: e59620 (lp)
e57b90: 0
e57b94: e57b70
e57b98: e68804
e57b9c: e57b84
e57ba0: 100dcdd0
e57ba4: e57b50
e57ba8: 1015f0a0
e57bac: e57b70 (fp)
e57bb0: 1012052b
e57bb4: e57b88
ALERT: java/lang/ClassFormatError: Bad version information.

e57bb8: 100d2aa8
e57bbc: e57b50
e57bc0: 0 (end of frame)
e57bc4: e59620 (sp)
Execution stack contains 112 items:
e59864
e68a14
e59620
0
0
0
0
1
e57b54
100cd0e4
e57b50
0
e68a14
e59620
0
e57b70
e68804
e57b84
100dcdd0
e57b50
1015f0a0
e57b70
1012052b
e57b88
100d2aa8
e57b50
0
e59620

Execution completed.
440543 bytecodes executed
8 thread switches
486 classes in the system (including system classes)
2479 dynamic objects allocated (73500 bytes)
1 garbage collections (0 bytes collected)
Execution completed.
440543 bytecodes executed
8 thread switches
486 classes in the system (including system classes)
2479 dynamic objects allocated (73500 bytes)
1 garbage collections (0 bytes collected)


nedir ki bunlar?

sali
09/07/2004, 12:11
ayrica [projeismi]/bin dizini altinda da .jar dosyasi olusturmuyor... sadece .jad ve MANIFEST.mf var....

muharrem_tac
09/07/2004, 12:48
Buraya kadar olanları tamamen unutun . Ben şimdi bir link vereceğim . Bu programı indirin ve kurun . Bu yazılım ücretsizdir ve işinize ne kadar yarıyacağına kendiniz bile şaşıracaksınız .

Yazılım :

http://www.netbeans.org

IDE 'nin benim makinedeki ekran görüntüleri :

http://muharremtac.com/netbeans.gif

Daha sonra bu IDE 'nin güncelleştirilmesi gerekiyor . Güncelleştirme sihirbazı ekran görüntüsü:

http://muharremtac.com/netbeansUpdateCenter.gif

Güncelleştirdikten sonra şöyle bir görüntü ortaya çıkacak :

http://muharremtac.com/netbeansMidlet.gif

Ve derlediğiniz kod şöyle çalışacak

http://muharremtac.com/netbeansMidletDeneme.gif

sali
09/07/2004, 16:41
JJ ve muharrem_tac a cok tesekkür ederim...
netbeansi kurdum ve dedikleriizi yaptim.... calistirdim programi... bi sorum olcakti... netbeans ile .class dosyasi degil de, .jad ve .jar dosyasi olusturup programi öyle kullanabilir miyim???

netbeans le calistirdigimda .class dosyasi üretmis de...

muharrem_tac
09/07/2004, 16:48
jad dosyası oluşturmak için de gerekli bilgiler yardım dosyasında mevcut . Yeni bir proje açarak burada jar kısmını bulmanız gerekiyor.

sali
09/07/2004, 16:57
evet sagolun... buldum onu da...
netbeansden execute deyince calisiyor program... ama ben gittim .jad dosyasini cift tikladim calisacak mi diye... olmadi... .jar dosyasinin ici bos... 0 kb... ayrica verdigi hata..

com.sun.kvem.midletsuite.InvalidJadException: Reason = 36
Error in opening jar file: C:\Dokumente und Einstellungen\sali\.netbeans\3.6\sampledir\hadiii. jar

sali
09/07/2004, 18:38
yoksa .jad dosyasi calistirilamiyor mu?
ya da ben yanlis biseyler mi yapiyorum...

muharrem_tac
09/07/2004, 19:24
Şunu ben de bir deneyeyim , birşeyler yazarım .

muharrem_tac
01/08/2004, 08:44
Evet denedim ve basit bir örnek yaptım :

http://www.btturk.net/page.php?id=157
http://muharremtac.com/midletsuite/