Lively for Qt: a Platform for Mobile Web Applications
Total Page:16
File Type:pdf, Size:1020Kb
Lively for Qt: A Platform for Mobile Web Applications Tommi Mikkonen Antero Taivalsaari Mikko Terho Tampere University of Technology Sun Microsystems Laboratories Nokia Devices Korkeakoulunkatu 1 P.O. Box 553 (TUT) Visiokatu 3 FI-33720 Tampere, FINLAND FI-33101 Tampere, FINLAND FI-33720 Tampere, FINLAND [email protected] [email protected] [email protected] ABSTRACT variations, it is safe to assume that it will eventually be possible to The convergence of desktop, mobile and web application use the same web applications and services in desktop computers development has resulted in new types of software systems. These and mobile devices. new systems are built to leverage the World Wide Web, and they Given that JavaScript programming language support is included allow the use of dynamically downloaded applications and in every commercial web browser, JavaScript [5] has rapidly services from any type of terminal, including desktop computers become the de facto programming language of the Web. Although and mobile devices. At the same time, the JavaScript language has JavaScript was originally designed as a scripting language – a become the de facto programming language of the Web. In this language targeted to relatively simple scripting tasks – its use has paper we introduce Lively for Qt – a practical JavaScript rapidly spread to “real” programming tasks, serious application application platform that supports the development of highly development and even systems programming. These days, it is not interactive mobile web applications and mashups that run both in uncommon to see JavaScript applications that consist of tens of the web browser and as standalone “phonetop” applications. thousands of lines of code. Additionally, we present our vision for mobile web applications, as well as summarize the experiences and lessons learned during This paper introduces Lively for Qt (http://lively.cs.tut.fi/qt) – a the development of the new system. practical JavaScript application platform that supports the development of compelling, highly interactive mobile web applications and mashups that run both in the web browser and as Categories and Subject Descriptors standalone “phonetop” applications. The system runs on top of Qt D.2.2 [Software Engineering]: Design Tools and Techniques – (http://www.qtsoftware.com/) – a cross-platform application modules and interfaces, software libraries, user interfaces. D.2.6 framework that was recently acquired by Nokia. Versions of the [Software Engineering]: Programming Environments – Qt framework have already been announced for Nokia's device graphical environments, integrated environments, interactive platforms. environments. In addition, we present our vision for mobile web applications, as well as briefly summarize the experiences and lessons learned General Terms during the development of the Lively for Qt system. The work Design, Experimentation, Languages. builds upon our earlier experiences in developing the Sun Labs Lively Kernel (http://research.sun.com/projects/lively) [7, 13] – a Keywords “zero-installation” web application platform that runs in the Web applications, mobile software, Lively for Qt. standard web browser without any installation or plug-in components. The key idea in creating the Lively Kernel was to implement a highly interactive application development 1.INTRODUCTION environment, which – from the end user's viewpoint – is just a The convergence of desktop, mobile and web application web page. Our earlier efforts on porting the Lively Kernel to development has resulted in new types of software systems and mobile devices have been presented in [9]. runtime environments. These new systems are built to leverage the World Wide Web, and they allow applications and other content The Lively for Qt system introduced in this paper is the logical to be downloaded dynamically from the Web. Applications successor of the Sun Labs Lively Kernel in that it implements a commonly run in the web browser and do not necessarily require JavaScript application environment that is capable of hosting Rich any explicit installation. Furthermore, these new systems enable Internet Applications that are fully interactive and malleable; in the use of applications and services from any type of terminal, short, lively. However, a key difference between the two systems including desktop computers and mobile devices. Despite the is that in Lively for Qt we leverage an existing, rich, mature, well- problems that arise from CPU speed differences, memory capacity documented application framework as the basis of the system. In differences, network bandwidth limitations and screen size the Lively Kernel, the development APIs offered by the Permission to make digital or hard copies of all or part of this work for underlying platform (the web browser) were far more limited. personal or classroom use is granted without fee provided that copies Another important difference is the increased focus on mobile are not made or distributed for profit or commercial advantage and that devices. Although the Lively for Qt system can run on a wide copies bear this notice and the full citation on the first page. To copy variety of target platforms, including conventional desktop otherwise, or republish, to post on servers or to redistribute to lists, computers, our goal is to build a practical web application and requires prior specific permission and/or a fee. mashup environment specifically for mobile devices. Mobility 2009, Sep 2-4, Nice, France Copyright © 2009 ACM 978-1-60558-536-9/00/0009……$5.00 The structure of this paper is as follows. Section 2 introduces our 2. Take JavaScript, the world's most widely used dynamic vision for mobile web applications, and provides background and language, and make the graphics APIs available to it; use a general motivation for the rest of the paper. Section 3 provides an modern, high-performance JavaScript virtual machine, so that overview of the Qt application framework, and then introduces the there will be enough power for serious applications. Lively for Qt system. Section 4 introduces some sample 3. Make it easy to access the Web from the platform using applications and discusses the development style associated with them. Sections 5 and 6 discuss related work and revisit the vision asynchronous HTTP networking and other commonly used networking standards; provide JavaScript APIs for processing presented in Section 2 in order to summarize the experiences and lessons learned in the scope of the vision. Finally, Section 7 XML, JSON (JavaScript Object Notation), DOM and other frequently used formats and structures easily. concludes the paper. 4. Add support for mobile-specific JavaScript APIs for areas such 2.A PLATFORM FOR MOBILE WEB as wireless messaging, location, Bluetooth and camera support. Such APIs are familiar, e.g., from the Java ME™ Mobile APPLICATIONS: THE VISION Service Architecture (MSA) Specification [8]. The authors of this paper have considerable experience in designing and building practical application platforms for mobile 5. Make the platform available both inside the web browser and devices. The first author was closely involved in the introduction natively. All the applications should be able to run both inside of the Symbian platform for Nokia devices. The second author the web browser and as “phonetop” applications that behave was the original designer behind the Java ME platform [12] at like native applications. Sun Microsystems. The third author was the co-lead of the 6. Add a fine-grained security model so that network-downloaded original Nokia Communicator project – the very first smartphone applications can be executed safely; provide minimal access to in the world. APIs for those applications that are downloaded from We believe that next-generation mobile application platforms will untrusted sources, and more extensive access to APIs for be built to leverage the Web from the very beginning. Unlike the applications from trusted sources. earlier mobile application platforms, in which applications were Although our vision above revolves heavily around web delivered mainly in binary (native) form, in the future applications technologies, we believe that the development style used in the will be downloaded dynamically and used without explicit new platform should not be based purely on declarative web installation. Applications can be deployed instantly worldwide. technologies such as HTML or CSS. Rather, there is a need for Ideally, applications should simply run in the web browser, or a procedural development style and programmatic APIs as well. similar web client environment that has been specifically tailored Currently, the JavaScript APIs offered by the web browser are still for mobile devices; the applications should be fully compatible extremely limited compared to APIs offered by mature software with full-fledged web applications running in desktop web platforms such as Microsoft Windows or MacOS X. The APIs are browsers. also very limited compared with the APIs of mature mobile Unfortunately, there are still major obstacles in creating a software platforms such as the Symbian OS or the Java ME platform that realizes the “One Web” objective advocated by the platform. The need for rich, mature, well-documented APIs World Wide Web Consortium [10]. Even though it is fairly safe to supporting a procedural programming style is largely why we assume that eventually the same web applications and services have chosen the Qt framework as