SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Java ME
    Networking & Connectivity

                                         Stefano Sanna
                      gerdavax@tiscali.it - http://www.gerdavax.it




Supported by:

 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Speaker
• Stefano Sanna is...

   – Mobile Application Architect @ Beeweeb




   – Technical writer @ DEV, JavaJournal, CP, FSM...
   – Supporter JMDF, JIA, JUG Sardegna, GULCh...
   – LEGO constructor (since 1973...)


 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Agenda
• Generic Connection Framework
   – Networking
      • Basic: HTTP/HTTPS
      • Low-level: socket, serversocket, datagrams
      • Messaging
      • Web Services
      • Multimedia
   – Local connectivity:
      • Bluetooth
      • IrDA & Serial ports
      • Near Field Communication
• Conclusions
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Agenda
• Generic Connection Framework
   – Networking
      • Basic: HTTP/HTTPS
      • Low-level: socket, serversocket, datagrams
      • Messaging
      • Web Services
      • Multimedia
   – Local connectivity
      • Bluetooth
      • IrDA & Serial ports
      • Near Field Communication
• Conclusions
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Java ME: made for connectivity
• Many optional APIs for the Java ME platforms
  have been designed to support remote and
  local connectivity on consumer handsets


• Manufacturers
  can add and
  remove support
  for protocols with
  no impact to the
  whole runtime

 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Generic Connection Framework
• The Generic Connection Framework (GCF) is
  the core library component that provides
  dynamic access to any communication
  protocol with a standard interface

• The Connector factory creates connections
  according to URI schemas and protocols:
                                                                                      Protocols:
Connection connection = Connector.open(SCHEMA);                                       -   HTTP/HTTPS
                                                                                      -   Socket/SecureSocket
InputStream input = connection.openInputStream();                                     -   ServerSocket
                                                                                      -   Datagram
OutputStream output = connection.openOutputStream();                                  -   Serial (Comm & IrDA)
                                                                                      -   SMS/MMS
                                                                                      -   Bleutooth
// your logic here! :-)                                                               -   Contactless (NFC)
connection.close();

  Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Agenda
• Generic Connection Framework
   – Networking
      • Basic: HTTP/HTTPS
      • Low-level: socket, serversocket, datagrams
      • Messaging
      • Web Services
      • Multimedia
   – Local connectivity:
      • Bluetooth
      • IrDA & Serial ports
      • Near Field Communication
• Conclusions
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Basic networking
• The MIDP Profile requires Java runtime
  environment to support both HTTP and HTTPS
  connections
• HttpConnection and HttpsConnection
  encapsulate HTTP protocol:

HttpConnection connection;
connection = (HttpConnection) Connector.open(“http://www.jmdf.org”);
InputStream input = connection.openInputStream();


if (connection.getResponseCode() == HttpConnection.OK) {
     // you can now download the web page...
}


    Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Low-level networking
• Low-level networking library is key
  requirement for instant messaging, M2M
  communication

• A MIDP device may support direct access to
  transport-level protocols TCP and UDP, in both
  client and server mode:
    – Socket, ServerSocket, Datagram

Connector.open(“socket://www.myhost.it:3040”);
Connector.open(“socket://:3040”); // creates a listening connection
Connector.open(“datagram://updserver.myhost.it:4556”);



  Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Messaging
• SMS and MMS are most popular facilities since
  the advent of 2G mobile telephony

• JME supports short text, binary and multipart
  messages on the Wireless Messaging API:
   – JSR 120: SMS
   – JSR 205: MMS

• MIDlets can send/receive messages to/from a
  registered port (as in TCP/UDP connections)
  using the schema: sms://RECIPIENT:PORT

 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Messaging
• GCF and custom classes manage message
  dispatch and notification
                                             SENDING A MESSAGE:

                                             String recipient = "sms://+391234567890:12345";
                                             MessageConnection conn;
                                             conn = (MessageConnection) Connector.open(recipient);
                                             TextMessage msg = (TextMessage)
                                                              conn.newMessage(conn.TEXT_MESSAGE);
                                             msg.setPayloadText("Hello World!");
• MIDP 2.0 Push                              conn.send(msg);


  Registry lets    RECEIVING A MESSAGE:

  MIDlets to be    MessageConnection c;
                   c = (MessageConnection) Connector.open("sms://:12345");
  registered on    Message msg = c.receive();
                   if (msg instanceof TextMessage) {

  an assigned port     TextMessage tmsg = (TextMessage)msg;
                       // Handle the text message...
                   }
  and executed
  when a message has been received
  Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Web services
• Access to web services is provided by the WSA
  (Web Services API, JSR 172)          MIDlet
• Stub generators create                    Stub
  mobile-side client
  interface automatically
                                WSA                                                    Service Provider

  using WSDL                                                                              Interface

                                 JAXP     JAX-RPC
  Compatibility is limited
  to WS-I Basic Profile 1.0           MIDP/PP
                                                                                 CLDC/CDC

• Lightweight Web Services (REST/JSON) can be
  supported using basic HttpConnection
  (GET/POST) and JAXP subset of JSR 172
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Multimedia
• Mobile Media API (JSR 135) enables audio and
  video playback and recording

• It supports standard download,
  progressive download and
  RTSP
                                                                            RTSP


• Custom
  DataSources
  can be                                                                 HTTP
  implemented to support                                         (Progressive download)

  new protocols and servers
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Multimedia
• Transport is nearly neutral for developers:
  Manager and Player classes hide all details
  related to protocols, formats and encodings

• Easy to play a song using HTTP:
Player player = Manager.createPlayer(“http://myhost.it/song.mp3”);
player.realize();
player.prefetch();
player.start();



                                   3Player plays any kind of music
                                    source (even with DRM) using
                                   MMAPI and custom datasources

  Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Multimedia
• Easy to play a video using RTSP:
Player player = Manager.createPlayer(“rtsp://myhost.it/video.3gp”);
player.realize();            player.prefetch();
VideoControl vc = (VideoControl) player.getControl(“VideoControl”);
vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, aCanvas);
vc.setVisible(true);
player.start();




                            BeeTV plays seamlessly live
                           and video-on-demand channels


  Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Agenda
• Generic Connection Framework
   – Networking
      • Basic: HTTP/HTTPS
      • Low-level: socket, serversocket, datagrams
      • Messaging
      • Web Services
      • Multimedia
   – Local connectivity
      • Bluetooth
      • IrDA & Serial ports
      • Near Field Communication
• Conclusions
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Local connectivity
• Computer is ubiquitous: any object can be
  equipped with an small embedded CPU and
  some wireless module

• Local connectivity (aka ad-hoc networking) is
  the ability of any device to transmit and
  receive data with its surroundings

• Java ME provides a rich set
  of optional APIs to access
  common wireless and wired
  devices
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Bluetooth
• Bluetooth is the leading consumer technology
  for local connectivity: peripherals, P2P
  networks, environment awareness...


                                    MASTER          MASTER




• JSR 82 (Bluetooth API) provides powerful
  interface to device and service discovery,
  L2CAP and RFCOMM connections, OBEX Push
  client and server
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Bluetooth
• Four lines of code to open connection to a
  Bluetooth GPS and read NMEA connect to the
  RFCOMM serial port and read data:
 gps = “btspp://0002C71536EA:1;authenticate=false;encrypt=false;master=false";
 StreamConnection conn = (StreamConnection) Connector.open(gps);
 buffer = new BufferedReader(new InputStreamReader(conn.openInputStream()));
 // it's time to read the first line:
 String nmea_sentence = buffer.readLine();



• NMEA sentences contain position data:
                                                                                             Satellites


 $GPGGA,164922.982,3859.4108,N,00856.1785,E,1,04,3.4,127.9,M,47
 .6,M,0.0,0000*7A
                              Latitude                   Longitude                               Altitude

 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
IrDA & Serial Ports
• Embedded modules often use old-fashioned
  infrared and serial ports. These interfaces are
  still in use for industrial applications to access
  IrDA printers, barcode and RFID readers...

• The GCF provides transparent access to them:

Connector.open(“comm:com0;baudrate=19200”);



• Example: Windows Mobile PDAs
  have CompactFlash socket for
  enhanced peripherals
  Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Near Field Communication
• Near Field Communication (NFC) is a new,
  short-range wireless connectivity technology
  that evolved from contactless identification
  and interconnection technologies

• JSR 257 (Contactless API) provides
  full support for reading/writing
  mode of ISO 14443 tags and
  inter-device communication

• Nokia 6131 NFC is the first
  device compatible with this API
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Network Monitor




 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Conclusions
• Java ME has been designed “with networking
  and connectivity in mind”

• The Generic Connection
  Framework provides
  homogeneous access to
  any I/O interface for both
  remote and local connectivity

• Upcoming networking standard are under
  specification and will be seamlessly integrated
  in next-generation Java ME runtimes
 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
About me
• Stefano Sanna
   – Website:                   http://www.gerdavax.it
   – Email:                     gerdavax@tiscali.it




• Java Mobile Developers Forum
   – Website:                   http://www.jmdf.org

• Beeweeb Technologies
   – Website:                   http://www.beeweeb.com

 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
Thank you :-)
                                  Java ME
                          Networking & Connectivity

                                               (Versione 1.0)


                                        (C) 2007 Stefano Sanna
                           http://www.gerdavax.it - gerdavax@tiscali.it




Permission is granted to copy, distribute and/or modify this document under the terms of the GNU
Free Documentation License, Version 1.2 or any later version published by the Free Software
Foundation. Please, find a copy of the license at: http://www.gnu.org/copyleft/fdl.html


                               http://www.gnu.org/copyleft/fdl.html




   Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org

Weitere ähnliche Inhalte

Was ist angesagt?

Honeywell Experion HS
Honeywell Experion HSHoneywell Experion HS
Honeywell Experion HSShivam Singh
 
Computer Ports
Computer PortsComputer Ports
Computer PortsNetwax Lab
 
LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8
LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8
LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8Microsoft Mobile Developer
 
Major project of Video calling and remote accessing
Major project  of Video calling and remote accessingMajor project  of Video calling and remote accessing
Major project of Video calling and remote accessingsyed Farhan Rizvi
 
Training & development in industry
Training & development in industryTraining & development in industry
Training & development in industryDinesh Dwivedi
 
NFCRFID Ripe for Application Expansion_ElectronicDesign
NFCRFID Ripe for Application Expansion_ElectronicDesignNFCRFID Ripe for Application Expansion_ElectronicDesign
NFCRFID Ripe for Application Expansion_ElectronicDesignHamed M. Sanogo
 
Shahnshah Sarker 072802556
Shahnshah Sarker  072802556Shahnshah Sarker  072802556
Shahnshah Sarker 072802556mashiur
 
OPC Unified Architecture
OPC Unified ArchitectureOPC Unified Architecture
OPC Unified ArchitectureVishwa Mohan
 
MikroTik Basic Training Class - Online Moduls - English
 MikroTik Basic Training Class - Online Moduls - English MikroTik Basic Training Class - Online Moduls - English
MikroTik Basic Training Class - Online Moduls - EnglishAdhie Lesmana
 
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU GatewaysIntroduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU GatewaysICP DAS USA, Inc.
 
Ip interfaces by faststream technologies
Ip interfaces by faststream technologiesIp interfaces by faststream technologies
Ip interfaces by faststream technologiesVishalMalhotra58
 
Review on Transmission and Reception of Data through USB in VHDL
Review on Transmission and Reception of Data through USB in VHDLReview on Transmission and Reception of Data through USB in VHDL
Review on Transmission and Reception of Data through USB in VHDLIRJET Journal
 
Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Benjamin Cabé
 
Introduction to NFC
Introduction to NFCIntroduction to NFC
Introduction to NFCWei-Tsung Su
 
Scalable Service-Oriented Middleware over IP
Scalable Service-Oriented Middleware over IPScalable Service-Oriented Middleware over IP
Scalable Service-Oriented Middleware over IPDai Yang
 

Was ist angesagt? (18)

Electronic Access Control Security
Electronic Access Control SecurityElectronic Access Control Security
Electronic Access Control Security
 
Honeywell Experion HS
Honeywell Experion HSHoneywell Experion HS
Honeywell Experion HS
 
Computer Ports
Computer PortsComputer Ports
Computer Ports
 
LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8
LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8
LUMIA APP LABS: DEVELOPING NFC APPS IN WINDOWS PHONE 8
 
Major project of Video calling and remote accessing
Major project  of Video calling and remote accessingMajor project  of Video calling and remote accessing
Major project of Video calling and remote accessing
 
Training & development in industry
Training & development in industryTraining & development in industry
Training & development in industry
 
NFCRFID Ripe for Application Expansion_ElectronicDesign
NFCRFID Ripe for Application Expansion_ElectronicDesignNFCRFID Ripe for Application Expansion_ElectronicDesign
NFCRFID Ripe for Application Expansion_ElectronicDesign
 
DCM
DCMDCM
DCM
 
Shahnshah Sarker 072802556
Shahnshah Sarker  072802556Shahnshah Sarker  072802556
Shahnshah Sarker 072802556
 
OPC Unified Architecture
OPC Unified ArchitectureOPC Unified Architecture
OPC Unified Architecture
 
MikroTik Basic Training Class - Online Moduls - English
 MikroTik Basic Training Class - Online Moduls - English MikroTik Basic Training Class - Online Moduls - English
MikroTik Basic Training Class - Online Moduls - English
 
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU GatewaysIntroduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
 
Ip interfaces by faststream technologies
Ip interfaces by faststream technologiesIp interfaces by faststream technologies
Ip interfaces by faststream technologies
 
Review on Transmission and Reception of Data through USB in VHDL
Review on Transmission and Reception of Data through USB in VHDLReview on Transmission and Reception of Data through USB in VHDL
Review on Transmission and Reception of Data through USB in VHDL
 
Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013
 
Introduction to NFC
Introduction to NFCIntroduction to NFC
Introduction to NFC
 
Scalable Service-Oriented Middleware over IP
Scalable Service-Oriented Middleware over IPScalable Service-Oriented Middleware over IP
Scalable Service-Oriented Middleware over IP
 
Sahil_Resume
Sahil_ResumeSahil_Resume
Sahil_Resume
 

Andere mochten auch

Near field communication
Near field communicationNear field communication
Near field communicationdevilgrude
 
Near field communication (nfc) technology
Near field communication (nfc) technologyNear field communication (nfc) technology
Near field communication (nfc) technologyAnkur Sharma
 
NEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATIONNEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATIONHarisankar U K
 
NFC technical presentation
NFC technical presentationNFC technical presentation
NFC technical presentationAkshat Rohatgi
 
DC4420 2014 - NFC - The Non-Radio Bits
DC4420 2014 - NFC - The Non-Radio BitsDC4420 2014 - NFC - The Non-Radio Bits
DC4420 2014 - NFC - The Non-Radio BitsTom Keetch
 
NFC and consumers - Success factors and limitations in retail business - Flor...
NFC and consumers - Success factors and limitations in retail business - Flor...NFC and consumers - Success factors and limitations in retail business - Flor...
NFC and consumers - Success factors and limitations in retail business - Flor...Florian Resatsch
 
Ask Contactless Terminals
Ask Contactless TerminalsAsk Contactless Terminals
Ask Contactless Terminalsclaren65
 
Digital wallet (e-wallet)
Digital wallet  (e-wallet)Digital wallet  (e-wallet)
Digital wallet (e-wallet)Krishna Kumar
 
Near field communication
Near field communication Near field communication
Near field communication Paurnima Pawar
 
NFC(Near Field Communication)
NFC(Near Field Communication)NFC(Near Field Communication)
NFC(Near Field Communication)ADARSH KUMAR
 
NFC and the Growth of Connected Consumer Devices
NFC and the Growth of Connected Consumer DevicesNFC and the Growth of Connected Consumer Devices
NFC and the Growth of Connected Consumer DevicesNFC Forum
 
Near field communication and RFID - opening for new business
Near field communication and RFID - opening for new businessNear field communication and RFID - opening for new business
Near field communication and RFID - opening for new businessJosef Noll
 
Near field communication
Near field communicationNear field communication
Near field communicationdivyasolanki101
 
NFC Technology
NFC TechnologyNFC Technology
NFC TechnologyNeha Singh
 

Andere mochten auch (20)

Near field communication
Near field communicationNear field communication
Near field communication
 
Near field communication (nfc) technology
Near field communication (nfc) technologyNear field communication (nfc) technology
Near field communication (nfc) technology
 
NEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATIONNEAR FIELD COMMUNICATION
NEAR FIELD COMMUNICATION
 
NFC technical presentation
NFC technical presentationNFC technical presentation
NFC technical presentation
 
Rfid簡報
Rfid簡報Rfid簡報
Rfid簡報
 
DC4420 2014 - NFC - The Non-Radio Bits
DC4420 2014 - NFC - The Non-Radio BitsDC4420 2014 - NFC - The Non-Radio Bits
DC4420 2014 - NFC - The Non-Radio Bits
 
NFC and consumers - Success factors and limitations in retail business - Flor...
NFC and consumers - Success factors and limitations in retail business - Flor...NFC and consumers - Success factors and limitations in retail business - Flor...
NFC and consumers - Success factors and limitations in retail business - Flor...
 
Ask Contactless Terminals
Ask Contactless TerminalsAsk Contactless Terminals
Ask Contactless Terminals
 
Digital wallet (e-wallet)
Digital wallet  (e-wallet)Digital wallet  (e-wallet)
Digital wallet (e-wallet)
 
Civintec introduction 2015
Civintec introduction 2015Civintec introduction 2015
Civintec introduction 2015
 
NFC In Mobile Commerce
NFC In Mobile CommerceNFC In Mobile Commerce
NFC In Mobile Commerce
 
Near field communication
Near field communication Near field communication
Near field communication
 
NFC Basic Concepts
NFC Basic ConceptsNFC Basic Concepts
NFC Basic Concepts
 
NFC(Near Field Communication)
NFC(Near Field Communication)NFC(Near Field Communication)
NFC(Near Field Communication)
 
NFC and the Growth of Connected Consumer Devices
NFC and the Growth of Connected Consumer DevicesNFC and the Growth of Connected Consumer Devices
NFC and the Growth of Connected Consumer Devices
 
Nfc
NfcNfc
Nfc
 
Near field communication and RFID - opening for new business
Near field communication and RFID - opening for new businessNear field communication and RFID - opening for new business
Near field communication and RFID - opening for new business
 
Nfc ppt
Nfc pptNfc ppt
Nfc ppt
 
Near field communication
Near field communicationNear field communication
Near field communication
 
NFC Technology
NFC TechnologyNFC Technology
NFC Technology
 

Ähnlich wie Java ME Networking & Connectivity

Socket programming
Socket programmingSocket programming
Socket programmingMdEmonRana
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Socket Programming
Socket  ProgrammingSocket  Programming
Socket Programmingleminhvuong
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...mfrancis
 
Driver Configuration Webinar
Driver Configuration WebinarDriver Configuration Webinar
Driver Configuration WebinarAVEVA
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagarNitish Nagar
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008Vando Batista
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introductionmuthusvm
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)Ericom Software
 
Manual redes - network programming with j2 me wireless devices
Manual   redes - network programming with j2 me wireless devicesManual   redes - network programming with j2 me wireless devices
Manual redes - network programming with j2 me wireless devicesVictor Garcia Vara
 
Socket Programming by Rajkumar Buyya
Socket Programming by Rajkumar BuyyaSocket Programming by Rajkumar Buyya
Socket Programming by Rajkumar BuyyaiDhawalVaja
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 

Ähnlich wie Java ME Networking & Connectivity (20)

Socket programming
Socket programmingSocket programming
Socket programming
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Socket Programming
Socket  ProgrammingSocket  Programming
Socket Programming
 
Grizzly 20080925 V2
Grizzly 20080925 V2Grizzly 20080925 V2
Grizzly 20080925 V2
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
 
Java networking
Java networkingJava networking
Java networking
 
Driver Configuration Webinar
Driver Configuration WebinarDriver Configuration Webinar
Driver Configuration Webinar
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introduction
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
 
Manual redes - network programming with j2 me wireless devices
Manual   redes - network programming with j2 me wireless devicesManual   redes - network programming with j2 me wireless devices
Manual redes - network programming with j2 me wireless devices
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
 
Socket Programming by Rajkumar Buyya
Socket Programming by Rajkumar BuyyaSocket Programming by Rajkumar Buyya
Socket Programming by Rajkumar Buyya
 
GCF
GCFGCF
GCF
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
Signal r
Signal rSignal r
Signal r
 
Introduction to ns3
Introduction to ns3Introduction to ns3
Introduction to ns3
 

Mehr von Stefano Sanna

Mobile Security su Android - LinuxDay 2018
Mobile Security su Android - LinuxDay 2018Mobile Security su Android - LinuxDay 2018
Mobile Security su Android - LinuxDay 2018Stefano Sanna
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldStefano Sanna
 
Android Things Linux Day 2017
Android Things Linux Day 2017 Android Things Linux Day 2017
Android Things Linux Day 2017 Stefano Sanna
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in actionStefano Sanna
 
Introduzione alla tecnologia iBeacon
Introduzione alla tecnologia iBeaconIntroduzione alla tecnologia iBeacon
Introduzione alla tecnologia iBeaconStefano Sanna
 
Augmented Smartphone
Augmented SmartphoneAugmented Smartphone
Augmented SmartphoneStefano Sanna
 
Bluetooth Low Energy
Bluetooth Low EnergyBluetooth Low Energy
Bluetooth Low EnergyStefano Sanna
 
Google TV: la nuova frontiera Android
Google TV: la nuova frontiera AndroidGoogle TV: la nuova frontiera Android
Google TV: la nuova frontiera AndroidStefano Sanna
 
Enlarge your screen: introducing the Google TV
Enlarge your screen: introducing the Google TVEnlarge your screen: introducing the Google TV
Enlarge your screen: introducing the Google TVStefano Sanna
 
NFC: tecnologia e applicazioni
NFC: tecnologia e applicazioniNFC: tecnologia e applicazioni
NFC: tecnologia e applicazioniStefano Sanna
 
Android - Programmazione Avanzata
Android -  Programmazione AvanzataAndroid -  Programmazione Avanzata
Android - Programmazione AvanzataStefano Sanna
 
HCIM08 - Mobile Applications
HCIM08 - Mobile ApplicationsHCIM08 - Mobile Applications
HCIM08 - Mobile ApplicationsStefano Sanna
 
Android & Bluetooth: hacking e applicazioni
Android & Bluetooth: hacking e applicazioniAndroid & Bluetooth: hacking e applicazioni
Android & Bluetooth: hacking e applicazioniStefano Sanna
 
Application Store: opportunita' e trappole
Application Store: opportunita' e trappoleApplication Store: opportunita' e trappole
Application Store: opportunita' e trappoleStefano Sanna
 
Android Bluetooth Hacking
Android Bluetooth HackingAndroid Bluetooth Hacking
Android Bluetooth HackingStefano Sanna
 
Free Software e Open Hardware
Free Software e Open HardwareFree Software e Open Hardware
Free Software e Open HardwareStefano Sanna
 
Playing with Mobile 2.0
Playing with Mobile 2.0Playing with Mobile 2.0
Playing with Mobile 2.0Stefano Sanna
 

Mehr von Stefano Sanna (20)

Mobile Security su Android - LinuxDay 2018
Mobile Security su Android - LinuxDay 2018Mobile Security su Android - LinuxDay 2018
Mobile Security su Android - LinuxDay 2018
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical world
 
Android Things Linux Day 2017
Android Things Linux Day 2017 Android Things Linux Day 2017
Android Things Linux Day 2017
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
 
Introduzione alla tecnologia iBeacon
Introduzione alla tecnologia iBeaconIntroduzione alla tecnologia iBeacon
Introduzione alla tecnologia iBeacon
 
Augmented Smartphone
Augmented SmartphoneAugmented Smartphone
Augmented Smartphone
 
Bluetooth Low Energy
Bluetooth Low EnergyBluetooth Low Energy
Bluetooth Low Energy
 
Google TV: la nuova frontiera Android
Google TV: la nuova frontiera AndroidGoogle TV: la nuova frontiera Android
Google TV: la nuova frontiera Android
 
Enlarge your screen: introducing the Google TV
Enlarge your screen: introducing the Google TVEnlarge your screen: introducing the Google TV
Enlarge your screen: introducing the Google TV
 
Introduzione ad NFC
Introduzione ad NFCIntroduzione ad NFC
Introduzione ad NFC
 
NFC: tecnologia e applicazioni
NFC: tecnologia e applicazioniNFC: tecnologia e applicazioni
NFC: tecnologia e applicazioni
 
Android - Programmazione Avanzata
Android -  Programmazione AvanzataAndroid -  Programmazione Avanzata
Android - Programmazione Avanzata
 
HCIM08 - Mobile Applications
HCIM08 - Mobile ApplicationsHCIM08 - Mobile Applications
HCIM08 - Mobile Applications
 
Android & Bluetooth: hacking e applicazioni
Android & Bluetooth: hacking e applicazioniAndroid & Bluetooth: hacking e applicazioni
Android & Bluetooth: hacking e applicazioni
 
Application Store: opportunita' e trappole
Application Store: opportunita' e trappoleApplication Store: opportunita' e trappole
Application Store: opportunita' e trappole
 
Android Bluetooth Hacking
Android Bluetooth HackingAndroid Bluetooth Hacking
Android Bluetooth Hacking
 
Android
AndroidAndroid
Android
 
Free Software e Open Hardware
Free Software e Open HardwareFree Software e Open Hardware
Free Software e Open Hardware
 
Playing with Mobile 2.0
Playing with Mobile 2.0Playing with Mobile 2.0
Playing with Mobile 2.0
 
Sun SPOT
Sun SPOTSun SPOT
Sun SPOT
 

Kürzlich hochgeladen

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Java ME Networking & Connectivity

  • 1. Java ME Networking & Connectivity Stefano Sanna gerdavax@tiscali.it - http://www.gerdavax.it Supported by: Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 2. Speaker • Stefano Sanna is... – Mobile Application Architect @ Beeweeb – Technical writer @ DEV, JavaJournal, CP, FSM... – Supporter JMDF, JIA, JUG Sardegna, GULCh... – LEGO constructor (since 1973...) Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 3. Agenda • Generic Connection Framework – Networking • Basic: HTTP/HTTPS • Low-level: socket, serversocket, datagrams • Messaging • Web Services • Multimedia – Local connectivity: • Bluetooth • IrDA & Serial ports • Near Field Communication • Conclusions Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 4. Agenda • Generic Connection Framework – Networking • Basic: HTTP/HTTPS • Low-level: socket, serversocket, datagrams • Messaging • Web Services • Multimedia – Local connectivity • Bluetooth • IrDA & Serial ports • Near Field Communication • Conclusions Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 5. Java ME: made for connectivity • Many optional APIs for the Java ME platforms have been designed to support remote and local connectivity on consumer handsets • Manufacturers can add and remove support for protocols with no impact to the whole runtime Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 6. Generic Connection Framework • The Generic Connection Framework (GCF) is the core library component that provides dynamic access to any communication protocol with a standard interface • The Connector factory creates connections according to URI schemas and protocols: Protocols: Connection connection = Connector.open(SCHEMA); - HTTP/HTTPS - Socket/SecureSocket InputStream input = connection.openInputStream(); - ServerSocket - Datagram OutputStream output = connection.openOutputStream(); - Serial (Comm & IrDA) - SMS/MMS - Bleutooth // your logic here! :-) - Contactless (NFC) connection.close(); Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 7. Agenda • Generic Connection Framework – Networking • Basic: HTTP/HTTPS • Low-level: socket, serversocket, datagrams • Messaging • Web Services • Multimedia – Local connectivity: • Bluetooth • IrDA & Serial ports • Near Field Communication • Conclusions Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 8. Basic networking • The MIDP Profile requires Java runtime environment to support both HTTP and HTTPS connections • HttpConnection and HttpsConnection encapsulate HTTP protocol: HttpConnection connection; connection = (HttpConnection) Connector.open(“http://www.jmdf.org”); InputStream input = connection.openInputStream(); if (connection.getResponseCode() == HttpConnection.OK) { // you can now download the web page... } Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 9. Low-level networking • Low-level networking library is key requirement for instant messaging, M2M communication • A MIDP device may support direct access to transport-level protocols TCP and UDP, in both client and server mode: – Socket, ServerSocket, Datagram Connector.open(“socket://www.myhost.it:3040”); Connector.open(“socket://:3040”); // creates a listening connection Connector.open(“datagram://updserver.myhost.it:4556”); Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 10. Messaging • SMS and MMS are most popular facilities since the advent of 2G mobile telephony • JME supports short text, binary and multipart messages on the Wireless Messaging API: – JSR 120: SMS – JSR 205: MMS • MIDlets can send/receive messages to/from a registered port (as in TCP/UDP connections) using the schema: sms://RECIPIENT:PORT Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 11. Messaging • GCF and custom classes manage message dispatch and notification SENDING A MESSAGE: String recipient = "sms://+391234567890:12345"; MessageConnection conn; conn = (MessageConnection) Connector.open(recipient); TextMessage msg = (TextMessage) conn.newMessage(conn.TEXT_MESSAGE); msg.setPayloadText("Hello World!"); • MIDP 2.0 Push conn.send(msg); Registry lets RECEIVING A MESSAGE: MIDlets to be MessageConnection c; c = (MessageConnection) Connector.open("sms://:12345"); registered on Message msg = c.receive(); if (msg instanceof TextMessage) { an assigned port TextMessage tmsg = (TextMessage)msg; // Handle the text message... } and executed when a message has been received Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 12. Web services • Access to web services is provided by the WSA (Web Services API, JSR 172) MIDlet • Stub generators create Stub mobile-side client interface automatically WSA Service Provider using WSDL Interface JAXP JAX-RPC Compatibility is limited to WS-I Basic Profile 1.0 MIDP/PP CLDC/CDC • Lightweight Web Services (REST/JSON) can be supported using basic HttpConnection (GET/POST) and JAXP subset of JSR 172 Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 13. Multimedia • Mobile Media API (JSR 135) enables audio and video playback and recording • It supports standard download, progressive download and RTSP RTSP • Custom DataSources can be HTTP implemented to support (Progressive download) new protocols and servers Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 14. Multimedia • Transport is nearly neutral for developers: Manager and Player classes hide all details related to protocols, formats and encodings • Easy to play a song using HTTP: Player player = Manager.createPlayer(“http://myhost.it/song.mp3”); player.realize(); player.prefetch(); player.start(); 3Player plays any kind of music source (even with DRM) using MMAPI and custom datasources Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 15. Multimedia • Easy to play a video using RTSP: Player player = Manager.createPlayer(“rtsp://myhost.it/video.3gp”); player.realize(); player.prefetch(); VideoControl vc = (VideoControl) player.getControl(“VideoControl”); vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, aCanvas); vc.setVisible(true); player.start(); BeeTV plays seamlessly live and video-on-demand channels Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 16. Agenda • Generic Connection Framework – Networking • Basic: HTTP/HTTPS • Low-level: socket, serversocket, datagrams • Messaging • Web Services • Multimedia – Local connectivity • Bluetooth • IrDA & Serial ports • Near Field Communication • Conclusions Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 17. Local connectivity • Computer is ubiquitous: any object can be equipped with an small embedded CPU and some wireless module • Local connectivity (aka ad-hoc networking) is the ability of any device to transmit and receive data with its surroundings • Java ME provides a rich set of optional APIs to access common wireless and wired devices Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 18. Bluetooth • Bluetooth is the leading consumer technology for local connectivity: peripherals, P2P networks, environment awareness... MASTER MASTER • JSR 82 (Bluetooth API) provides powerful interface to device and service discovery, L2CAP and RFCOMM connections, OBEX Push client and server Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 19. Bluetooth • Four lines of code to open connection to a Bluetooth GPS and read NMEA connect to the RFCOMM serial port and read data: gps = “btspp://0002C71536EA:1;authenticate=false;encrypt=false;master=false"; StreamConnection conn = (StreamConnection) Connector.open(gps); buffer = new BufferedReader(new InputStreamReader(conn.openInputStream())); // it's time to read the first line: String nmea_sentence = buffer.readLine(); • NMEA sentences contain position data: Satellites $GPGGA,164922.982,3859.4108,N,00856.1785,E,1,04,3.4,127.9,M,47 .6,M,0.0,0000*7A Latitude Longitude Altitude Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 20. IrDA & Serial Ports • Embedded modules often use old-fashioned infrared and serial ports. These interfaces are still in use for industrial applications to access IrDA printers, barcode and RFID readers... • The GCF provides transparent access to them: Connector.open(“comm:com0;baudrate=19200”); • Example: Windows Mobile PDAs have CompactFlash socket for enhanced peripherals Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 21. Near Field Communication • Near Field Communication (NFC) is a new, short-range wireless connectivity technology that evolved from contactless identification and interconnection technologies • JSR 257 (Contactless API) provides full support for reading/writing mode of ISO 14443 tags and inter-device communication • Nokia 6131 NFC is the first device compatible with this API Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 22. Network Monitor Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 23. Conclusions • Java ME has been designed “with networking and connectivity in mind” • The Generic Connection Framework provides homogeneous access to any I/O interface for both remote and local connectivity • Upcoming networking standard are under specification and will be seamlessly integrated in next-generation Java ME runtimes Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 24. About me • Stefano Sanna – Website: http://www.gerdavax.it – Email: gerdavax@tiscali.it • Java Mobile Developers Forum – Website: http://www.jmdf.org • Beeweeb Technologies – Website: http://www.beeweeb.com Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org
  • 25. Thank you :-) Java ME Networking & Connectivity (Versione 1.0) (C) 2007 Stefano Sanna http://www.gerdavax.it - gerdavax@tiscali.it Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation. Please, find a copy of the license at: http://www.gnu.org/copyleft/fdl.html http://www.gnu.org/copyleft/fdl.html Java ME Connectivity Overview – ActionScript.it and JMDF online Meeting, 21-03-2007 - http://www.jmdf.org