• Save
02 BlackBerry Application Development
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

02 BlackBerry Application Development

  • 1,448 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,448
On Slideshare
1,447
From Embeds
1
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 1

https://www.linkedin.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Half Day Short Course onBeginning BlackBerry Application Development Arief Hamdani Gunawan Bandung, 18 Januari 2012, 13.00 – 17.00
  • 2. Agenda IntroductionDevelopment Environment Simulator Hello World Publishing and commercializing
  • 3. Agenda IntroductionDevelopment Environment Simulator Hello World Publishing and commercializing
  • 4. Introduction• The advent and growing popularity of BlackBerry smartphones has changed how corporate users communicate whenever away from their offices. No longer tied to their landline phones, no longer glued to their desktop PCs, corporate users could stay in touch via voice and e-mail as long as cellphone reception was available.• Then, Research In Motion (RIM) upped the ante: Independent software developers were allowed to create software to run on BlackBerry smartphones. Developers familiar with Java (the BlackBerry uses the Java programming language) could leverage that knowledge to create BlackBerry apps. This opened the BlackBerry smartphone to the creative power of developers all across the world.
  • 5. Introduction• Since Research In Motion (RIM) launched the first models almost a decade ago, the BlackBerry smartphone has gone from relative obscurity to near universal visibility—think about how commonplace it has become to see people in airports, hotels, offices, or just about anywhere stealing a few minutes to check their e-mail or type replies.• The BlackBerry software development kit (SDK) has been around since the first devices were released and has grown to include an extensive collection of examples and documentation, and a mature set of APIs and tools that have opened the door for all kinds of great applications, most of which only currently exist in someone’s imagination.• In April 2009, RIM went one step further: The BlackBerry App World was introduced, offering developers a place to market, advertise, and sell their applications to all BlackBerry users.• And with the maturing of the BlackBerry community and the introduction of BlackBerry App World, it’s easier than ever to get your application noticed and downloaded by users worldwide.
  • 6. BlackBerry as a great development opportunity This makes them easy to develop and ✓ BlackBerry maintain, and they don’t require a large applications tend to development team: You need fewer people be small. to debate the pros and cons of different ways to do the same thing. ✓ BlackBerry apps narrowly focus on The apps are simple and direct, providing the delivering what the user with only the information they want — user wants, and no and the tools to get it. more. ✓ BlackBerry apps You can leverage any desktop PC Java use Java. programming experience you have.
  • 7. BlackBerry as a great development opportunity ✓ The tools and simulators are all The simulators all execute the same code as the actual devices, so you can be sure free. You can do all that if your app works on a simulator, it will work on a real device. your development on a Windows PC. ✓ The BlackBerry is widely used in From CEOs to administrative assistants and everyone in between, you have a market corporate for business-specific apps that could link everyone in the enterprise. enterprises. ✓ RIM provides the This venue removes the responsibility of credit card handling, hosting, downloading, BlackBerry App and notifying users of updates. The App World comes with a variety of pricing tiers, World for you to including free and Try & Buy. RIM keeps 20 percent of your application price to cover some of its costs. Submitting your app to the App World incurs a $20 fee per showcase and sell submission, which you can buy in blocks of ten for $200. your app.
  • 8. Independent Software Vendor• RIM does offer higher-level paid Independent Software Vendor (ISV) programs with additional support and other benefits, but you can develop and distribute applications with the free account.• We recommend this to enterprise developers who have support Service Level Agreement (SLA) with clients, because if there is a support issue around a certain BlackBerry API, your ISV technical representative will then be able to answer your inquiries and/or provide workarounds for your problem.• For more information, see https://partners.blackberry.com
  • 9. https://partners.blackberry.com
  • 10. Introduction One important thing to do:We should learn immediatelyhow to develop an application from concept to completion, from coding to uploading it to the BlackBerry App World to sell it to BlackBerry users.
  • 11. Agenda IntroductionDevelopment Environment Simulator Hello World Publishing and commercializing
  • 12. BlackBerry and Java• BlackBerry applications are written in Java Micro Edition (Java ME), formerly called J2ME. This is a subset of Java Standard Edition (Java SE) that most Java developers work with. – If you’re familiar with Java SE or Java Enterprise Edition (Java EE), Java ME will be very easy to pick up. – If you’re familiar with another object-oriented language—especially one with a similar syntax, such as C#, C++, or even Objective-C—you should similarly have no problem picking things up. C# developers in particular should be able to understand Java ME code with little or no effort.• One of the nice things about Java ME and the BlackBerry from the perspective of a beginner is that the API is small compared to desktop or server programming environments—you can learn a great deal of it fairly quickly. – Of course, this is a double-edged sword; there will be times when you wish the API provided some functionality that bigger environments do, though the BlackBerry API is getting more functionality all the time.
  • 13. How users navigate and use their BlackBerry• Understanding how users navigate and use their BlackBerry smartphones: – Most users get most of what they need from a BlackBerry application by using just one hand, and often, just by using their thumbs on the trackpad (or trackwheel/trackball for older devices). – The primary input mechanism for a BlackBerry is the pointing device, which can take one of several forms, depending on which model BlackBerry your user has.
  • 14. from Trackwheel to Trackball
  • 15. from Trackpad to Touchscreen
  • 16. Device Released and SDK VersionChoosing an SDK version• Before we dive into developing an application we must choose the SDK version to work with.• In most environments, this choice is very simple—just choose the most recent version and use that one.• Unfortunately, things are not as simple for BlackBerry handhelds.• In fact, its the opposite.
  • 17. Device Released and SDK Version
  • 18. Device Released and SDK Version• There is a correlation between the handheld Operating System (OS) version and the SDK version.• Each time a new version of the device OS is released, a new version of the SDK is released to go along with it.• As new devices are released and more capabilities are added to them, the OS must grow to take advantage of the new capabilities.• Similarly, the SDK must also grow. It makes sense that SDK version 4.2 wont be able to utilize features added in OS version 4.5.• The downside to this is that applications written using version 4.5 of the SDK wont run on handhelds with a version 4.2 OS, but the opposite is true.• Applications written using 4.2 will run just fine on a handheld running version 4.5 of the OS.
  • 19. Eclipse• For the majority of the applications that we will make we will be using SDK version 4.5 simply because this is the version that comes bundled with Eclipse.• The Java Development Environment (JDE) has been around longer and is a bit more mature, but almost everything possible with the JDE can also be accomplished with the Eclipse plug-in.• The Eclipse plug-in leverages the entire Eclipse development platform, which includes a world-class source code editor and a lot of third-party plug-ins.• Ultimately, the choice is a matter of personal preference.• Although we have used JDE since the very beginning days of BlackBerry development and it has come a long way, the developer- friendly features of Eclipse IDE with the new updates to the BlackBerry JDE Plug-in for Eclipse make the latter a natural choice for BlackBerry development.
  • 20. Eclipse• Before you start development for BlackBerry, you will need to first decide what BlackBerry operating system (OS) version your application will support, which then will determine what Eclipse JDE plug-in component pack you will need to build your application.• Each version of the component pack for the Eclipse plug-in corresponds to a major version of the BlackBerry OS.• BlackBerry does a good job of keeping its OS backward compatible, so something developed for OS 5.0 generally will work the same on OS 6.0 and higher.• However, you may want to use some features that are only available on a later OS. A safe minimum is 5.0, which covers majority of the BlackBerry devices on the market and is supported by BlackBerry App World.
  • 21. Eclipse• RIM offers a plug-in for the Eclipse development environment.• Eclipse is an open source (free) Java development environment you can download from www.eclipse.org.• If you’re comfortable using Eclipse, you should definitely investigate RIM’s plug-in.• As of this course, the current version of BlackBerry Java Plug-in for Eclipse is 1.5, and makes use of the BlackBerry OS 7.0 APIs.• Information about the RIM Eclipse plugin can be found at http://na.blackberry.com/eng/developers/devbetasoftware /javaplugin.jsp
  • 22. http://www.eclipse.org/
  • 23. http://us.blackberry.com/developers/javaappdev/javaplugin.jsp
  • 24. Java SE SDK• Before installing the BlackBerry development tools, you’ll need to install the Java SE JDK from http://www.oracle.com/technetwork/java/index. html.• For most developers, downloading Java SE JDK v6.0 is a good choice—it will let you develop for BlackBerry Device Software version 4.5 and later, which covers majority of BlackBerry smartphones on the market.
  • 25. http://www.oracle.com/technetwork/java/index.html
  • 26. Approaches to developing applications for BlackBerry handhelds• There are two recommended approaches to developing applications for BlackBerry handhelds – Java Application Development – BlackBerry Web Development.
  • 27. Java Application Development• This is the most powerful approach and it creates applications written in Java that are loaded onto and executed on a BlackBerry handheld.• They will be the focus of this book and are one of the most common ways to deploy an application.• Two different tools exist to support this approach—the BlackBerry Java Development Environment (JDE) and the BlackBerry JDE Component Plug-in for Eclipse.• Both offer the ability to create full custom applications.• The BlackBerry JDE is a custom application written in Java that can be used to develop applications.• The latter leverages the Eclipse Integrated Development Environment (IDE), which is a common platform for Java developers.
  • 28. BlackBerry Web Development• It is the other approach that runs completely within the BlackBerry Browser application and can use various standards such as HTML and AJAX.• Applications created using the BlackBerry Web Development approach are similar to more common web applications and generally require network connectivity to work.• More powerful features, including native API calls, arent allowed natively but can be made using BlackBerry Widgets.• BlackBerry Widgets is a separate SDK for creating small applets that can be leveraged by web applications.• Overall, this approach can be powerful but it requires network connectivity, which potentially means data charges and/or delays for network communication.
  • 29. BlackBerry SDK 7.0• To use Eclipse to develop for BlackBerry, you’ll need to download Eclipse IDE.• However, to make things simple for you, RIM has bundled Eclipse 3.6 (Helios) with the BlackBerry JDE Plug-in with BlackBerry SDK 7.0.• You can download the BlackBerry Java Plug-in for Eclipse at http://us.blackberry.com/developers/javaappdev /devtools.jsp.
  • 30. http://us.blackberry.com/developers/javaappdev/devtools.jsp
  • 31. http://us.blackberry.com/developers/blackberry7/
  • 32. BlackBerry Java Plug-in for Eclipse Update• Using the BlackBerry® Java® Plug-in for Eclipse® update site, you can download and install Eclipse® update components directly into an Eclipse install.• If a previous version of the BlackBerry Java Plug-in for Eclipse is installed, it should be uninstalled prior to installing the BlackBerry Java Plug-in for Eclipse v1.5.• If you’re using Java® 2 SDK, Standard Edition v6.0, obtain Update 16 of the Java 2 SDK v6.0 from the Oracle® website before downloading the plug-in using the Eclipse Update Mechanism.
  • 33. Using Other JDE Versions with Eclipse• Other JDE versions are supported within the same environment with downloadable component packs.• You can install other component packs for Eclipse from within Eclipse itself.Open Eclipse IDE and do the following:1. Select Help Menu.2. From the menu, select the Install New Software menu item. The Install New Software screen will appear.3. From the Install New Software screen, click the Add button.
  • 34. Using Other JDE Versions with Eclipse4. Paste http://www.blackberry.com/go/eclipseUpdate/3.6/java into the location text box, give it the name “text box,” and click OK.
  • 35. Using Other JDE Versions with Eclipse5. Select the BlackBerry Java Plug-in item and at least one BlackBerry Component Pack item that you want to work.
  • 36. Using Other JDE Versions with Eclipse6. Then follow the onscreen instruction to finish installation. You will have to restart Eclipse IDE in order for the installation to take effect.
  • 37. Desktop Software• If you want to load your application onto a BlackBerry device directly from your computer (i.e., without having to upload to a web server and download to your device over the wireless connection), you’ll need to install the BlackBerry Desktop Manager, which includes the device drivers for the BlackBerry.• You may already have this installed, since it comes on a CD with your device. Alternatively, you can download it from http://us.blackberry.com/apps-software/desktop/• You’ll also need this to be able to debug your application on a device using your USB cable.
  • 38. http://us.blackberry.com/apps-software/desktop/
  • 39. Blackberry Desktop SoftwareYou can use the BlackBerry Desktop Manager to load applicationsfrom your computer to your device
  • 40. Code Signing Keys• For basic applications, you can compile and run on real BlackBerry devices with no• further involvement from RIM using the free tools.• However, if you want to use certain features (such as the BlackBerry persistent store, cryptography APIs, and embeddable web browser), or if you want to allow your application to do things like automatically start, you’ll need code signing keys from RIM.• The code signing keys are only required to use controlled APIs from an application running on a device; you can run an application on the simulator that uses controlled APIs without having to sign it.
  • 41. Code Signing Keys• Since the free code signing keys usually only take a day or two to receive, it’s a good idea to get them while you’re setting up your development environment—almost every BlackBerry application ends up needing to use at least a few controlled APIs.• The online application form for signing keys is available at https://www.blackberry.com/SignedKeys/• When filling in the key request form, remember the PIN you choose. You’ll need it to install the keys into your JDE.• Because it’s sometimes a point of confusion, it’s worth pointing out that your signing key PIN is not related to a BlackBerry device PIN in any way.
  • 42. https://www.blackberry.com/SignedKeys/
  • 43. Installing Your Code Signing Keys• Once you’ve applied for your signing keys, you should receive three e-mails from RIM, each containing one of the code signing keys.• Each gives access to a different part of the API, and you should install all three on the same PC.To install your code signing keys in Eclipse with the BlackBerry JDE plug-in, simply import the keys by doing the following:1. From Eclipse IDE, select Windows from the menu, and then choose Open Perspective ➤ Others.2. Select the BlackBerry Application Development perspective. If you do not use the BlackBerry Application development perspective, you will not see the BlackBerry menu in the next step.
  • 44. Installing Your Code Signing Keys3. Then from the menu, select BlackBerry ➤ Sign ➤ Install New Key.• You’ll be prompted to create a new public/private key pair
  • 45. Installing Your Code Signing Keys• Click Yes on this dialog, and • A word of warning: This will you’ll be asked for a private seem like more fun than it key password to protect your should. key file.• Remember this password— you’ll be asked for it every time you want to sign your application.• You’ll then be asked to generate some random data by moving your mouse pointer around.
  • 46. Installing Your Code Signing Keys• After this, you’ll be asked to enter the PIN you provided when you applied for your keys and the private key password you just entered.• Do this and your key will be installed and ready to use.
  • 47. Installing Your Code Signing Keys• For the next two keys, you’ll already have generated your key pair, so you’ll just have to enter the PIN and private key password.• Once you’ve created your key pair and installed your three keys, the key information is stored in three files: – sigtool.csk – sigtool.db – sigtool.set• The location of these files is <eclipse_directory>pluginsnet.rim.ejdevmTools, where <eclipse_directory> is where you installed your Eclipse environment (i.e., C:Eclipsepluginsnet.rim.ejdevmTools).• It’s also a very good idea to keep a backup of these files and your original key files if you ever have to rebuild your development environment
  • 48. Agenda IntroductionDevelopment Environment Simulator Hello World Publishing and commercializing
  • 49. BlackBerry JDE Device Simulators• All BlackBerry device simulators execute the exact same code as an actual BlackBerry device using the same operating system version number.• That is, your application, running on a simulator, will execute its code just as if it were running on an actual device.• This means you can be pretty certain how your application will behave on your users’ BlackBerry devices just by running it on the BlackBerry simulators.• Each version of the JDE comes with its own set of simulated BlackBerry devices
  • 50. JDE version 4.5• The JDE version 4.5 comes with the following device simulators: – 81xx Pearl series (8100, 8110, 8120, 8130) – 83xx series Curve (8300, 8310, 8320, 8330) – 8700 and 8703e – 88xx series (8800, 8820, 8830)
  • 51. JDE version 4.7• The JDE version 4.7 comes with the following simulators: – 8830 – 95xx series Storm (9500, 9530)• As you can see, the JDE v. 4.7 doesn’t provide as many different device simulators as the JDE v. 4.5; however, the JDE v. 4.5 does not come with the BlackBerry Storm, which is one of the most popular BlackBerry models.• That’s because the Storm itself uses BlackBerry device OS 4.7 or later, and so the 4.7 JDE is required to create applications that can take advantage of the Storm’s touchscreen.
  • 52. BlackBerry simulators• The BlackBerry JDE comes with several supporting applications to assist you in developing a quality BlackBerry application.• You use smartphone simulators to execute your app just as if it were running on a real BlackBerry device.• You use the service simulators to represent the real-world services for the BlackBerry to access the Internet (through your PC) or to simulate sending and receiving e-mail.• You use simulators in your development process to test your apps before you run them on an actual BlackBerry smartphone.• You can download the smartphone simulators from RIM at the following URL:• http://us.blackberry.com/developers/resources/simulators.jsp
  • 53. http://us.blackberry.com/developers/resources/simulators.jsp
  • 54. Agenda IntroductionDevelopment Environment Simulator Hello World (by Eclipse) Publishing and commercializing
  • 55. Creating an Application with the BlackBerry JDE Plug-In for Eclipse• If you have worked with Eclipse in the past on a generic Java project, then creating a BlackBerry project will be very similar to what you’ve done with other generic Java projects.• We’ll walk through creating the same Hello World application with the JDE Plug-in for Eclipse.
  • 56. Creating Project in Eclipse• With Eclipse, workspace creation is implicit, and the JDE plug-in uses the same concept of workspace as Eclipse itself does.• When you start Eclipse, you’re asked for a workspace location, which can be any directory. Select (or create) an appropriate one and click OK,
  • 57. Creating a new workspace in Eclipse
  • 58. Eclipse new workspace Welcome page• If this is the first time you’ve opened this workspace, you’ll see Eclipse’s new workspace Welcome screen.• There are useful things here.
  • 59. Create a BlackBerry Project in Eclipse• To create a new BlackBerry project, click the File menu, and choose New  BlackBerry Project.• In the New BlackBerry Project dialog, name your project HelloWorld, and click Finish.
  • 60. Create a BlackBerry Project in Eclipse• Your Eclipse workspace should contain a single project in the Package Explorer on the left-hand side.• When expanded, you should see the following: – src folder: Where all our source files will reside – res folder: Where all resource files (i.e., images) will reside – JRE System Library: The BlackBerry runtime library containing the BlackBerry API (by default, it is OS 7) – BlackBerry_App_Descriptor.xml file: A file where you can configure your application, including the name of the application and the icon your application will use
  • 61. A new BlackBerry project in Eclipsewith the application descriptor opened
  • 62. Mypackage Package• By default, two classes, MyApp.java and MyScreen.java, will be created for you under the mypackage package.• You may delete the package so you can start from scratch by right-clicking on the mypackage package and selecting Delete.
  • 63. Creating the Application Classes• Creating class files is just as simple as creating a project. When creating new classes, it’s a very good idea to put your classes into packages.• As you will see, Eclipse has a very easy way of letting you specify the package for your class.
  • 64. Creating the Main Application Class• Right-click the HelloWorld project icon in the Package Explorer, and from the pop-up menu, select New  Class. In the dialog, type the following values: – Package: com.beginningblackberry – Name: HelloWorldApp (you can leave off the .java file extension) – Superclass: net.rim.device.api.ui.UiApplication
  • 65. Trick:• A handy shortcut throughout Eclipse, both in the New Java Class dialog and in the code editor, is to type part of the class name and then press Ctrl+spacebar to get a list of class suggestions.• For example, to automatically get the class name net.rim.device.api.ui.UiApplication in the Superclass field of the New Java Class dialog, type UiApp and press Ctrl+spacebar.• Eclipse will look for possible completions in the RIM API and in any classes you’ve created in your workspace. This also works for other Java constructs, such as method names.
  • 66. Method Stubs• Under “Which method stubs would you like to create?” make sure the first two check boxes, for generating a main method and constructors, are checked (the third box can be checked or not—there are no abstract methods in UiApplication, so it won’t make a difference).• Everything else can be left at the default
  • 67. Creating the main application class with Eclipse
  • 68. Source Code• You’ll get the following source code: package com.beginningblackberry; import net.rim.device.api.ui.UiApplication; public class HelloWorldApp extends UiApplication { public HelloWorldApp() { // TODO Auto-generated constructor stub } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub } }
  • 69. Main application class• There are even TODO markers where we have to write our logic.• You just created the main application class’ its job is to do three things: – Create an instance of the application – Create the main screen and push it onto the display stack – Start the event dispatch thread• This is generally the pattern you’ll follow for all your applications, unless you need to do something like automatically start when the BlackBerry device boots.
  • 70. Subclassing the UiApplication Class• All applications that display a user interface (screens, menus, etc.) must subclass net.rim.device.api.ui.UiApplication.• As we created the HelloWorldApp class, we specified the superclass for our main class to be UiApplication.
  • 71. Creating the Main Screen Class• Click New  Class again (or • Leave all other values at their right-click the package in the defaults, and click Finish to tree view and select New  create the following source Class, and you won’t have to code: reenter the package name).• Fill in the following values: package – Package: com.beginningblackberry; com.beginningblackberry – Name: HelloWorldMainScreen import – Superclass: net.rim.device.api.ui.container. net.rim.device.api.ui.container. MainScreen; MainScreen (or type MainS, and press Ctrl+spacebar) public class HelloWorldMainScreen extends MainScreen { }
  • 72. Filling In the Hello World Classes• Next, we flip back to HelloWorldApp, our main class. We’ll fill in the constructor of HelloWorldApp.• This will create the main screen and push it onto the display stack: class HelloWorldApp extends UiApplication { HelloWorldApp() { HelloWorldMainScreen mainScreen = new HelloWorldMainScreen(); pushScreen(mainScreen); } }
  • 73. Main Method• Finally, we need to complete the main method.• This will be familiar to you if you’re a Java SE, .NET, or C developer, but it is different from the Java ME/MIDP way of doing things.• The main method acts as the entry point for our application and always has the same signature.• You should only have one main method per application.• The main method will create an instance of our application and start the event dispatcher, which is the mechanism that does all the drawing to the screen, and listens for all user interaction for our application.
  • 74. Main Methodclass HelloWorldApp extends UiApplication { … public static void main(String[] args) { HelloWorldApp app = new HelloWorldApp(); app.enterEventDispatcher(); }}
  • 75. enterEventDispatcher method• The enterEventDispatcher method will never return as long as the application is running.• Essentially, the thread that entered the main application becomes the event dispatch thread.• We’ll explore this in greater depth later, but for now, just remember that the method won’t return during the application’s normal life cycle.
  • 76. Coding Up the Main Screen Classes• At this point, we need to add some GUI components to our main screen class with the following code for HelloWorldMainScreen.java:public class HelloWorldMainScreen extends MainScreen { public HelloWorldMainScreen() { net.rim.device.api.ui.component.LabelField labelField = new net.rim.device.api.ui.component.LabelField("Hello World"); add(labelField); }}
  • 77. Subclass MainScreen• We subclass MainScreen instead of Screen because MainScreen gives us a couple of things automatically—namely a basic layout manager (to position our UI controls on the screen) and a default menu.• Later, we’ll want to handle some of that functionality ourselves, but for this application, the default behavior of MainScreen is just what we want.
  • 78. BlackBerry User Interface API• The BlackBerry User Interface API follows a fields/layout managers/screens model: fields (UI controls such as buttons and text boxes) are contained within layout managers, which arrange and draw the fields in specific positions.• The managers themselves are contained within other managers, and ultimately a Screen class, which represents the visible display on the BlackBerry.• If you’ve used Java’s Abstract Window Toolkit (AWT), Swing, Windows Forms, or any number of other UI toolkits, these concepts will be familiar to you.• In fact, if you’re an experienced Swing user, you’ll find things very familiar.• For now, we’ll gloss over some of the details, but basically, a MainScreen instance contains a single VerticalFieldManager instance, which arranges all fields that it contains, one below the other, in the order that they’re added.
  • 79. BlackBerry User Interface API• The BlackBerry API contains a useful variety of fields and managers already.• For Hello World, we’ll just need one: the LabelField, which displays (as you might expect) a text label.• If you’re interested in exploring a bit more, you can find most of the built-in fields in the net.rim.device.api.ui.component package and the built-in layout managers in net.rim.device.api.ui.container.• Now that the application’s finished, let’s take a look at it in action in the simulator.
  • 80. Running the Simulator• The application is automatically built and deployed when we launch the simulator (in fact, with Eclipse, the Java code is compiled whenever you make any change, which makes spotting errors easy).• Running the simulator involves an extra step or two, because you have to create a debug configuration.• The advantage of this is that you can create multiple device configurations for different simulators and quickly select whichever one you need.• Click the arrow next to the debug icon on the Eclipse toolbar, and select Debug Configurations,
  • 81. The Eclipse Debug Configurations drop-down
  • 82. Debug Configurations• The Debug Configurations dialog lets you set up different• configurations, which may be different simulators or actual devices.• Each configuration can have different debug parameters, and as you develop applications, you’ll likely end up with a few different configurations for debugging different OS versions, screen sizes, and so on.• Feel free to explore these options at any time.• For now, select the BlackBerry Simulator icon on the left side, and click the New button on the toolbar in the dialog window.
  • 83. Setting g up a simulator debug configuration with the Eclipse plug-in
  • 84. Debug Configuration• We will need to specify which BlackBerry project we want the simulator to launch.• On the Project tab shown, check the newly created HelloWorld project.• As for the rest of the other tabs, keep all the defaults.• Then click the Debug button at the bottom of the dialog.• The simulator will launch with your application deployed.• From this point on, you can access your debug configuration directly from the Debug drop-down menu on the main Eclipse toolbar by clicking the downward-facing arrow next to the debug icon.
  • 85. The default values for a new debug configuration
  • 86. Launching the HelloWorld app in the simulator• After you click the Debug button, the simulator will start up.• When it is finished, you will see your HelloWorld app on the BlackBerry simulator home screen.
  • 87. HelloWorld app• When the simulator launches, the HelloWorld app will not start up on its own; you will need to launch it manually.• Using your mouse, click the icon on the screen to launch the app.• You can use the arrow keys to navigate and highlight the HelloWorld app, and press Enter to launch it (this is useful for older, non–touch screen simulators).
  • 88. Agenda IntroductionDevelopment Environment Simulator Hello World Publishing and commercializing
  • 89. BlackBerry App World• A way of installing apps debuted and is fast becoming the preferred method for distributing BlackBerry applications: BlackBerry App World.• In April 2009, BlackBerry launched BlackBerry App World— an on-device and webbased• BlackBerry application store. App World is already the best way to distribute almost all BlackBerry applications. It offers a way for users to find applications, install them, and purchase them.• Fortunately for developers, App World also takes away a lot of the headaches of deploying applications, making it easy to manage updates, deploy multiple versions for different devices and OS versions, and accept payment.
  • 90. BlackBerry App World
  • 91. History• Launched April 1, 2009 in the US, Canada, and the UK• Expanded to 10 additonal countries on July 31, 2009 – Added localiza4on support for French, Italian, German, and Spanish – PayPal is only supported payment method• Expanded distribution to LATAM and APAC Fall 2009 – Added localization support for Brazilian Portuguese• Launched BlackBerry App World Server 2.0 in April 2010 – Backend support for BlackBerry ID, carrier and credit card billing
  • 92. History• BlackBerry App World 2.0 launched August 2010 – Support for BlackBerry ID, carrier billing, credit card and PayPal billing in over 70 countries world wide and 21 currencies• BlackBerry App World 2.0 Web Storefront Launch Oct 2010 – Buy, download, and manage your apps from on the web – New $0.99 and $1.99 price 4ers Launched• BlackBerry App World Server 2.1 in Nov 2010 – Backend support for BlackBerry Payment Service, BlackBerry PlayBook App submissions and localized feature carousel• BlackBerry App World 2.1 launched February 2011 – Support for in--‐app purchases – Localized “Featured” Content
  • 93. Key Statistics• 3 million application downloads per day• 35 million Downloads of App World client• Available in over 100+ Countries and Territories• 21 Currencies• 6 Languages (English, French, Italian, German, Spanish, and Brazilian Portuguese)• Over 25,000 apps available for download or purchase• App sales launched in 57 additional countries on August 19, 2010• Indonesia ranks 5th, Mexico ranks 8th, and Australia ranks 10th for global sales after less than 30 days
  • 94. BlackBerry App World• The first step in publishing your application on App World is signing up for an account.• If you’re ready with the prerequisites, sign up for App World, and go to the App World Vendor Portal at http://us.blackberry.com/developers/appworld/
  • 95. http://us.blackberry.com/developers/appworld/
  • 96. Distributing Your Application on App World• App World applications are all managed through the Vendor Portal.• Before we walk through an application submission, let’s talk a bit about pricing and licensing.• Licensing Options: Applications on App World can be one of the following three types: – Free – Paid – Try & Buy