ebook img

Beginning Nokia Apps Development: Qt and HTML5 for Symbian and MeeGo PDF

250 Pages·2010·7.65 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Beginning Nokia Apps Development: Qt and HTML5 for Symbian and MeeGo

eBook Available Qt and HTML5 for Symbian and MeeGo Beginning Nokia Apps Development Ray Rischpater | Daniel Zucker Beginning Nokia Apps Development Qt and HTML5 for Symbian and MeeGo ■ ■ ■ Ray Rischpater Daniel Zucker i Beginning Nokia Apps Development: Qt and HTML5 for Symbian and MeeGo Copyright © 2010 by Ray Rischpater, Daniel Zucker All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-3177-6 ISBN-13 (electronic): 978-1-4302-3179-0 Printed and bound in the United States of America (POD) Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Steve Anglin Technical Reviewers: Nicholas Foo, Balagopal K.S., Daniel Rocha, Jakl Andreas, Petro Soininen and Wai M. Seto Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Adam Heath Copy Editor: Mark Watanabe Compositor: MacPS, LLC Indexer: BIM Indexing & Proofreading Services Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. For information on translations, please e-mail [email protected], or visit www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at www.apress.com. ii This book is dedicated to my children, Eli and Annie; my parents, Donald and Dorothy; and my wonderful wife, MB; without any one of whom this book would not be possible. —Dan There is an irony in dedicating any book to my family, when time after time they patiently wait for me to put down the laptop and put away the manuscript, but there it is: this book is for Meg and Jarod. —Ray iii Contents at a Glance ■Contents .......................................................................................................... v ■Foreword ........................................................................................................ ix ■About the Authors ........................................................................................... x ■About the Technical Reviewers ...................................................................... xi ■Acknowledgments ......................................................................................... xii ■Introduction .................................................................................................. xiII Part I: Design ...................................................................................................... 1(cid:1) ■Chapter 1: Introducing Nokia’s Software Platform ......................................... 3(cid:1) ■Chapter 2: Designing Your Application .......................................................... 11(cid:1) Part II: Develop ................................................................................................. 37(cid:1) ■Chapter 3: Working with the Nokia Qt SDK ................................................... 39(cid:1) ■Chapter 4: Beginning Qt Development ........................................................... 59(cid:1) ■Chapter 5: Doing More with Qt ...................................................................... 87(cid:1) ■Chapter 6: Introducing Qt Quick .................................................................. 139(cid:1) ■Chapter 7: Developing with HTML5 ............................................................. 159(cid:1) Part III: Distribute ........................................................................................... 185(cid:1) ■Chapter 8: Testing Your Application ............................................................ 187(cid:1) ■Chapter 9: Deploying Your Application ........................................................ 199(cid:1) ■Index ............................................................................................................ 215 iv Contents ■Contents at a Glance ....................................................................................... iv(cid:1) ■Foreword ........................................................................................................ ix(cid:1) ■About the Authors ........................................................................................... x(cid:1) ■About the Technical Reviewers ...................................................................... xi(cid:1) ■Acknowledgments ......................................................................................... xii(cid:1) ■Introduction .................................................................................................. xiii(cid:1) Part I: Design ...................................................................................................... 1(cid:1) ■Chapter 1: Introducing Nokia’s Software Platform ......................................... 3(cid:1) Why Nokia? ............................................................................................................................................................. 3(cid:1) Introducing Nokia’s Hardware Platforms ................................................................................................................ 4(cid:1) Series 40 ............................................................................................................................................................ 4(cid:1) Symbian ............................................................................................................................................................. 4(cid:1) MeeGo ................................................................................................................................................................ 5(cid:1) Choosing a Development Platform .......................................................................................................................... 5(cid:1) Qt ....................................................................................................................................................................... 6(cid:1) HTML5 ................................................................................................................................................................ 7(cid:1) Hybrid Applications ............................................................................................................................................ 8(cid:1) Distributing Your Application .................................................................................................................................. 8(cid:1) Wrapping Up ........................................................................................................................................................... 9(cid:1) ■Chapter 2: Designing Your Application .......................................................... 11(cid:1) Designing for Mobile ............................................................................................................................................. 11(cid:1) User Context .................................................................................................................................................... 12(cid:1) Mobile Interaction Considerations ................................................................................................................... 12(cid:1) Technical Considerations ................................................................................................................................. 13(cid:1) Cultural Considerations .................................................................................................................................... 14(cid:1) The Design Process .............................................................................................................................................. 15(cid:1) Getting Started ................................................................................................................................................. 15(cid:1) Design Research .............................................................................................................................................. 16(cid:1) v ■ CONTENTS Conceptual Design ........................................................................................................................................... 17(cid:1) Interaction Design and Prototyping .................................................................................................................. 17(cid:1) Documentation ................................................................................................................................................. 18(cid:1) Flowella ........................................................................................................................................................... 20(cid:1) Visual and Information Design ......................................................................................................................... 27(cid:1) Testing and Evaluation ..................................................................................................................................... 30(cid:1) Additional Topics: Gestalt and Unity ............................................................................................................... 31(cid:1) Usability Guidelines ............................................................................................................................................... 32(cid:1) Navigation ........................................................................................................................................................ 32(cid:1) Entering Information ........................................................................................................................................ 33(cid:1) Information Presentation ................................................................................................................................. 34(cid:1) Connectivity ..................................................................................................................................................... 34(cid:1) Usability for Enterprise Applications ................................................................................................................ 34(cid:1) Usability and Security ...................................................................................................................................... 34(cid:1) Advertising ....................................................................................................................................................... 35(cid:1) Platform Components ...................................................................................................................................... 35(cid:1) Checklists ............................................................................................................................................................. 35(cid:1) Summary .............................................................................................................................................................. 36(cid:1) Part II: Develop ................................................................................................. 37(cid:1) ■Chapter 3: Working with the Nokia Qt SDK ................................................... 39(cid:1) Choosing an IDE .................................................................................................................................................... 39(cid:1) Introducing the Nokia Qt SDK .......................................................................................................................... 39(cid:1) Getting Started with the Nokia Qt SDK .................................................................................................................. 41(cid:1) Installing the Nokia Qt SDK .............................................................................................................................. 41(cid:1) Finding Your Way around the Nokia Qt SDK .................................................................................................... 44(cid:1) Creating a Qt Application ................................................................................................................................. 45(cid:1) Compiling and Running Your Code on a Device ............................................................................................... 52(cid:1) Debugging Your Application .................................................................................................................................. 54(cid:1) Wrapping Up ......................................................................................................................................................... 57(cid:1) ■Chapter 4: Beginning Qt Development ........................................................... 59(cid:1) Understanding the Qt Object Model ...................................................................................................................... 59(cid:1) Understanding Signals and Slots ..................................................................................................................... 60(cid:1) Making the Most of Hierarchical Ownership .................................................................................................... 61(cid:1) Defining Object Properties ............................................................................................................................... 62(cid:1) Casting at Run Time ......................................................................................................................................... 63(cid:1) Managing Resources and Localization ............................................................................................................ 63(cid:1) Understanding Qt’s Collection Classes ............................................................................................................ 65(cid:1) Using Signals and Slots ........................................................................................................................................ 66(cid:1) Performing Input and Output ................................................................................................................................ 68(cid:1) Managing Multiple Threads .................................................................................................................................. 69(cid:1) Using Item Views with the Model-View-Controller Paradigm ............................................................................... 71(cid:1) Understanding Qt’s Model Classes .................................................................................................................. 72(cid:1) Using Qt’s View Classes ................................................................................................................................... 75(cid:1) Putting It All Together ........................................................................................................................................... 76(cid:1) Implementing the Application User Interface .................................................................................................. 77(cid:1) Using the Network to Obtain Data .................................................................................................................... 80(cid:1) Parsing the USGS Data Feed ............................................................................................................................ 81(cid:1) vi ■ CONTENTS Displaying the Results ..................................................................................................................................... 85(cid:1) Wrapping Up ......................................................................................................................................................... 86(cid:1) ■Chapter 5: Doing More with Qt ...................................................................... 87(cid:1) Using Application Resources ................................................................................................................................ 87(cid:1) Including Resources in Your Applications ........................................................................................................ 88(cid:1) Accessing Application Resources .................................................................................................................... 89(cid:1) Incorporating User Actions ................................................................................................................................... 89(cid:1) Introducing the Qt Main Window ..................................................................................................................... 90(cid:1) Attaching Actions to the Main Window ............................................................................................................ 92(cid:1) Implementing a Custom Widget ............................................................................................................................ 92(cid:1) Subclassing QWidget ....................................................................................................................................... 93(cid:1) Specifying Your Widget’s Size Hints and Policies ............................................................................................ 94(cid:1) Handling Incoming Events ............................................................................................................................... 95(cid:1) Handling Incoming Gestures ............................................................................................................................ 97(cid:1) Painting Your Widget’s Contents ...................................................................................................................... 99(cid:1) Integrating Qt Objects with Web Content ............................................................................................................ 101(cid:1) Linking Your Application with QtWebKit ........................................................................................................ 102(cid:1) Displaying Web Content with QtWebKit ......................................................................................................... 102(cid:1) Embedding C++ Objects in QtWebKit’s JavaScript Runtime ......................................................................... 104(cid:1) Embedding Qt Widgets into QtWebKit Pages ................................................................................................. 106(cid:1) Extending Application Functionality with Qt Mobility .......................................................................................... 107(cid:1) Using the Qt Mobility APIs .............................................................................................................................. 109(cid:1) Managing Bearer Networks ........................................................................................................................... 112(cid:1) Obtaining and Working with Device Location Information ............................................................................. 113(cid:1) Sending and Receiving Messages ................................................................................................................. 115(cid:1) Playing and Recording Multimedia ................................................................................................................ 118(cid:1) Obtaining System Information ....................................................................................................................... 121(cid:1) Putting It All Together ......................................................................................................................................... 122(cid:1) Looking inside the Application Controller ...................................................................................................... 124(cid:1) Changes to the Network Request .................................................................................................................. 128(cid:1) Determining the Device Position .................................................................................................................... 129(cid:1) Drawing the Map ........................................................................................................................................... 131(cid:1) Wrapping Up ....................................................................................................................................................... 137(cid:1) ■Chapter 6: Introducing Qt Quick .................................................................. 139(cid:1) Declaring Your User Interface ............................................................................................................................. 139(cid:1) Introducing QML ............................................................................................................................................. 141(cid:1) Handling Signals in QML ................................................................................................................................ 143(cid:1) Performing Animations in QML ...................................................................................................................... 145(cid:1) Reviewing the Available Qt Quick Elements .................................................................................................. 146(cid:1) Programming for the Web with QML ................................................................................................................... 149(cid:1) Creating the User Interface ............................................................................................................................ 151(cid:1) Downloading the Data .................................................................................................................................... 154(cid:1) Integrating C++ with QML .................................................................................................................................. 154(cid:1) Displaying QML within a C++ Application ..................................................................................................... 155(cid:1) Mingling QObjects with QML .......................................................................................................................... 155(cid:1) Wrapping Up ....................................................................................................................................................... 158(cid:1) vii ■ CONTENTS ■Chapter 7: Developing with HTML5 ............................................................. 159(cid:1) HTML5 Is an Industry Standard ........................................................................................................................... 160(cid:1) Hello World in HTML5 .......................................................................................................................................... 160(cid:1) Hello World on a Handset ............................................................................................................................... 162(cid:1) Using the HTML5 Application Cache .............................................................................................................. 163(cid:1) Hybrid Apps ......................................................................................................................................................... 165(cid:1) Accessing Your HTML5 Content from the Local File System ......................................................................... 165(cid:1) Storing the HTML5 Content as an Application Resource ............................................................................... 166(cid:1) More HTML5 Features ......................................................................................................................................... 167(cid:1) Canvas ........................................................................................................................................................... 167(cid:1) Transitions and Transformations ................................................................................................................... 172(cid:1) Local Storage ................................................................................................................................................. 174(cid:1) Putting It All Together: Implementing Shake in HTML5 ..................................................................................... 176(cid:1) Adding UI Components to the Views .............................................................................................................. 180(cid:1) Fetching and Parsing the Data ....................................................................................................................... 182(cid:1) Packaging the App ......................................................................................................................................... 183(cid:1) Links for further information ............................................................................................................................... 183(cid:1) Wrapping Up ....................................................................................................................................................... 184(cid:1) Part III: Distribute ........................................................................................... 185(cid:1) ■Chapter 8: Testing Your Application ............................................................ 187(cid:1) Preparing to Test ................................................................................................................................................ 187(cid:1) Using Qt’s Test Framework ................................................................................................................................. 189(cid:1) Introducing the QTest Test Framework .......................................................................................................... 190(cid:1) Unit Testing the QuakeEvent Class .............................................................................................................. 192(cid:1) Testing Signals and Slots Using QTest .......................................................................................................... 195(cid:1) Testing User Interface Code Using QTestEventList ................................................................................... 196(cid:1) Wrapping Up ....................................................................................................................................................... 198(cid:1) ■Chapter 9: Deploying Your Application ........................................................ 199(cid:1) Preparing a Deployment Checklist ...................................................................................................................... 199(cid:1) Packaging Your Application ................................................................................................................................ 200(cid:1) Including Other Files within Your Application on Symbian Devices ............................................................... 200(cid:1) Including Other Files within Your Application on MeeGo Devices .................................................................. 201(cid:1) Including an Application Icon with Symbian Applications ............................................................................. 202(cid:1) Including an Application Icon with MeeGo Applications ................................................................................ 202(cid:1) Providing a UID for Qt Applications on Symbian ............................................................................................ 203(cid:1) Providing a Desktop File for MeeGo ............................................................................................................... 204(cid:1) Putting It All Together .................................................................................................................................... 204(cid:1) Signing Your Qt Application for Symbian Devices .............................................................................................. 205(cid:1) Publishing with the Ovi Store .............................................................................................................................. 207(cid:1) Registering with the Ovi Store ....................................................................................................................... 207(cid:1) Publishing Your Application ........................................................................................................................... 208(cid:1) QA in the Ovi Store ......................................................................................................................................... 210(cid:1) Marketing Your Application through the Ovi Store .............................................................................................. 211(cid:1) Wrapping Up ....................................................................................................................................................... 213(cid:1) ■Index ............................................................................................................ 215 viii

Description:
While media buzz regularly circulates around iPhone and Android, Nokia still leads the pack in terms of world market share. Symbian, for instance, remains the most widely used mobile operating system. With Nokia's open development platform, the opportunities available for mobile developers to target
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.