wireless ppt

Upload: ranjithaloken9816

Post on 30-May-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Wireless Ppt

    1/34

    Seminar onSeminar on

    DESIGNING WIRELESSDESIGNING WIRELESS

    APPLICATION USINGAPPLICATION USING

    J2ME TECHNOLOGYJ2ME TECHNOLOGY

  • 8/14/2019 Wireless Ppt

    2/34

    AGENDAAGENDA

    Company ProfileCompany ProfileIntroduction to Wireless TechnologyIntroduction to Wireless Technology

    Components of a wireless systemComponents of a wireless system

    Overview of Java 2 PlatformOverview of Java 2 PlatformOverview of J2MEOverview of J2ME

    Design and implementation IssuesDesign and implementation Issues

    Network programming with J2ME for wirelessNetwork programming with J2ME for wirelessdevicesdevices

  • 8/14/2019 Wireless Ppt

    3/34

    COMPANY PROFILECOMPANY PROFILE

    Intersoftkk is a Multinational SoftwareIntersoftkk is a Multinational SoftwareDevelopment and IT OutsourcingDevelopment and IT Outsourcing

    Services Company.Services Company.

    IntersoftkkIntersoftkk is located in Bangalore and wasis located in Bangalore and was

    formed in 1997.formed in 1997.

    Intersoftkks objective is to provide theIntersoftkks objective is to provide theworlds best software engineeringworlds best software engineering

    services to help its clients achieve andservices to help its clients achieve and

    maintain competitive advantage.maintain competitive advantage.

  • 8/14/2019 Wireless Ppt

    4/34

    Intersoftkk is working in the area ofIntersoftkk is working in the area of

    embedded software development especiallyembedded software development especially

    in the wireless and mobile product domain.in the wireless and mobile product domain. Its mission is to bring in continuousIts mission is to bring in continuous

    improvement and achieve excellent customerimprovement and achieve excellent customer

    satisfaction at all levels of software training andsatisfaction at all levels of software training anddevelopment, through its modular anddevelopment, through its modular and

    systematic approach in accomplishing the goalsystematic approach in accomplishing the goal

    of becoming a global giantof becoming a global giant

  • 8/14/2019 Wireless Ppt

    5/34

    COMPANYS AREA OF EXPERTISECOMPANYS AREA OF EXPERTISE

    AND CLIENTSAND CLIENTS

    Java (J2ME, J2EE), C, C++, Microsoft.NetJava (J2ME, J2EE), C, C++, Microsoft.Net( VB.Net, C#.Net, Asp.Net, Ado.Net), Linux,( VB.Net, C#.Net, Asp.Net, Ado.Net), Linux,

    Clients include: Sony software, TCS, AceClients include: Sony software, TCS, Ace

    Designers, Mukund Software, DSL SoftwareDesigners, Mukund Software, DSL Software

    Ltd., Philips Software India Ltd., Wipro, Oracle,Ltd., Philips Software India Ltd., Wipro, Oracle,

    CGI (IMR Global), Apex Technologies,CGI (IMR Global), Apex Technologies,

    Mphasis Canarys Automation Pvt Ltd. , HP.Mphasis Canarys Automation Pvt Ltd. , HP.

  • 8/14/2019 Wireless Ppt

    6/34

  • 8/14/2019 Wireless Ppt

    7/34

    COMPONENTS OF A WIRELESSCOMPONENTS OF A WIRELESS

    SYSTEMSYSTEM

    HANDHELD DEVICESHANDHELD DEVICES

    CONNECTIVITY AND COVERAGECONNECTIVITY AND COVERAGE

    WIRELESS MIDDLEWAREWIRELESS MIDDLEWARE

    (APPLICATION SERVER)(APPLICATION SERVER)TRANSCODINGTRANSCODING

  • 8/14/2019 Wireless Ppt

    8/34

    HANDHELD DEVICESHANDHELD DEVICES

    Paging devices , Smart phones, WAP phones etc.Paging devices , Smart phones, WAP phones etc.Each handheld device demands its own ways ofEach handheld device demands its own ways of

    communicating; Varying screen sizes give rise to varyingcommunicating; Varying screen sizes give rise to varyingscreen layouts.screen layouts.

    The application server must sort this all out and send eachThe application server must sort this all out and send eachhandheld device its data in a format it can utilize.handheld device its data in a format it can utilize.

    There are several operating systems used with handheldThere are several operating systems used with handhelddevices likedevices like Windows CE, Palm OSWindows CE, Palm OS,,LinuxLinux ,,EPOCEPOC..

  • 8/14/2019 Wireless Ppt

    9/34

    CONNECTIVITY AND COVERAGECONNECTIVITY AND COVERAGE

    The cell tower sends data on to a base station. From the baseThe cell tower sends data on to a base station. From the basestation, the data is transferred to a mobile switching centerstation, the data is transferred to a mobile switching centerwhich connects all base stations together. If the user is partwhich connects all base stations together. If the user is partof the geographical network, the network system willof the geographical network, the network system willidentify his information via Home Location Register (HLR).identify his information via Home Location Register (HLR).

    If he's from outside the network, Visitor Location RegisterIf he's from outside the network, Visitor Location Register(VLR) will be used to track the call.(VLR) will be used to track the call.

    Once the call is initiated, the device signals its identity usingOnce the call is initiated, the device signals its identity usingits electronic Serial number (ESN) and Mobile Identityits electronic Serial number (ESN) and Mobile Identity

    Number (MIN). This information is vital for the gateway toNumber (MIN). This information is vital for the gateway toauthenticate the user. The application server then preparesauthenticate the user. The application server then preparesdata to send back to the appropriate unit to be displayed.data to send back to the appropriate unit to be displayed.

    There are two types of transmission:There are two types of transmission: circuit switchedcircuit switchedandandpacket switchedpacket switched..

  • 8/14/2019 Wireless Ppt

    10/34

    APPLICATION SERVERAPPLICATION SERVER

    The application server should be open system and easyThe application server should be open system and easy

    to connect with.to connect with.

    One of the most common methods of communicatingOne of the most common methods of communicatingwith backend systems is by using XML API as the datawith backend systems is by using XML API as the datadelivery tool. XML is used to extract and deliver data.delivery tool. XML is used to extract and deliver data.Different handheld devices will have different screenDifferent handheld devices will have different screentemplates.templates.

    The application server should track the user's sign-in onThe application server should track the user's sign-in on

    thethe device being used in order for data to be presenteddevice being used in order for data to be presentedcorrectly. The screen templates can be XML documentscorrectly. The screen templates can be XML documentswhich conform to DTD files. The screen templates arewhich conform to DTD files. The screen templates areused only to define screen layouts. They are deviceused only to define screen layouts. They are device

    specific.specific.

  • 8/14/2019 Wireless Ppt

    11/34

    TRANSCODINGTRANSCODING Transcoding is the process of formatting the content (data)Transcoding is the process of formatting the content (data)

    according to the handheld device request using XML, XSLaccording to the handheld device request using XML, XSLstyle-sheets . It enables end users to access data universallystyle-sheets . It enables end users to access data universallyregardless of device type.regardless of device type.

    Once a request from a handheld device is initiated, theOnce a request from a handheld device is initiated, the

    application server intercepts the request to identify the deviceapplication server intercepts the request to identify the devicetype and capture the content.type and capture the content.

    Using several logical processes, the application server engineUsing several logical processes, the application server engineprocesses the data into an XML document, which can beprocesses the data into an XML document, which can be

    communicated to the backend system via the APIcommunicated to the backend system via the APIconnection. The result is then transcoded (processed) usingconnection. The result is then transcoded (processed) usingXSL stylesheets and reformatted for the handheld device thatXSL stylesheets and reformatted for the handheld device thatmade the initial request.made the initial request.

  • 8/14/2019 Wireless Ppt

    12/34

    TRANSCODINGTRANSCODING

    User IDs and handheld device IDs are stored in database at theUser IDs and handheld device IDs are stored in database at the

    server. After login, server checks database for authentication.server. After login, server checks database for authentication.

    Pull technologyPull technology is when the handheld device requests data fromis when the handheld device requests data fromserver and data is pulled from server to the applicationserver and data is pulled from server to the application

    Push technologyPush technology is when the server pushes data to the handheldis when the server pushes data to the handhelddevice without waiting for the clients request.device without waiting for the clients request.

    In both, authentication takes place, server communicates withIn both, authentication takes place, server communicates withback end and returns the formatted data to the handheld deviceback end and returns the formatted data to the handheld device

    Server must be easy to install, configure, expand with newServer must be easy to install, configure, expand with newservices and easy to integrate with other servers.services and easy to integrate with other servers.

  • 8/14/2019 Wireless Ppt

    13/34

    SECURITY IN WIRELESS TECHNOLOGYSECURITY IN WIRELESS TECHNOLOGY

    The available operating systems for small devicesThe available operating systems for small devicesoffer little or no security. Most security violationsoffer little or no security. Most security violations

    occur within the financial institution or the serviceoccur within the financial institution or the service

    provider.provider.

    Double key secure authenticationDouble key secure authentication

    Public Key Infrastructure (PKI) used for PDA and SmartPublic Key Infrastructure (PKI) used for PDA and Smart

    phone securityphone security

    EncryptionEncryption

    Authentication with UserID and passwordAuthentication with UserID and password

  • 8/14/2019 Wireless Ppt

    14/34

    OVERVIEW OF JAVA2 PLATFORMOVERVIEW OF JAVA2 PLATFORM

    IT COMPRISES OF 3 ELEMENTSIT COMPRISES OF 3 ELEMENTS Java Programming LanguageJava Programming Language

    A Virtual MachineA Virtual Machine

    APIsAPIs

    IT COMES IN 3 FLAVOURSIT COMES IN 3 FLAVOURS Java 2 Standard Edition (J2SE)Java 2 Standard Edition (J2SE)

    Java 2 Enterprise Edition (J2EE)Java 2 Enterprise Edition (J2EE)

    Java 2 Micro Edition (J2ME)Java 2 Micro Edition (J2ME)

    REASONS FOR USING JAVA IN WIRELESSREASONS FOR USING JAVA IN WIRELESS Safe, Robust and PortableSafe, Robust and Portable

  • 8/14/2019 Wireless Ppt

    15/34

    OVERVIEW OF J2MEOVERVIEW OF J2ME Helps in creating java applications for small devices like pagers,Helps in creating java applications for small devices like pagers,

    mobiles, set-top boxesmobiles, set-top boxes Divided into configurations and profilesDivided into configurations and profiles

    Configuration is a minimum set of APIs that is useful forConfiguration is a minimum set of APIs that is useful fordeveloping applications to run on wireless devices. For example, itdeveloping applications to run on wireless devices. For example, it

    might be designed for devices that have less than 512 KB ofmight be designed for devices that have less than 512 KB ofmemory and an intermittent network connection. J2ME hasmemory and an intermittent network connection. J2ME hasConnected Limited Device Configuration (CLDC).Connected Limited Device Configuration (CLDC).

    A profile builds on a configuration but adds more specific APIs toA profile builds on a configuration but adds more specific APIs tomake a complete environment for building applications. J2ME hasmake a complete environment for building applications. J2ME hasMIDP.MIDP.

  • 8/14/2019 Wireless Ppt

    16/34

    OVERVIEW OF J2MEOVERVIEW OF J2ME

    CLDC is a configuration for J2ME designed for 16CLDC is a configuration for J2ME designed for 16or 32-bit small computing devices with limitedor 32-bit small computing devices with limitedmemory between 160 to 512 kb.memory between 160 to 512 kb.

    They use less battery power, small bandwidthThey use less battery power, small bandwidth

    network wireless connection CLDC devices includenetwork wireless connection CLDC devices includepagers, PDAs and cell phones.pagers, PDAs and cell phones.

    CLDC includes libraries for Programming UIs usingCLDC includes libraries for Programming UIs usingLimited Connection Device User Interface (LCDUI)Limited Connection Device User Interface (LCDUI)

    API, Storing data using Record Management ServerAPI, Storing data using Record Management Server(RMS) API, Networking with server using Generic(RMS) API, Networking with server using GenericConnection Framework (GCF).Connection Framework (GCF).

  • 8/14/2019 Wireless Ppt

    17/34

    OVERVIEW OF J2MEOVERVIEW OF J2ME

    CLDC helps in:CLDC helps in: Creating interactive and flexible UIsCreating interactive and flexible UIs

    Creating applications when the device is disconnectedCreating applications when the device is disconnected

    from the network.from the network.

    Building wireless applications.Building wireless applications.

    A Mobile Information Device Profile (MIDP) is aA Mobile Information Device Profile (MIDP) is a

    profile which consists of a set of J2ME APIs.profile which consists of a set of J2ME APIs.MIDP along with CLDC provides a complete JavaMIDP along with CLDC provides a complete Java

    Runtime Environment for cell phones, pagers, etc.Runtime Environment for cell phones, pagers, etc.

  • 8/14/2019 Wireless Ppt

    18/34

    DESIGN AND IMPLEMENTATIONDESIGN AND IMPLEMENTATION

    ISSUESISSUES

    Design Constraints for mobile devices are: High latency,Design Constraints for mobile devices are: High latency,

    Limited bandwidth and Intermittent Connectivity.Limited bandwidth and Intermittent Connectivity.

    A MIDP client addresses these constraints by ConnectingA MIDP client addresses these constraints by Connecting

    to network only when needed, Consume only as much datato network only when needed, Consume only as much datafrom the network as needed and remaining useful when thefrom the network as needed and remaining useful when the

    network is disconnected.network is disconnected.

    Three aspects to networked wireless applications are:Three aspects to networked wireless applications are:Client-side architecture, messaging and presentation.Client-side architecture, messaging and presentation.

  • 8/14/2019 Wireless Ppt

    19/34

  • 8/14/2019 Wireless Ppt

    20/34

  • 8/14/2019 Wireless Ppt

    21/34

    PRESENTATIONPRESENTATION The more focused and directed a users interaction is withThe more focused and directed a users interaction is with

    an application, the better the users experience. This isan application, the better the users experience. This isparticularly crucial for wireless applications given theparticularly crucial for wireless applications given the

    limited screen and input capabilities of mobile devices.limited screen and input capabilities of mobile devices.

    Strategies to make networked wireless applications moreStrategies to make networked wireless applications moreusable are:usable are:

    Implementing client side validationImplementing client side validation

    Threading long operationsThreading long operations

    Provide progress indicatorsProvide progress indicators Make operations interruptibleMake operations interruptible

    Personalize the applicationPersonalize the application

  • 8/14/2019 Wireless Ppt

    22/34

    PROGRAMMING MODELPROGRAMMING MODEL MIDP Application client called MIDlet provides UI & requestsMIDP Application client called MIDlet provides UI & requests

    Servlet interprets requests, directs it to EJB. After requestServlet interprets requests, directs it to EJB. After requestfulfillment servlet generates response for the MIDletfulfillment servlet generates response for the MIDlet

    EJB encapsulate business logic. The servlet & EJB use APIsEJB encapsulate business logic. The servlet & EJB use APIs

    like JDBC or JavaMail to access enterprise informationlike JDBC or JavaMail to access enterprise information

  • 8/14/2019 Wireless Ppt

    23/34

    PROGRAMMING MODELPROGRAMMING MODEL

    Example of a java smart ticketExample of a java smart ticketsample applicationsample application

    A MIDlet provides the userA MIDlet provides the userinterface on the mobile device.interface on the mobile device.The MIDlet communicates with aThe MIDlet communicates with aJava servlet via secure HTTP.Java servlet via secure HTTP.

    The servlet dispatches clientThe servlet dispatches clientrequests to various enterpriserequests to various enterprisebeans handling accountbeans handling accountmanagement, movie listings, andmanagement, movie listings, andticket purchases.ticket purchases.

    These beans, in turn, access aThese beans, in turn, access adatabase The beans could usedatabase The beans could usedata access methods, such as thedata access methods, such as theJDBC API.JDBC API.

    NETWORK PROGRAMMING WITH

  • 8/14/2019 Wireless Ppt

    24/34

    NETWORK PROGRAMMING WITHNETWORK PROGRAMMING WITH

    J2ME FOR WIRELESS DEVICESJ2ME FOR WIRELESS DEVICES

    Networking in J2ME needs to be flexible for which theNetworking in J2ME needs to be flexible for which theGeneric Connection Framework (GCF) is provided inGeneric Connection Framework (GCF) is provided in

    CLDC.CLDC.

    GCF defines the abstractions of the networking and fileGCF defines the abstractions of the networking and fileI/O in a general way to support a broad range ofI/O in a general way to support a broad range of

    handheld devices, and leaves the actualhandheld devices, and leaves the actual

    implementations of these abstractions to individualimplementations of these abstractions to individual

    device manufacturers.device manufacturers.

    These abstractions are defined as Java interfaces. TheThese abstractions are defined as Java interfaces. The

    device manufacturers choose which one to implementdevice manufacturers choose which one to implement

    in their MIDP based on the actual device capabilities.in their MIDP based on the actual device capabilities.

  • 8/14/2019 Wireless Ppt

    25/34

    GENERIC CONNECTION FRAMEWORKGENERIC CONNECTION FRAMEWORK

    Connection

    Stream

    ConnectionNotifierInputConnection OutputConnection DatagramConnection

    StreamConnection

    ContentConnection

  • 8/14/2019 Wireless Ppt

    26/34

    GENERIC CONNECTION FRAMEWORKGENERIC CONNECTION FRAMEWORK

    The Connector class is the core of Generic ConnectionThe Connector class is the core of Generic Connection

    framework. Different types of communication can be createdframework. Different types of communication can be created

    by the same method with different parameters.by the same method with different parameters.

    Open method is used as: Connector.open(String connect). TheOpen method is used as: Connector.open(String connect). The

    parameter connect consists of protocol, target and params.parameter connect consists of protocol, target and params.

    protocol indicates connection type like http, socket, comm,protocol indicates connection type like http, socket, comm,

    datagram and file.datagram and file.

    target can be a host name, a network port number, a file name,target can be a host name, a network port number, a file name,

    or a communication port numberor a communication port numberparams is optional, it specifies the additional informationparams is optional, it specifies the additional information

    needed to complete the connect string.needed to complete the connect string.

  • 8/14/2019 Wireless Ppt

    27/34

    GENERIC CONNECTION FRAMEWORKGENERIC CONNECTION FRAMEWORKHTTP Connection:HTTP Connection:

    Connection hcConnection hc=Connector.open("http://www.wirelessdevnet.com")=Connector.open("http://www.wirelessdevnet.com")

    Stream Based Connection:Stream Based Connection: Connection sc=Connector.open(socket://localhost:9000)Connection sc=Connector.open(socket://localhost:9000)

    Datagram Connection:Datagram Connection: Connection dc=Connector.open(datagram://:9000)Connection dc=Connector.open(datagram://:9000)

    Serial port communication:Serial port communication:

    Connection cc=Connector.open(comm:0;baudrate=9000)Connection cc=Connector.open(comm:0;baudrate=9000) File I/O:File I/O:

    Connection fc=Connector.open(Connection fc=Connector.open(file://foo.datfile://foo.dat))

    http://smb//foo.dat/http://smb//foo.dat/http://smb//foo.dat/
  • 8/14/2019 Wireless Ppt

    28/34

    HTTPCONNECTION CLASSHTTPCONNECTION CLASS

    It is defined in J2ME MIDP to allow developer to handle httpIt is defined in J2ME MIDP to allow developer to handle http

    connections in their wireless applications.connections in their wireless applications.

    Sockets or datagrams can be used for remote communicationSockets or datagrams can be used for remote communication

    in J2ME applications if the MIDP manufacturer supports it.in J2ME applications if the MIDP manufacturer supports it.

    This creates portability issueThis creates portability issue

    HttpConnection class if used in J2ME application resolves thisHttpConnection class if used in J2ME application resolves this

    since it is mandatory for all MIDP implementations.since it is mandatory for all MIDP implementations.

    The HttpConnection interface derives from theThe HttpConnection interface derives from the

    ContentConnection interface in CLDC. It inherits all I/OContentConnection interface in CLDC. It inherits all I/Ostream methods from StreamConnection, all the MIMEstream methods from StreamConnection, all the MIME

    handling methods from ContentConnection and adds severalhandling methods from ContentConnection and adds several

    additional methods for handling http protocol specific needs.additional methods for handling http protocol specific needs.

  • 8/14/2019 Wireless Ppt

    29/34

    HTTPCONNECTION CLASSHTTPCONNECTION CLASS

    Important Methods:Important Methods: InputStream openInputStream()InputStream openInputStream()

    OutputStream openOutputStream()OutputStream openOutputStream()

    String getEncoding()String getEncoding() long getLength()long getLength()

    String getType()String getType()

    int getResponseCode()int getResponseCode()

    String getResponseMessage()String getResponseMessage()

  • 8/14/2019 Wireless Ppt

    30/34

    EXAMPLE OF USING HttpConnection CLASSEXAMPLE OF USING HttpConnection CLASS

    HttpConnection hc = (HttpConnection);HttpConnection hc = (HttpConnection);

    Connector.open("http://www.wirelessdevnet.com");Connector.open("http://www.wirelessdevnet.com");InputStream is = new hc.openInputStream();InputStream is = new hc.openInputStream();

    int ch;int ch;

    // Check the Content-Length first// Check the Content-Length first

    long len = hc.getLength();long len = hc.getLength();

    if(len!=-1) {if(len!=-1) {for(int i = 0;i

  • 8/14/2019 Wireless Ppt

    31/34

    AN EXAMPLEAN EXAMPLE

    The example is a MIDletThe example is a MIDletprogram that communicatesprogram that communicates

    with a web server to performwith a web server to perform

    a string reversing operation.a string reversing operation.

    User types in a string on theUser types in a string on the

    phone (figure)phone (figure)

  • 8/14/2019 Wireless Ppt

    32/34

    AN EXAMPLEAN EXAMPLE

    The string is sent to a javaThe string is sent to a javaservlet on a web server using theservlet on a web server using the

    HTTP POST method. The javaHTTP POST method. The java

    servlet receives the string andservlet receives the string and

    reverses it and sends thereverses it and sends thereversed string to the MIDletreversed string to the MIDlet

    application for display (fig).application for display (fig).

  • 8/14/2019 Wireless Ppt

    33/34

    CONCLUSIONCONCLUSION

    Here we have seen how to design and develop wirelessHere we have seen how to design and develop wirelessapplications using java technology. Such solutions fullyapplications using java technology. Such solutions fullyreap the benefits of Java technology like portability,reap the benefits of Java technology like portability,scalability, security and programming ease.scalability, security and programming ease.

    EJB provide business logic, Servlets use EJBEJB provide business logic, Servlets use EJBcomponents to access and manipulate data on behalf ofcomponents to access and manipulate data on behalf ofMIDP clients which in turn present data to the user.MIDP clients which in turn present data to the user.

    Since EJB components are designed to be reusable, anSince EJB components are designed to be reusable, an

    enterprise application enabled for mobile clients canenterprise application enabled for mobile clients caneasily serve traditional desktop clients, such as Javaeasily serve traditional desktop clients, such as Javaapplets and Web browsers. The result is a trulyapplets and Web browsers. The result is a trulyaccessible enterprise: anytime, anywhere, from anyaccessible enterprise: anytime, anywhere, from anydevice.device.

  • 8/14/2019 Wireless Ppt

    34/34

    THANK YOUTHANK YOU