Presentation is loading. Please wait.

Presentation is loading. Please wait.

Generic Connection Framework Harald Falzberger und Simon Tretter J2ME:

Similar presentations


Presentation on theme: "Generic Connection Framework Harald Falzberger und Simon Tretter J2ME:"— Presentation transcript:

1 Generic Connection Framework Harald Falzberger und Simon Tretter J2ME:

2 06.02.08Generic Connection Framework2 Übersicht Allgemeines Interface Connection Class Connector Low Level Connections HttpConnection Beispiel Zusammenfassung

3 06.02.08Generic Connection Framework3 Allgemeines Package javax.microedition.io Nicht nur für Internetverbindungen Files Sockets ….. Erweiterungen wie FCOP

4 06.02.08Generic Connection Framework4 javax.microedition.io.Connection

5 06.02.08Generic Connection Framework5 javax.microedition.io.Connector Factory Class Connector.open(String url [,int mode, boolean timeout]) Url http://www.szene1.at/u/siml?delete=true socket:///12.143.12.15:1234 Modes Connector.[READ|WRITE|READ_WRITE]

6 06.02.08Generic Connection Framework6 Low Level Connections SocketConnection Connector.open(socket://foobar:1203) void setSocketOption(byte op, int val) SecureConnection extends SocketConnection Connector.open(ssl://foobar:1203) SecurityInfo getSecurityInfo() CommConnection Connector.open(comm:com0;baudrate=19200)

7 06.02.08Generic Connection Framework7 Low Level Connections DatagrammConnection NICHT von StreamConnection abgeleitet Server Connection.open(datagramm://:1234) Client Connection.open(datagramm://ip:12) dconObj.send( dConObj.newDatagramm(bytes[] buf)) dconObj.receive( dConObj.newDatagramm(bytes[] buf))

8 06.02.08Generic Connection Framework8 javax.microedition.io.HttpConnection Nützliche Methoden Request void setRequestMethod(String method) void setRequestProperty(String key, String value)....... Response int getResponseCode() InputStream openInputStream() String getHeaderField(String name) ……

9 06.02.08Generic Connection Framework9 Zusammenfasung Instanzieren einer Connection Versenden/Empfangen von Daten

10 06.02.08Generic Connection Framework10 Quelle = API http://java.sun.com/javame/reference/apis/jsr118


Download ppt "Generic Connection Framework Harald Falzberger und Simon Tretter J2ME:"

Similar presentations


Ads by Google