Writing Mobile Code Essential Software Engineering for Building Mobile Applications [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Writing Mobile Code Essential Software Engineering for Building Mobile Applications [Electronic resources] - نسخه متنی

Ivo Salmre

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











Summary


Communication is essential for doing almost any kind of meaningful work. Mobile devices, because they travel through the physical world with their users, are in a unique position to give their users on-demand information and services. With this flexibility comes its own set of challenges. As a mobile application developer, you need to ensure that your application resiliently and flexibly handles wide ranges of communications bandwidth, variable latencies, intermittent connection failures, and different modes of communication. It is important to design your mobile application's communications mechanisms robustly and with the user's needs in mind. This can be substantially more complex than building an effective communications model for servers, desktops, or laptop computers, which tend to deal with a much smaller set of communications variables.

Your mobile application should be designed in such a way that it can take advantage of networks when and as they become available, but it should not be dependent on network access. Access to a communications network should instead be treated opportunistically; use it to good effect when it's there, but do not rely on it. It is important to put the end users in control of network access; they may be able to make intelligent connectivity decisions that are simply not possible to automate into your application logic. Only the end users are able to walk outside to get network connectivity or can tell the device that they are about to go underground where network coverage will not exist. Whenever possible, the end user of the mobile device should be given the ability to initiate or halt network operations. End users may also want to set synchronization preferences based on their own needs and knowledge of available network conditions.

When accessing a networked resource, your application's thread is ceding control for a potentially indeterminate amount of time. For this reason, it is highly recommended that all network access that does not have a definite and short timeout threshold specified should take place on a back ground thread. Keeping the user interface responsive is the only way to keep end users in control of their experience with your application.

Coding defensively and simulating intermittent network failure should both be standard development practices. Because mobile devices move in and out of networks, the chance of intermittent network failure is much higher than on desktop or laptop computers. It is important that your application respond robustly to all communications failures. In cases of communications disruption, it is also important that your application properly release resources that it may have allocated during the communication attempt. It is very easy to inadvertently keep a socket connection or file open that will cause subsequent network access to fail. Instrumenting your code to throw intermittent test exceptions during communications tasks is a good way to test the robustness of your cleanup code and your application's ability to resiliently resume communications later.

There are many potential mechanisms for providing mobile applications with communications capabilities. These range from personal area networking technologies such as Bluetooth to the very wide area networks provided by mobile phone infrastructure. Wi-Fi is playing an increasingly important role as a provider of high-bandwidth communications in small-radius hot spots. In addition to these technologies, there are other less-glamorous but still very useful mechanisms to consider. Device-in-cradle network connections through a PC and Ethernet cable connectivity offer good network access capabilities. Memory cards that can be inserted into devices offer the ability to move large amounts of information by using a physical medium. Finally there is IrDA, which offers point-to-point communication between devices as well as communication to and through laptop computers. These communications mediums cover a wide range of possibilities, and none is superior for all tasks. It is important to think creatively about what your mobile application's communications needs are and how these can be achieved with simplicity, reliability, and convenience for the end user. Often a combination of the technologies listed above can be used to give the mobile application's users the flexibility to meet their communications needs.

Web services offer a useful way to interact with Internet- and intranet-based applications. By using standard XML, usually passed via HTTP or HTTPS protocols, Web services can allow your mobile application to take advantage of existing Web infrastructure to meet its communications needs. It is, however, important to realize that Web services offer useful abstractions but at the expense of incurring considerable overhead. XML is a verbose format, and it can take longer to push data around a network if the XML messages being passed are of considerable size. In addition, domain naming servers may need to be called to look up IP addresses, adding further overhead to your mobile application's communications. These challenges are by no means unique to mobile devices; but due to the fact that mobile network communication is usually slower and tends to be less robust than wired networking, these challenges need to be considered carefully. Other than in testing scenarios, Web service calls should always be made asynchronously to keep the application's user interface responsive. The number of separate Web service calls required to accomplish a task should be kept to a minimum because communications latencies on mobile networks can make chatty conversations expensive. Binary data such as image information should not be passed as XML; instead, Web services should return URLs to the data so that it can be downloaded as a binary file by the mobile device. Web services are very useful and will be increasingly used to connect different systems, but they must be used prudently to achieve good performance on mobile devices.

Mobile application communications provide a rich variety of options for software developers to choose from. Along with all these choices comes the responsibility of choosing the most appropriate options to meet your application users' needs and cost requirements. Extra thought must be given to designing failure-tolerant and user-tailored communications mechanisms that provide the right balance of automation and end-user control. Because of all of the communications possibilities available, significant innovation is possible in building better mobile applications. As with other areas of mobile device software design, the field is wide open and experimentation is the best way to come up new and innovative approaches to meet your mobile application's communications needs.


/ 159