J2ME Melih Sakarya Java Teknolojileri Derneği. JVM JAVA Kullanılan yerler  Windows-Linux-Unix-Solaris  PDA lar  Smart Cardlar  Cep Telefonları  Appletler.

Slides:



Advertisements
Similar presentations
Java + OpenGL = JOGL Java and OpenGL Rich Truban Andrew Potozniak.
Advertisements

Bruce Scharlau, University of Aberdeen, 2010 Java ME Record Management System Mobile Computing.
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
05/07/2008kbele/cs5251 Study of Tools & Utilities in Mobile Application By Kunal Bele.
Introduction to Mobile Computing
J2ME Form Nesneleri Melih Sakarya. Form Nesnesi Form form= new Form("Giris"); display.setCurrent(form);
Martin Løbger – IT Konsulent
Java ME persistence made easy! by Thiago Rossato Thiago Moreira.
Sony Ericsson1 Tapuchin The Project Capuchin Energizing User Experience.
Java 2D Training. Basic Tools Java SDK 1.4x Wireless Toolkit 2.x NetBeans IDE + mobility pack Global Code editor Text Comparer Tools Graphics Editor Sprite.
Cookie in a servlet. Cookies are small bits of textual information that a Web server sends to a browser and that the browser returns unchanged when visiting.
BA1 MIDP GUI BA2 Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas.
MIDP GUI Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas JEM1/jrt.
PEMOGRAMAN APLIKASI BERGERAK (Java ME) Nyimas Artina Getting Started.
1 Mobile Software Development Framework: TinyOS, J2ME 10/2/2012 Y. Richard Yang.
Department of Computer Science & Engineering
J2ME Screen Hierarchy Displayable ScreenCanvas FormAlertListTextbox.
J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan
Presentation 11: SOAP on small devices. Ingeniørhøjskolen i Århus Slide 2 af 14 Outline Which small devices? What are the limitations and what kind of.
Pengantar Teknologi Mobile 12
Multimedia Network Communications Subject:T0934 / Multimedia Programming Foundation Session:13 Tahun:2009 Versi:1/0.
J2ME 25 July Overview  What is J2ME?  The CLDC and CDC configurations  MIDP and MIDlets  Development Tools  Demonstrations.
Writing Your First MIDlet Running JAVA on a Cell Phone Jon A. Batcheller January 27, 2004.
Introduction to Java 2 Micro Edition Mark Balbes, Ph.D. Senior Software Engineer Jeff Brown Senior Software Engineer.
Quality Assurance and Testing of J2ME Programs for Mobiles Phones.
Developing an Application with J2ME Technology Scott Palmer, Nat Panchee, Judy Sullivan, Karen Thabet, Sten Westgard.
J2ME for Palm Speaker: Chen-Nien Tsai Adviser: Kai-Wei Ke.
Developing Software for Wireless Devices
PDA Programming Using J2ME Presenter :涂俊凱 Date : 2003/4/8.
Making Cell Phone Games An Overview Ray Ratelis Guild Software, Inc.
Developing J2ME Applications Mobile and Wireless Networks.
The 21th century Repairman Agenda Introduction J2EE J2ME Demonstration.
Cosc 4730 Phone Programming in Java An Introduction.
Java 2 Micro Edition Mano Chen Senior Technical Consultant
Java Platform, Micro Edition (J2ME)
Java 2 Platform, Micro Edition (J2ME) By Xiaorong Wang.
Detecting Changes  ItemStateListener interface – detect changes in internal state of an Item  new selection made in a ChoiceGroup  adjusted value of.
J2ME and WAP Technologies CSCI – Independent Study Fall 2002 Presented by: Kashif Syed.
J2ME Java for Mobile Environments Based on J2ME In A Nutshell, by Kim Topley, O’Reilly & Associates Inc., 2002, and Tetris by Alexei Patinov.
An Introduction to the Java ME Project Jens A Andersson.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 Using the KToolbar Rob Pooley
Platforms and tools for Web Services and Mobile Applications J2ME based Applications Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 11 J2ME and MIDlets Rob Pooley
Using J2ME to create Field Force Applications Chris Clark, MobileHWY, LLC.
Mobile Applications and Java ME
Framework and application bytecode size CLDC MIDP kXML parser Utility classes Graphics Logic (MIDlet) Application Data (XML file)
Computer Science Wi-Fi App using J2ME and MVC Architecture Advisor : Dr. Chung-E Wang Department of Computer Science Sacramento State University Date:
J2ME Presented by May Sayed & Menna Hawash. Outline Introduction “Java Technology” Introduction “What is J2ME?” J2ME Architecture J2ME Core Concepts 
1Basics of J2ME. 2 Objectives –Understand the different java API’s and how the mobile edition API’s fit in –Understand what a mobile configuration and.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 14 Various MIDlet examples Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 8 CDC andJ2ME Rob Pooley
Java 2 Platform, Micro Edition (J2ME)
1 Introduction to J2ME Outline MIDP Building J2ME Apps- Tool J2ME Wireless Toolkit Demo MIDlet Programming -- MIDlet Transition States -- Midlet Skeleton.
Mobile Programming Mobile Programming - Ordibehesht Ordibehesht 1390.
Enhanced mobile services in Java enabled phones Björn Hjelt Sonera zed ltd Supervisor: Professor Jorma Jormakka.
CSE403: MIDlets and Ant1 MIDlets and Ant April 3, 2003 Shane Cantrell Zach Crisman.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Visual Mobile Applications with Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
Visual Mobile Gaming Your Name Sun Campus Ambassador Your Address.
1 Mobile Application Development Framework 4/16/2009 Richard Yang.
The Java Platform Micro Edition Java ME
Java N Amanquah.
UNIT II J2ME Best Practices and Patterns
MOBILE DEVICE OPERATING SYSTEM
Wireless Instant Messaging Using J2ME
J2ME User Interface I.
Java for Mobile Devices
Presentation transcript:

J2ME Melih Sakarya Java Teknolojileri Derneği

JVM JAVA Kullanılan yerler  Windows-Linux-Unix-Solaris  PDA lar  Smart Cardlar  Cep Telefonları  Appletler  Local Applicationlar  LEGO  Java Tv

KONFİGÜRASYON VE PROFİLLER  CLDC (Connected Limited Device Configuration)  CDC (Connected Device Configuration)

CLCD Konfigirasyonu KVM 512 KB tan ufak hafızası ve sınırlı ağ bağlantısı olan cihazlar için tasarlanmıştır  java.io  java.lang  java.lang.ref  java.util  javax.microedition.io

CDC Konfigürasyonu CVM (Compact Virtual Machine) CLDC den daha fazla hafıza ve işlemci gücüne sahip cihazlarda kullanılır  java.io  java.lang  java.lang.ref  java.lang.reflect  java.math  java.net  java.security  java.security.cert  java.text  java.util  java.util.jar  java.util.zip  javax.microedition.io

(MIDP) Mobile Information Device Profile  MIDP 1.0  MIDP 2.0

MIDP 1.0  java.io  java.lang  java.util  javax.microedition.io  javax.microedition.lcdui  javax.microedition.midlet  javax.microedition.rms

MIDP 2.0  java.io  java.lang  java.util  javax.microedition.io  javax.microedition.lcdui.game  javax.microedition.media  javax.microedition.media.control  javax.microedition.midlet  javax.microedition.pki  javax.microedition.rms

J2ME ve IDE ler udio4u1/buy/ udio4u1/buy/

J2WTK Kurulumu

Midlet Yapısı public void startApp(){ } protected void pauseApp(){ } protected void destroyApp(boolean boolean0){ }

Örnek Midlet import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class OrnekMidlet extends MIDlet{ protected void startApp(){} protected void pauseApp(){} protected void destroyApp(boolean boolean0){} }

Örnek Midlet import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class MerhabaDunya extends MIDlet{ protected void startApp(){ TextBox box=new TextBox("Merhaba","MerhabaDünya",100,TextField.ANY); Display.getDisplay(this).setCurrent(box); } protected void pauseApp(){} protected void destroyApp(boolean boolean0){} }

LCDUI Limited Connected User Interface Display.getDisplay(this)

Display.getDisplay(this).setCurrent(nesne)

TextBox box=new TextBox("hello","Hello MIDlet",100,TextField.ANY); Display.getDisplay(this).setCurrent(box);

Form Nesneleri Form form= new Form("Giris"); TextField user= new TextField("Username:","",20,TextField.ANY); TextField pass= new TextField("Password:","",20,TextField.PASSWORD); ChoiceGroup cinsiyet=new ChoiceGroup("Cinsiyet", ChoiceGroup.EXCLUSIVE); cinsiyet.append("Bay",null);cinsiyet.append("Bayan",null); DateField tarih=new DateField("Dogum Tarihi",DateField.DATE); form.append(tarih);form.append(cinsiyet);form.append(user);form.append(pass);display.setCurrent(form);

Command import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class formUygulamasi extends MIDlet implements CommandListener{ Form form; Form form; Command cikis; Command cikis; Command kaydet; Command kaydet; public void startApp() { public void startApp() { form= new Form("Kayit Formu"); form= new Form("Kayit Formu"); TextField ad= new TextField("Adiniz:","",20,TextField.ANY); TextField ad= new TextField("Adiniz:","",20,TextField.ANY); cikis= new Command ("Cikis",Command.EXIT,2); cikis= new Command ("Cikis",Command.EXIT,2); kaydet= new Command("Kaydet",Command.OK,1); kaydet= new Command("Kaydet",Command.OK,1); form.addCommand(cikis); form.addCommand(cikis); form.addCommand(kaydet); form.addCommand(kaydet); form.append(ad); form.append(ad); Display.getDisplay(this).setCurrent(form); Display.getDisplay(this).setCurrent(form); } public void pauseApp() { public void pauseApp() { } public void destroyApp(boolean unconditional) { public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable s) { public void commandAction(Command c, Displayable s) { if (c == kaydet) { if (c == kaydet) { //islemler //islemler } }}

Alert Alert uyari = new Alert("Uyari", "Bos Alan Birakmayiniz", null, null); uyari.setTimeout(Alert.FOREVER);Display.getDisplay(this).setCurrent(uyari);

RMS (Record Management System) //Yaziyoruz //Yaziyoruz RecordStore rs=RecordStore.openRecordStore("telefon", true); RecordStore rs=RecordStore.openRecordStore("telefon", true); String[] liste={"Melih","Altug","Murat","Burak","Ozan","Mustafa"}; String[] liste={"Melih","Altug","Murat","Burak","Ozan","Mustafa"}; byte[] record; byte[] record; for (int i=0;i<liste.length;i++){ for (int i=0;i<liste.length;i++){ record=liste[i].getBytes(); record=liste[i].getBytes(); rs.addRecord(record,0, record.length); rs.addRecord(record,0, record.length); }

RMS (Record Management System) //okuyoruz byte[] recData= new byte[100]; byte[] recData= new byte[100]; int dataLen; int dataLen; for(int i=1;i<rs.getNumRecords();i++){ for(int i=1;i<rs.getNumRecords();i++){ rs.getRecord(i,recData,0); rs.getRecord(i,recData,0); dataLen = rs.getRecord(i,recData,0); dataLen = rs.getRecord(i,recData,0); String str=new String(recData,0,dataLen); String str=new String(recData,0,dataLen); try{ try{ System.out.println("icerik "+i+":"+str); System.out.println("icerik "+i+":"+str); } catch(Exception e){ catch(Exception e){ System.out.println(e.toString()); System.out.println(e.toString()); }

RMS (Record Management System) //kapatiyoruz //kapatiyoruz rs.closeRecordStore(); rs.closeRecordStore();

RMS (Record Management System) try{ RecordStore.deleteRecordStore("telefon"); RecordStore.deleteRecordStore("telefon"); } catch(Exception e){ catch(Exception e){ }

Sunucuya Baglanma  Socket Baglantısı  Http Baglantisi  InputConnection  OutputConnection  DatagramConnection  StreamConnection  HttpConnection

HttpConnection HttpConnection baglanti= (HttpConnection)Connector.open(" InputStream is=baglanti.openInputStream(); InputStream is=baglanti.openInputStream(); int ch; int ch; StringBuffer haber= new StringBuffer(); StringBuffer haber= new StringBuffer(); while((ch=is.read())!=-1){ while((ch=is.read())!=-1){ haber.append( (char)ch ); haber.append( (char)ch ); } is.close(); is.close(); baglanti.close(); baglanti.close();

Canvas import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class CanvasTest extends MIDlet{ public void startApp(){ public void startApp(){ TestCanvas canvas=new TestCanvas(); TestCanvas canvas=new TestCanvas(); Display.getDisplay(this).setCurrent(canvas); Display.getDisplay(this).setCurrent(canvas); } public void pauseApp(){} public void pauseApp(){} public void destroyApp(boolean unconditional){} public void destroyApp(boolean unconditional){} public class TestCanvas extends Canvas{ public class TestCanvas extends Canvas{ public void paint(Graphics g){ public void paint(Graphics g){ g.setColor(255,255,255); g.setColor(255,255,255); g.fillRect(0,0,getWidth(),getHeight()); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(0,0,0); g.setColor(0,0,0); g.drawRect(10,10,50,50); g.drawRect(10,10,50,50); } }}

Media Api InputStream is =getClass().getResourceAsStram(“/audio.wav”); Player player= Manager.createPlayer(is, “audio/X-wav”); player.start();

Game Api javax.microedition.lcdui.game  GameCanvas : Canvas class'ından extend olan bir oyun canvası.  Layer: Bir orjini birde genişlik ve yüksekliği olan dikdörtgensel bir bölge tanımlamak için kullanılan bir class.  LayerManager: Birden fazla Layer nesnelerini yönetmek için kullanılan bir class  Sprite: Bir image'ı olan oyun nesneleri için kullanılan class. Animasyon, Döndürme gibi özellikleri bulunmakta.  TiledLayer: Birden fazla hücresi olan bir layer nesnesi. Bu hücrelere image koyulabiliyor. Bu şeklilde aynı image'lardan bir çok TiledLayer nesnesi yaratılabiliyor.

Game Api if((getKeyStates()&LEFT_PRESSED)!=0){x--;} else if((getKeyStates()&RIGHT_PRESSED)!=0) {x++; }else if((getKeyStates()&UP_PRESSED)!=0){ y--; }else if((getKeyStates()&DOWN_PRESSED)!=0){ y++;} Graphics g=getGraphics(); clear(g);g.drawImage(image,x,y,Graphics.LEFT|Graphics.TOP);flushGraphics();

JAD Dosyası MIDlet-1: HelloMIDlet,, hello.HelloMIDlet MIDlet-2: Seminer,, hello.Seminer MIDlet-Jar-Size: 4484 MIDlet-Jar-URL: Melih.jar MIDlet-Name: Melih MIDlet-Vendor: Vendor MIDlet-Version: 1.0 MicroEdition-Configuration: CLDC-1.0 MicroEdition-Profile: MIDP-1.0

Örnek Wap Sayfası <wml> Midlet Download Et </a></card></wml>

Mimetype Tanımları.jar application/java-archive.jad text/vnd.sun.j2me.app-descriptor

SORULAR ???