Tuesday 31 May 2011

Automate test cases on BlackBerry.


Automated testing of Blackberry applications
Jamo Solutions provides tools that automate the testing effort for mobile applications running on the BlackBerry platform.

The tool “M-eux Test’ is a test automation environment that ensures:

Ø       The re-use of test cases on different hardware platforms. Today several Blackberry devices are available. All these devices run the same operating system but have different hardware characteristics like screen resolution and keys. The scripts of M-eux test are hardware independent. Once implemented, a script can be re-used across different models.

Ø       The re-use of test cases across different version of the application under test. The scripts made by M-eux Test can easily be re-used to ensure that existing functionality is still working in new versions of the application under test. This is called regression testing.

Ø       Easy creation and maintenance of the test scripts. The technology applied by Jamo Solutions is easy to use, the scripts are readable and easy to maintain and the expertise gained by the usage of M-eux Test can be re-applied for testing applications on other platforms.

The technology platform of M-eux Test
ensures the above requirements by supporting:

Ø       Testing through the user interface of the application. Just like a manual tester will describe his test cases by using the user interface elements, the automated test script is verifying and driving the user interface elements of the mobile application under test. By recognizing the user interface elements, the script becomes hardware independent. If a new version of the application under test is released, then preserved functionality can be tested with the old scripts. The tool will take care of cosmetic changes like a menu item that is now in a new position. By using the user interface elements, the script becomes also readable for a non-technical tester and the script is easy to maintain.

Ø       Extension of existing scripting environments. M-eux Test did not implement its own scripting environment. In order to ensure a fast learning curve and to ensure re-use of gained expertise, M-eux Test is an extension of existing scripting environments. For users with a test engineering background, M-eux Test extends the leading test automation tool QuickTest Professional from Hewlett Packard. For users with a developer’s background, M-eux Test extends Visual Studio from Microsoft and Eclipse


Blackberry GUI objects
M-eux Test is an all-round player and recognizes most of the user interface objects of Blackberry-based applications as long as these objects are developed using the Blackberry SDK. All Blackberry field objects are supported out of the box. User interface objects that are derived from these standard fields, are automatically mapped to these fields.

For BlackBerry OS5, the tool recognizes also the elements inside the embedded browser so that the QA engineer is able to test web-based mobile applications on this BlackBerry platform.

Blackberry System verification
Special functions are implemented to verify the Android operating system. The tester can at any time verify for example:

• Technical characteristics of the device
• The battery status
• The connection information

Special functions are foreseen to launch and verify the mobile connections:

• SMS messages
• E-mail messages
• MMS messages

Tool Architecture 


An agent is installed on the mobile device. The agent is responsible for the recording and the replay of the test commands The Device is connected to the PC using WIFI. The Device Manager is the gateway between the connected devices and the extension inside QuickTest Professional or Visual Studio or Eclipse. The architecture allows the connection of multiple devices. One test script can execute against multiple devices.

Support level
Complete support is provided for Blackberry applications that are made testable by taking into account the directives of Jamo Solutions during development of the application. 


The supported editions are listed :

Supported versions:

Ø       Blackberry OS 4.6
Ø       Blackberry OS 4.7
Ø       Blackberry OS 5.0




Monday 30 May 2011

BlackBerry simulator installation

Test a BlackBerry Java Application


Obfuscating a BlackBerry Java Application

The compiler for the BlackBerry® Java® Development Environment and the BlackBerry® Java® Plug-in for Eclipse® is set to minimize the size of the application. The compiler produces a .cod file that provides obfuscation-like services that are similar to those that obfuscation packages provide in an effort to reduce the size of the .cod file. For example, the BlackBerry Java

Development Environment removes the following information from a .cod file:

Ø       all debug information
Ø       local variable names
Ø       source line numbers
Ø       private method and member names

It is not typically necessary for you to provide obfuscation for your applications in addition to the existing obfuscation that, by default, the BlackBerry JDE provides. In fact, Research In Motion does not perform any additional obfuscation of its own products.

The BlackBerry JDE does not integrate support for obfuscation through third-party tools. You must include a command-line procedure to obfuscate .cod files for use on BlackBerry devices.

Preverifying a BlackBerry Java Application

When you preverify your classes, you reduce the amount of processing that the BlackBerry® device must perform when you install your application. To partially verify your classes before you install your application on a BlackBerry device, you can use the Preverify tool, available with the BlackBerry® Java® Development Environment. You can use the BlackBerry Smartphone Simulator to preverify the .cod files.

For more information about using the BlackBerry Smartphone Simulator, see the BlackBerry Smartphone Simulator User Guide. For more information about using the Preverify tool, see the BlackBerry Java Application Development Guide.

Testing applications on a BlackBerry Smartphone Simulator

After you develop and compile your application, you can test it on the BlackBerry® device. The most common first step is to set the BlackBerry® Java® Development Environment to use a BlackBerry® Smartphone Simulator. The BlackBerry Smartphone Simulator runs the same Java code as the BlackBerry devices, so the BlackBerry Smartphone Simulator provides an accurate environment for testing how applications will function on a BlackBerry device. The BlackBerry JDE includes current versions of the BlackBerry Smartphone Simulator.

Testing applications on a BlackBerry device

After you test your application on the BlackBerry® Smartphone Simulator, you can install your application on a BlackBerry device. If your application uses signed APIs, you might need code signing keys. After you install the application on the BlackBerry device, you can open the application and test its functionality and performance.

For debugging purposes, you can attach your device to the BlackBerry® Integrated Development Environment and use the debugging tool to step through your application code. The BlackBerry IDE can be useful if you are trying to identify a network or Bluetooth® issue, or other issues that are difficult to simulate.

BlackBerry Simulators


The BlackBerry device simulator is designed to emulate a true BlackBerry experience without actually using a real BlackBerry device. The BlackBerry device simulator is an application that you install on your computer that shows an image of the BlackBerry device model of your choice. This image has the look and feel of an actual BlackBerry device. The functionality includes the same user interaction of an actual BlackBerry device (including the trackwheel and the keyboard), the same applications, and the same features such as email messages, phone, and Internet browsing. The BlackBerry device simulator also serves as a platform on which applications can run. This includes the ability for the applications to make network connections, store data, and handle email messages.

Start the device simulator

The BlackBerry® device simulator is available either as a part of the BlackBerry Java Development Environment or as a standalone installation of the BlackBerry simulator package. Visit http://us.blackberry.com/developers/resources/simulators.jsp for more information about downloading the BlackBerry device simulator.

Start the BlackBerry device simulator from the BlackBerry JDE

Ø       On the taskbar, click Start > Programs > Research In Motion > BlackBerry JDE 4.2.0 > Device Simulator

Start the BlackBerry device simulator from a Simulator Package

Ø       On the taskbar, click Start > Programs > Research In Motion > BlackBerry Device Simulators 4.2.0 > Device Simulators 4.2.0 XYZ > <device_name>.

 Using the BlackBerry device simulator graphical user interface

Viewing or hiding the BlackBerry device image

By default, the BlackBerry® device simulator displays the BlackBerry device image. You can hide the BlackBerry device image so that only the LCD screen is visible.

Hide the BlackBerry device image

Ø       On the View menu, click LCD Only.

 View the BlackBerry device image in full-screen mode

Full-screen mode allows you to maximize the view of the BlackBerry® device simulator. You can view either the full BlackBerry device image or only the LCD image in full-screen mode. Since the BlackBerry device simulator only uses integral multiples of the simulated LCD’s resolution, different screen resolution settings may result in full-screen images that cover a larger percentage of the computer screen.

Ø       On the View menu, click Full Screen.

Access menu options in Full-Screen mode

You can access the menu items on the BlackBerry® device simulator’s menu items by moving the mouse to the top of the computer screen. The menu appears when the cursor is near the top of the computer screen.

Exit Full-screen mode

Ø      On the View menu, click Full Screen.

If you are viewing the LCD screen in full-screen mode, the LCD screen stretches to its optimal zoom-level and is padded with a black background. If you view the BlackBerry® device image in full-screen mode, the BlackBerry device image is centered and is padded with a white background.

Change the size of the BlackBerry device image

1.On the View menu, click Zoom.
2.Click a percentage.

Save a screen shot

Ø       On the Edit menu, click Save Device Snapshot or Save LCD Snapshot.

By default, the BlackBerry® device simulator saves the screen shot as the most suitable file type for the content of the image. The BlackBerry device simulator saves a screen shot of the BlackBerry device image as a .jpg file, and a screen shot of the LCD as a .png file. You can override the default if you click Browse and set a different file type in the Save as type field.


Copy a screen shot to the clipboard

Ø       On the Edit menu, click Copy Device Snapshot or Copy LCD Snapshot.




Using the BlackBerry device simulator input controls

Simulate the trackwheel and keys

Use the BlackBerry® device simulator trackwheel to simulate using the trackwheel on a BlackBerry device.

The BlackBerry device simulator assigns BlackBerry device functionality to the following computer keyboard and mouse procedures:


Action
Keyboard procedure
Mouse procedure
Roll the trackwheel.
Press the UP ARROW or DOWN ARROW key.
Roll the mouse wheel button.
Click the trackwheel.
Press the LEFT ARROW key.
Click the mouse wheel button.

Press the Escape key.
Press ESC or the RIGHT ARROW key.
Click the right mouse button.

Turn on BlackBerry device backlighting.
Press PAGE DOWN.
Click the Power button on the BlackBerry device simulator keyboard.

Press the Symbol key.
Press DELETE.
Click the Symbol key on the BlackBerry device simulator keyboard.

Press the Alt key.
Press CTRL.
Click the Alt key on the BlackBerry device simulator keyboard.

Press the BlackBerry device keys.
Press the keys on your computer keyboard.
Click the keys on the BlackBerry device simulator keyboard.

Press the phone/PTT (Push-to-TalkTM) button.
Press PAGE UP.
__


Testing applications that require an HTTP connection:

 Simulating the BlackBerry MDS Connection Service

The BlackBerry® MDS simulator is designed to simulate the BlackBerry MDS Connection Service component of the BlackBerry Enterprise Server. Using the BlackBerry device simulator with the BlackBerry MDS simulator enables you to test network, push, and browser applications that are designed for use with a BlackBerry Enterprise Server. If you are testing applications that require an HTTP connection, you will require the BlackBerry device simulator and the BlackBerry MDS simulator. The BlackBerry MDS simulator is available for download from the BlackBerry Developer Zone web site at http://us.blackberry.com/developers/resources/simulators.jsp

Starting the BlackBerry MDS Simulator

Ø       On the taskbar, click Start > Programs > Research In Motion > BlackBerry Email and MDS Services Simulators 4.1.2 > MDS.

Testing Starting the BlackBerry MDS Simulator

Ø       Start the BlackBerry device simulator.
Ø       In the BlackBerry device simulator, open the BlackBerry Browser.
Ø       Open the menu.
Ø       Click Go To.
Ø       Type http://www.blackberry.com/go/mobile/.
Ø       Click OK.

If the BlackBerry home page appears, the BlackBerry MDS simulator is working.
If an error message indicates that the browser cannot connect to the BlackBerry MDS simulator, verify that you started the BlackBerry MDS simulator





BlackBerry


Blackberry is a line of mobile e-mail and smartphone devices developed and designed by Canadian company Research In Motion (RIM) since 1999.

Blackberry phones function as a personal digital assistant and portable media player. They are primarily known for their ability to send and receive (push) Internet e-mail wherever mobile network service coverage is present, or through Wi-Fi connectivity. They support a large array of instant messaging features, including BlackBerry Messenger.



Blackberry commands a 14.8% share of worldwide smartphone sales, making it the fifth most popular device manufacturer after Nokia, Samsung, LG, and Apple.The consumer BlackBerry Internet Service is available in 91 countries worldwide on over 500 mobile service operators using various mobile technologies.

Modern GSM-based BlackBerry handhelds incorporate an ARM 7, 9 or ARM 11 processor, while older BlackBerry 950 and 957 handhelds used Mudit 80386 processors. The latest GSM BlackBerry models (9100, 9300 and 9700 series) have an Intel PXA930 624 MHz processor, 256 MB (or 4 GB in the Torch 9800) flash memory and 265 MB SDRAM.[7] CDMA BlackBerry smartphones are based on Qualcomm MSM6x00 chipsets which also include the ARM 9-based processor and GSM 900/1800 roaming (as the case with the 8830 and 9500) and include up to 256MB flash memory. The CDMA Bold 9650 is the first to have 512MB flash memory for applications. All BlackBerrys being made as of 2011 support up to 32 GB microSD cards.


BlackBerry OS:


BlackBerry OS is a proprietary mobile operating system, developed by Research In Motion for its BlackBerry line of smartphone handheld devices. The operating system provides multitasking and supports specialized input devices that have been adopted by RIM for use in its handhelds, particularly the trackwheel, trackball, and most recently, the trackpad and touchscreen.


The BlackBerry platform is perhaps best known for its native support for corporate email, through MIDP 1.0 and, more recently, a subset of MIDP 2.0, which allows complete wireless activation and synchronization with Microsoft Exchange, Lotus Domino, or Novell GroupWise email, calendar, tasks, notes, and contacts, when used with BlackBerry Enterprise Server.


Current versions:

 While RIM develops and releases updated versions of its operating system to support each device, it is up to the individual carriers to decide if and when a version is released to its users. On April 2010 RIM announced the new BlackBerry OS 6.0 version, which was released in the 3rd quarter 2010. RIM announced BlackBerry OS 7 on 2nd May 2011. It would be released in summer 2011. RIM announced that current devices would not be updated to Blackberry OS 7 (No Legacy Device Support) RIM also announced the BlackBerry Bold Touch (Blackberry Bold 9930 & 9900) which runs Blackberry OS 7 .


Monday 23 May 2011

How to install Android SDK and Emulator


Android is the latest mobile OS to take the world by storm, but everyone doesn’t have access to the latest mobile devices.  Thankfully, there’s an easy way to run Android on your Windows, Mac, or Linux computer.  Google provides an Android emulator with their SDK, which is designed to let developers test their apps on Android before running them on handsets.  We can use this to test drive Android on our computer, here’s how to do it.
Getting Started
The Android Emulator requires Java to run, so if you don’t already have Java installed on your computer.


Note: When installing Java, make sure not to install any crapware it tries to sneak in like the worthless Yahoo toolbar


Then, download the Android SDK from Google (link below), and make sure to select the correct version for your computer.  Once it’s downloaded, unzip the files as normal..



In Windows, run the SDK Setup.exe program to get started running Android on your PC.



The SDK will check Google’s servers for available packages.


If you see an SSL error message, click the Settings tab on the left in the SDK and AVD Manager window that opened in the background.  Here, uncheck the Force https box, click Ok, and then reopen the setup.


Now, the Package Installer will open.  You can choose what you want to install, and then clickInstall to begin installing the Android emulator on your computer.


By default, all of the SDK platforms, samples, and APIs will be selected for install.  This can take quite a while to download, as several versions of Android are currently available.  If you only want to play around with Android, choose the version you want.  You’ll want the SDK Platform Android your.version.  Then click the Reject bullet on all the other entries, and click Install.  We wanted to try out the latest Android 2.2 as well as the older 1.5, so we downloaded both of them.


Once you’ve started installing, you’ll see a window showing the download and installation progress.  This may take a few minutes, depending on your Internet speed.






You’ll have some little Androids in your taskbar, but unfortunately they don’t show the download progress.

Setup an Android Emulator
Once the download is completed, you can setup an emulator to test drive Android on your computer.  Select the Virtual Devices from the left menu, and then click the New button on the right.


Enter a name for your virtualized Android, and select the version of Android you want to use from the drop-down menu.  This will only show the version you installed previously, so you may only see one version listed depending on your selection.


Enter a size under the SD Card entry; this is a virtual SD card that’s actually an IMG file that Android will use to store your settings and files in.  Then, select a screen size from the skin options.  The default is a standard, Nexus One-type display, while the others are different sizes including even a BlackBerry-style device.


Click Create AVD when you’re finished.


The program may appear to freeze while it is creating the AVD, so just wait until you see the confirmation window.




You’re now ready to run Android on your PC!  Select your new virtual Android, and click Starton the right.


You can choose to scale the display if you’ve chosen a larger screen size than your monitor will fit, and then select Launch.


Android will now begin to load in your emulator.  Several command prompt windows may open, and then you’ll see the emulator itself.  Notice that the default, large screen size will display a keypad and virtual buttons on the right side of the emulated device



Android may take several minutes to load, especially on your first run.  After a while, the boot screen will switch to an Android boot animation.


Finally, you’ll be presented with your new Android home screen!  Use your mouse as you would normally, though remember that you don’t need to double-click to open apps.



You can open pre-installed apps from the launcher menu, though unfortunately these emulator images do not include the Android Marketplace




Default apps such as Email work great, and you can even see most of the device settings in Android.


You’ll even see the nifty Android Lock screen if you leave your virtual machine alone for a few minutes.  Just click the arrow and drag it to the other side of the screen to unlock.




We did experience a few crashes in our tests, and the emulator felt somewhat sluggish, but in all, it’s fun to try  out a new mobile OS without spending money on a new phone.


Create a Shortcut For Your Android
Alternately, right-click on the Emulator.exe in the SDK Tools folder, and select Create Shortcut.

This shortcut would actually only run the emulator in Command Prompt and not load an actual virtual device.  We’ll need to change the properties to do this, so right-click and select Properties.


Select the Shortcut tab, and then scroll to the end of the Target box.  Enter the name of your virtual Android as before, as @your_Android after the emulator.exe, and then click Ok



Now you can launch your Android directly from your Desktop or Start menu.




Conclusion
Whether you’re a developer who wants to write the next greatest app for Android or are simply are curious about Android and would like to try it out without buying a new phone, the Android Emulator is a great way to get started for free.  It is also a great way to try out new versions of Android if you have an older device. We were disappointed that the Android Marketplace wasn’t included. but check back in the next couple days and we’ll show you how to run it in the emulator.


















Android Emulator


The Android SDK includes a mobile device emulator -- a virtual mobile device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device.

The Android emulator mimics all of the hardware and software features of a typical mobile device, except that it can not receive or place actual phone calls. It provides a variety of navigation and control keys, which you can "press" using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other Android applications running.



To let you model and test your application more easily, the emulator supports Android Virtual Device (AVD) configurations. AVDs let you specify the Android platform that you want to run on the emulator, as well as the hardware options and emulator skin files tht you want to use. Once your application is running on the emulator, it can use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data, notify the user, and render graphical transitions and themes.

The emulator also includes a variety of debug capabilities, such as a console from which you can log kernel output, simulate application interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and dropouts on the data channel.


Download the Android SDK:


Starting and Stopping the Emulator

During development and testing of your application, you install and run your application in the Android emulator. You can launch the emulator as a standalone application, from a command line, or you can use it as part of your Eclipse development environment. In either case, you specify the AVD configuration to load and any startup options you want to use, as described in this document.You can run your application on a single instance of the emulator or, depending on your needs, you can start multiple emulator instances and run your application in more than one emulated device. You can use the emulator's built-in commands to simulate GSM phone calling or SMS between emulator instances, and you can set up network redirections that allow emulators to send data to one another. For more information, see Telephony Emulation, SMS Emulation, and Emulator Networking
To start an instance of the emulator from the command line, change to the tools/ folder of the SDK.

 Enter emulator command like this:

emulator -avd <avd_name>

This initializes the emulator and loads an AVD configuration (see the next section for more information about AVDs). You will see the emulator window appear on your screen.
If you are working in Eclipse, the ADT plugin for Eclipse installs your application and starts the emulator automatically, when you run or debug the application. You can specify emulator startup options in the Run/Debug dialog, in the Target tab. When the emulator is running, you can issue console commands as described later in this document.
If you are not working in Eclipse, see Installing Applications on the Emulator for information about how to install your application.
To stop an emulator instance, just close the emulator's window.


Android Virtual Devices and the Emulator

To use the emulator, you first must create one or more AVD configurations. In each configuration, you specify an Android platform to run in the emulator and the set of hardware options and emulator skin you want to use. Then, when you launch the emulator, you specify the AVD configuration that you want to load.
To specify the AVD you want to load when starting the emulator, you use the -avd argument, as shown in the previous section.
Each AVD functions as an independent device, with its own private storage for user data, SD card, and so on. When you launch the emulator with an AVD configuration, it automatically loads the user data and SD card data from the AVD directory. By default, the emulator stores the user data, SD card data, and cache in the AVD directory.
To create and manage AVDs you use the android tool, a command-line utility included in the SDK. For complete information about how to set up AVDs, see Android Virtual Devices


Controlling the Emulator

You can use emulator startup options and console commands to control the behaviors and characteristics of the emulated environment itself.
When the emulator is running, you can interact with the emulated mobile device just as you would an actual mobile device, except that you use your mouse pointer to "touch" the touch screen and your keyboard keys to "press" the simulated device keys.
The table below summarizes the mappings between the emulator keys and and the keys of your keyboard.

Emulated Device Key
Keyboard Key
Home
HOME
Menu (left softkey)
F2 or Page-up button
Star (right softkey)
Shift-F2 or Page Down
Back
ESC
Call/dial button
F3
Hangup/end call button
F4
Search
F5
Power button
F7
Audio volume up button
KEYPAD_PLUS, Ctrl-5
Audio volume down button
KEYPAD_MINUS, Ctrl-F6
Camera button
Ctrl-KEYPAD_5, Ctrl-F3
Switch to previous layout orientation (for example, portrait, landscape)
KEYPAD_7, Ctrl-F11
Switch to next layout orientation (for example, portrait, landscape)
KEYPAD_9, Ctrl-F12
Toggle cell networking on/off
F8
Toggle code profiling
F9 (only with -trace startup option)
Toggle full screen mode
Alt-Enter
Toggle trackball mode
F6
Enter trackball mode temporarily (while key is pressed)
Delete
DPad left/up/right/down
KEYPAD_4/8/6/2
DPad center click
KEYPAD_5
Onion alpha increase/decrease
KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

Note that, to use keypad keys, you must first disable NumLock on your development computer.



Emulator Limitations

In this release, the limitations of the emulator include:

  • No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator console, however.
  • No support for USB connections
  • No support for camera/video capture (input).
  • No support for device-attached headphones
  • No support for determining connected state
  • No support for determining battery charge level and AC charging state
  • No support for determining SD card insert/eject
  • No support for Bluetooth