Client Server Development – Problems in Supporting Different Wireless Platform


Published on

sun tech days 2005

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Client Server Development – Problems in Supporting Different Wireless Platform

  1. 1. Client Server Development – Problems in Supporting Different Wireless Platform
  2. 2. Agenda <ul><li>Introduction </li></ul><ul><ul><li>Client Server Architecture </li></ul></ul><ul><ul><li>Wireless Platforms </li></ul></ul><ul><li>Main Problems of wireless platform in CS apps </li></ul><ul><ul><li>J2ME Particularities </li></ul></ul><ul><ul><li>BREW Particularities </li></ul></ul><ul><li>Protocol Design </li></ul><ul><li>Case studies </li></ul><ul><ul><li>VivoAgenda </li></ul></ul><ul><ul><li>MotoPhoto </li></ul></ul><ul><li>Conclusions </li></ul>
  3. 3. Introduction
  4. 4. Client Server Architecture <ul><li>Clients uses services that are provided by a Server application (i.e. clients can by a full desktop app, or a web GUI) </li></ul><ul><li>Server provide service to the clients </li></ul><ul><li>CS Protocol defines the “language” that the client must use to “talk” to the server </li></ul>Server Client 1 Client 2 Client N CS Protocol
  5. 5. Clients <ul><li>Client apps can be of 3 main types: </li></ul><ul><ul><li>Wireless: apps running inside mobile handsets </li></ul></ul><ul><ul><li>Wired: apps running in desktop computers </li></ul></ul><ul><ul><li>Web: browser showing HTML pages </li></ul></ul>Server
  6. 6. Server <ul><li>Can also be distributed </li></ul><ul><li>Ideally should only offer the service through the CS Protocol (client independent) </li></ul><ul><li>Offer the same interface to all external clients </li></ul>Web Data Business DB DAO Layer
  7. 7. Client Server Protocol <ul><li>Define the way to access the Server services </li></ul><ul><li>Usually is defined on top of HTTP (S) or TCP (UDP) / IP (SSL) </li></ul><ul><li>Can use some kind of RPC (if supported by the client) </li></ul><ul><ul><li>CORBA </li></ul></ul><ul><ul><li>RMI </li></ul></ul><ul><ul><li>Web Services </li></ul></ul><ul><li>If RPC not supported, can use some proprietary protocol (or some standard one according to the application) </li></ul>
  8. 8. Wireless Platforms - Handsets <ul><li>Most handsets available in low and Mid tier (high tier is too expensive  ) </li></ul><ul><li>Low tier usually does not provide an app model (or provide a real bad one  ) </li></ul><ul><li>Best option is to focus Mid tier </li></ul><ul><li>Small displays </li></ul><ul><li>Gray scale display </li></ul><ul><li>no TCP/IP </li></ul><ul><li>WAP </li></ul><ul><li>Proprietary OSs </li></ul><ul><li>No external app </li></ul><ul><li>model </li></ul><ul><li>Bigger displays </li></ul><ul><li>Color display </li></ul><ul><li>sometimes TCP/IP </li></ul><ul><li>WAP </li></ul><ul><li>Proprietary OSs </li></ul><ul><li>External app </li></ul><ul><li>model </li></ul><ul><li>Very Bigger displays! </li></ul><ul><li>Color display </li></ul><ul><li>Cameras </li></ul><ul><li>TCP/IP SSL / HTTPS </li></ul><ul><li>WAP </li></ul><ul><li>“ Standard” OSs </li></ul><ul><li>External app </li></ul><ul><li>model </li></ul><ul><li>- Bluetooth </li></ul>Low Tier Mid Tier High Tier
  9. 9. Wireless Platforms – Mid tier Handsets <ul><li>BREW – Binary Runtime Environment for Wireless </li></ul><ul><li>Developed by Qualcomm </li></ul><ul><li>Proprietary platform </li></ul><ul><li>C/C++ </li></ul><ul><li>Included in Qualcomm CDMA chipset </li></ul><ul><li>Defines full solution for app provisioning </li></ul><ul><li>Current version is 3.0 </li></ul><ul><li>J2ME – Java 2 MicroEdition Platform </li></ul><ul><li>Developed by JCP </li></ul><ul><li>Focus in different HW not only handsets </li></ul><ul><li>Java  </li></ul><ul><li>Each handset manuf. have to buy its VM </li></ul><ul><li>MIDP is the widest used part of J2ME </li></ul><ul><li>Current version is 2.0 </li></ul>
  10. 10. Network-related Main Problems
  11. 11. MIDP Particularities <ul><li>Only HTTP is mandatory </li></ul><ul><ul><li>There is no way to guarantee that other protocols will be supported </li></ul></ul><ul><ul><li>It is necessary to check each handset that the app will be deployed </li></ul></ul><ul><li>Different implementation of HTTP </li></ul><ul><ul><li>Nokia handsets has HTTP over WAP stack instead of TCP </li></ul></ul><ul><ul><li>Motorola has HTTP over TCP </li></ul></ul><ul><li>J2ME HTTPConnection API does not help the asynchronous connections. </li></ul><ul><ul><li>All data usually must be written in the buffer before opening the connection </li></ul></ul><ul><ul><li>This usually impact on the CS protocol if the app wants to transfer a lot of data  , due to heap limitation </li></ul></ul>
  12. 12. MIDP Particularities <ul><li>HttpConnection), Connector.READ_WRITE); </li></ul><ul><li>hc.setRequestMethod(HttpConnection.POST); </li></ul><ul><li>dos = hc.openDataOutputStream(); </li></ul><ul><li>byte[] request_body = requeststring.getBytes(); </li></ul><ul><li>for (int i = 0; i < request_body.length; i++) { </li></ul><ul><li>dos.writeByte(request_body[i]); </li></ul><ul><li>} </li></ul><ul><li>dos.flush(); </li></ul><ul><li>dos.close(); </li></ul><ul><li>dis = new DataInputStream(hc.openInputStream()); - Connection Here!!! </li></ul><ul><li>int ch; </li></ul><ul><li>len = hc.getLength(); </li></ul><ul><li>if(len!=-1) { </li></ul><ul><li>for(int i = 0;i ;i<len;i++) { </li></ul><ul><li>if((ch =!= -1) </li></ul><ul><li>messagebuffer.append((char)ch); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  13. 13. BREW Particularities <ul><li>BREW usually supports HTTP and sockets in all Qualcomm chipsets </li></ul><ul><li>BREW 1.0 has a limitation that it allows to transfer only 1KB in a HTTP connection. </li></ul><ul><ul><li>This was solved in BREW 2.0 </li></ul></ul><ul><li>MIN vs. MDN </li></ul><ul><ul><li>CDMA networks has 2 number for each handset!!! </li></ul></ul><ul><ul><ul><li>MDN: Mobile Directory Number </li></ul></ul></ul><ul><ul><ul><li>MIN: Mobile Identification Number </li></ul></ul></ul><ul><ul><li>The user knows only the MDN, but the internal handset number is the MIN  </li></ul></ul><ul><ul><li>The Server usually has to implement a mapping function  </li></ul></ul>
  14. 14. BREW Particularities <ul><li>BREW is event based (asynchronous) and does not support Threads. </li></ul><ul><ul><li>Asynchronous response arrives in callback function </li></ul></ul><ul><ul><li>In event based systems there is usually a watch dog, that kills the app if it is executing some function for too much time </li></ul></ul><ul><ul><li>Since that the app cannot do long process in the callback </li></ul></ul><ul><li>The HTTP connection response is read in a callback function  </li></ul><ul><ul><li>The app cannot perform more complex operation in the callback, such as list all records in the phonebook </li></ul></ul>
  15. 15. Client-Server Protocol Design
  16. 16. Which “low” level protocol to use? <ul><li>HTTP is the only protocol that we can guarantee that is available in all platforms </li></ul><ul><li>Client sockets are also supported in almost all handsets </li></ul><ul><li>But… </li></ul>First Choice: HTTP!!!
  17. 17. Which “low” level protocol to use? Can we use some high level protocol on top of HTTP or socket? <ul><li>Web services specified in JCP (JSR 172), but few handsets support it. BREW does not support Web services </li></ul><ul><li>RMI is only in java and is not supported in CLDC/MIDP  </li></ul><ul><li>CORBA is not in BREW and ins not CLDC/MIDP </li></ul><ul><li>Some SOAP solutions only for MIDP </li></ul><ul><ul><li>kSOAP </li></ul></ul><ul><li>But if you use this, you will have to implement the same for BREW, since it is not available  </li></ul>
  18. 18. Which “low” level protocol to use? So, we are back to HTTP  <ul><li>But… if the app needs to send more than one 1KB in a connection, we must make sure that the App will not be deployed in BREW 1.x handsets. </li></ul>
  19. 19. How to specify your app protocol? <ul><li>If you have a XML parser for J2ME and for BREW, use XML. If you don’t you have to define your own language  </li></ul>
  20. 20. Case Studies
  21. 21. Vivo Agenda <ul><li>Service that shadows the user’s phonebook on a server site </li></ul><ul><ul><li>User can add registries in the server side or in the handset and then synchronize them </li></ul></ul><ul><li>All Clients in BREW (no J2ME  ) </li></ul><ul><ul><li>Motorola V710, C357, C358, V265, V510, V810 </li></ul></ul>
  22. 22. MotoPhoto <ul><li>Service that provides the user a way to upload photos in a WEB server </li></ul>