You are previewing BlackBerry Java Application Development.
O'Reilly logo
BlackBerry Java Application Development

Book Description

Build and deploy powerful, useful, and professional Java mobile applications for BlackBerry smartphones, the fast and easy way.

  • Develop professional, rich, and smart Java applications using BlackBerry SDK

  • Discover the powerful components provided by the SDK to build a powerful user interface with a common look and feel

  • Explore the complex, but important, topic of network communications

  • Integrate with the standard applications on all BlackBerry Smartphone to make your application even more useful

  • Packed with hands-on examples and clear explanations for better understanding

  • In Detail

    BlackBerry Smartphone was once the domain of jet-setting business users with power suits. Now you can hardly go anywhere without seeing someone using a BlackBerry to check their messages or make a call. It's this kind of explosive growth that makes the BlackBerry ecosystem a great place to develop and market applications through the BlackBerry App World store—this book shows you how to do just that!

    This step-by-step guide gives you a hands-on experience of developing innovative Java applications for your BlackBerry. With the help of this book, you will learn to build your own applications to illustrate the platform, and the various capabilities that developers can use in their programs. It explores the powers of Blackberry and helps you develop professional and impressive Java applications.

    The book teaches how to write rich, interactive, and smart BlackBerry applications in Java. It expects the readers to know Java but not Java Mobile or the BlackBerry APIs. We will learn to build rich, interactive, and smart Java applications for the BlackBerry. The book will cover UI programming, data storage, programming network, and internet API apps. As we move on, we will learn more about the BlackBerry's device features, such as messaging, GPS, multimedia, contacts and calendar, and so on. This book also helps you build your own applications to illustrate the platform, and the various capabilities that developers can use in their programs.

    This step-by-step guide to building rich, interactive, and smart Java applications helps you get the most out of BlackBerry smartphones.

    Table of Contents

    1. BlackBerry Java Application Development
      1. BlackBerry Java Application Development
      2. Credits
      3. About the Author
      4. Acknowledgement
      5. About the Reviewers
      6. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Time for action - heading
          1. What just happened?
          2. Pop quiz - heading
          3. Have a go hero - heading
        6. Reader feedback
        7. Customer support
          1. Errata
          2. Piracy
          3. Questions
      7. 1. Introducing BlackBerry Application Development
        1. Expectations of this book
        2. General device capabilities
        3. Two different approaches to application development
        4. Choosing an SDK version
        5. What you can expect
        6. Summary
      8. 2. Installing the Development Environment
        1. System requirements
        2. Development Environments
          1. Downloading and installing Java
        3. Time for action - downloading the Java Development Kit
          1. What just happened?
        4. Time for action - installing the Java Development Kit (JDK)
          1. What just happened?
        5. Introducing the BlackBerry Developer Zone
          1. Downloading and installing Eclipse
        6. Time for action - downloading Eclipse with the JDE plugin
          1. What just happened?
        7. Time for action - installing the JDE plugin for Eclipse Full installer
          1. What just happened?
          2. Installing other JDE component package versions
        8. Time for action - installing other JDE component packages over-the-air
          1. What just happened?
          2. Have a go hero - installing other versions of the SDK
          3. Pop quiz
        9. Summary
      9. 3. Getting Familiar with the Development Environment
        1. Starting the Eclipse IDE
        2. Time for action - launching Eclipse for the first time
          1. What just happened?
        3. Importing the hello world project
        4. Time for action - importing the HelloWorldDemo sample application
          1. What just happened?
        5. Running the application
        6. Time for action - running an application in the simulator
          1. What just happened?
        7. Debugging the application
        8. Time for action - starting the debugger
          1. What just happened?
        9. Introducing Eclipse perspectives
        10. Time for action - changing the perspective
          1. What just happened?
          2. Getting some help!
        11. Time for action - displaying the Help
          1. What just happened?
          2. Pop quiz
          3. Have a go hero - advanced debugging tools
        12. Summary
      10. 4. Creating your First BlackBerry Project
        1. Choosing the SDK version
          1. Creating a new project
        2. Time for action - creating a new project
          1. What just happened?
          2. Adding a package to the new project
        3. Time for action - creating a new project
          1. What just happened?
        4. Start at the beginning
          1. Application and UiApplication
        5. Time for action - adding the UiApplication class
          1. What just happened?
          2. A closer look at the code
        6. Time for action - expanding TipCalcApplication
          1. What just happened?
          2. Pop quiz
          3. MainScreen
        7. Time for action - adding a MainScreen
          1. What just happened?
          2. Determining your screen requirements
        8. Time for action - expanding the TIpCalcMainScreen
          1. What just happened?
        9. Time for action - adding more to the MainScreen
          1. What just happened?
          2. Pop quiz
          3. Adding a menu to the application
        10. Time for action - adding a menu to the MainScreen
          1. What just happened?
          2. Pop quiz
          3. Setting the SDK version
        11. Time for action - selecting the right component package
          1. What just happened?
          2. Testing it out
        12. Time for action - running your new application
          1. What just happened?
        13. Giving TipCalc some polish
          1. Adding an icon to TipCalc
        14. Time for action - adding an icon
          1. What just happened?
        15. Time for action - changing the application title
          1. What just happened?
          2. Fixing the Bill Amount field
        16. Time for action - fixing the bill amount field
          1. What just happened?
          2. Disabling the save prompt
        17. Time for action - disabling the "save" dialog
          1. What just happened?
          2. Have a go hero - expanding TipCalc even more
        18. Summary
      11. 5. Learning the Basics About the UI
        1. Getting to know other Field classes
        2. SeparatorField
        3. Time for action - creating a SeparatorField
          1. What just happened?
        4. LabelField
        5. Time for action - creating a LabelField
          1. What just happened?
        6. BitmapField
        7. Time for action - creating a BitmapField
          1. What just happened?
          2. Pop quiz
        8. ChoiceField
          1. ObjectChoiceField
        9. Time for action - creating an ObjectChoiceField
          1. What just happened?
          2. NumericChoiceField
        10. Time for action - creating a NumericChoiceField
          1. What just happened?
        11. GaugeField
        12. Time for action - creating a GaugeField
          1. What just happened?
        13. DateField
        14. Time for action - creating a DateField
          1. What just happened?
          2. Pop quiz
        15. CheckboxField
        16. Time for action - creating a CheckboxField
          1. What just happened?
        17. RadioButtonField
        18. Time for action - creating a RadioButtonField
          1. What just happened?
          2. Pop quiz
        19. TextField
          1. BasicEditField
        20. Time for action - creating a BasicEditField
          1. What just happened?
          2. EditField
        21. Time for action - creating an EditField
          1. What just happened?
          2. PasswordEditField
        22. Time for action - creating a PasswordEditField
          1. What just happened?
          2. EmailAddressEditField
        23. Time for action - creating an EmailAddressField
          1. What just happened?
          2. AutoTextEditField
        24. Time for action - creating an AutoTextEditField
          1. What just happened?
          2. ActiveAutoTextEditField
        25. Time for action - creating an ActiveAutoTextEditField
          1. What just happened?
          2. Pop quiz
          3. RichTextField
        26. Time for action - creating a RichTextField
          1. What just happened?
          2. ActiveRichTextField
        27. Time for action - creating an ActiveRichTextField
          1. What just happened?
          2. Pop quiz
          3. Have a go hero - showing all fonts
        28. Summary
      12. 6. Going Deeper into the UI
        1. ButtonField
        2. Time for action - creating a ButtonField
          1. What just happened?
          2. ListField
        3. Time for action - creating a ListField
          1. What just happened?
        4. TreeField
        5. Time for action - creating a TreeField
          1. What just happened?
          2. Pop quiz
        6. MapField
        7. Time for action - creating a MapField
          1. What just happened?
        8. Displaying another screen
        9. Time for action - creating an "About Screen"
          1. What just happened?
          2. Pop quiz
        10. Displaying a dialog
        11. Time for action - collecting information with a common dialog
          1. What just happened?
        12. Time for action - collecting information with custom buttons on a dialog
          1. What just happened?
        13. Time for action - collecting information with a list on a dialog
          1. What just happened?
          2. Pop quiz
        14. Listeners and callbacks
        15. Layout managers
          1. Special considerations for touchscreens
          2. TouchEvents and TouchGestures
          3. Have a go hero - Adding another Listener to the FieldSampler
        16. Summary
      13. 7. Storing Data
        1. Laying the ground work
        2. Creating a data class
        3. The Java way: RMS
        4. Time for action - creating and opening a RecordStore
          1. What just happened?
        5. Time for action - adding a record
          1. What just happened?
        6. Time for action - retrieving records
          1. What just happened?
        7. Time for action - deleting records
          1. What just happened?
          2. Pop quiz
        8. The BlackBerry way: Persistent Store
        9. PersistentStore and PersistentObject
        10. Time for action - preparing the JournalEntry class
          1. What just happened?
        11. Time for action - getting a PersistentObject
          1. What just happened?
        12. Time for action - accessing the PersistentObject data
          1. What just happened?
        13. Time for action - accessing the PersistentObject data
          1. What just happened?
          2. Pop quiz
        14. Accessing removable storage
          1. Connector and FileConnection
        15. Time for action - storing data to a file
          1. What just happened?
        16. Time for action - reading data from a file
          1. What just happened?
          2. Pop quiz
          3. Have a go hero - allowing the user to specify the filename
        17. Summary
      14. 8. Interfacing with Applications
        1. Introducing PIM
          1. Why is all so generic?
            1. PIMLists
            2. PIMItems
        2. Laying the ground work
        3. Time for action - creating test contacts
          1. What just happened?
        4. Expanding your test contacts
        5. Time for action - adding telephone numbers
          1. What just happened?
        6. Expanding even more
        7. Time for action - adding e-mail addresses
          1. What just happened?
        8. Finishing the test contacts
        9. Time for action - adding e-mail addresses
          1. What just happened?
          2. Pop quiz
        10. Embedding the address book into your application
        11. Time for action - embedding the address book
          1. What just happened?
        12. Adding the event to your calendar
        13. Time for action - adding an event to the calendar
          1. What just happened?
        14. Recurring events
          1. Pop quiz
        15. Sending e-mail
        16. Time for action - sending an e-mail from an application
          1. What just happened?
          2. Pop quiz
          3. Have a go hero - sending a different kind of message
        17. Summary
      15. 9. Networking
        1. Threading
        2. Connector class
        3. HTTP basics
          1. HTTP GET requests
        4. Time for action - ‑ HTTP Basics
          1. What just happened?
          2. Pop quiz
          3. Have a go hero - but what if it didn't work?
          4. HTTP POST requests
        5. Time for action - calling a web service
          1. What just happened?
          2. Pop quiz
        6. Time for action - parsing the response
          1. What just happened?
        7. The transport—so many possibilities
          1. Direct TCP/IP
          2. MDS/BES
          3. BIS-B
          4. Wi-Fi
          5. WAP
            1. WAP 1.X
          6. WAP 2.0
        8. Debugging with the MDS simulator
        9. Testing for availability of transports
        10. Time for action - testing for availability
          1. What just happened?
        11. Moving beyond HTTP connections
          1. Pop quiz
        12. Summary
      16. 10. Advanced Topics
        1. Introducing the Global Positioning System
          1. The LocationProvider class
            1. Criteria
            2. Three ways to get GPS data
            3. Bringing it all together
          2. Getting coordinates
        2. Time for action - acquiring a location
          1. What just happened?
          2. Expanding Hansel
        3. Time for action - expanding Hansel
          1. What just happened?
          2. Pop quiz
        4. Alternate entry points
          1. Creating a focus icon
        5. Time for action - creating an alternate entry point project
          1. What just happened?
        6. Time for action - adding a focus icon to Hansel
          1. What just happened?
          2. Pop quiz
          3. Have a go hero - allowing the user to specify the filename
        7. Summary
      17. 11. Wrapping It All Up
        1. Using resources for localization
        2. Time for action - adding a resource file
          1. What just happened?
        3. Resource bundles
        4. Time for action - adding a second resource file
          1. What just happened?
        5. Time for action - populating a resource file and configuring the project
          1. What just happened?
        6. Time for action - using a resource in your code
          1. What just happened?
          2. Pop quiz
        7. Code signing your application
        8. Time for action - configuring projects to allow access
          1. What just happened?
        9. Time for action - installing the code-signing keys
          1. What just happened?
        10. Time for action - code-signing the application
          1. What just happened?
        11. Distributing your application through BlackBerry App World
          1. Licensing models
          2. Submitting an application
        12. Summary
      18. A. Pop Quiz Answers
        1. Chapter 2
        2. Chapter 3
        3. Chapter 4
          1. Pop Quiz 1
          2. Pop Quiz 2
          3. Pop Quiz 3
        4. Chapter 5
          1. Pop Quiz 1
          2. Pop Quiz 2
          3. Pop Quiz 3
          4. Pop Quiz 4
          5. Pop Quiz 5
        5. Chapter 6
          1. Pop Quiz 1
          2. Pop Quiz 2
          3. Pop Quiz 3
        6. Chapter 7
          1. Pop Quiz 1
          2. Pop Quiz 2
          3. Pop Quiz 3
        7. Chapter 8
          1. Pop Quiz 1
          2. Pop Quiz 2
          3. Pop Quiz 3
        8. Chapter 9
          1. Pop Quiz 1
          2. Pop Quiz 2
          3. Pop Quiz 3
        9. Chapter 10
          1. Pop Quiz 1
          2. Pop Quiz 2
        10. Chapter 11