Thursday, May 27, 2010

Exercise 16

1. Choose ONE of the four ways to manage and develop integrated systems as listed below;
XML and Web Services as the glue

2. Summarise your understanding and describe its relevance (250 words max) in either your study at university or in your work environment;

XML
web services are developed to integrate various systems or to create new applications from existing ones. New powerful applications can be created quite quickly and in a cost effective way when existing applications are exposed as web services.

A web service is one that exposes useful functionality of an application to web users. In most cases, SOAP is used as the protocol. The service provides its description via Web Services Description Language (WSDL) document and is usually registered with Universal Discovery Description Integration (UDDI) so that other users can easily find it.


One of the benefits of web services architecture is that it communicate with different applications written in different languages in a standards-based way. This is extremely helpful when new applications are being created by integrating existing ones since data can be retrieved from all the applications even when they might be written in different languages, hosted in different operating systems using different databases.

Another benefit of using a web service is that they can be used over the standard set of protocols – XML, HTTP, TCP/IP. Therefore, the cost of entry for web services is much lower compare to other technologies.
At work, we created a RSS feed service that was listing the latest updates from three different products (cases, legislation and unreported judgments). We developed this using web services that was calling the various products to get the updates and then created the xml file for the rss.

References:
http://msdn.microsoft.com/en-us/library/ms996507.aspx

3. Edit TWO similar versions (include bibliography) of that summary to CSU Interact:
a. Post version A as a wiki contribution;


b. Add version B as a final entry to close your developer’s blog.
Web services has changed the way applications are created these days and pushing companies more towards web based applications and less on desktop based applications. Web applications can be accessed from anywhere and does not need to be installed making it a better option compared to desktop applications.

Web applications development is also changing and more applications are getting created using web services. Web services, being standards-based, can be used in creating in any applications, making it more reusable. Web services can also be written in various languages and can communicate with other applications in a standards-based way making it much more powerful and portable.

In short, web services is the soul of internet-based services.

References:
http://msdn.microsoft.com/en-us/library/ms996507.aspx

Tuesday, May 25, 2010

Workshop 8 - Deploy and Distribute Blackberry Applications

How to Deploy Applications

There are different ways to deploy a Blackberry applications. The application maybe installed from the Blackberry AppWorld, or from a Application Web Loader that installs the application via USB from the website, or from Over the Air in which case, a user navigates to a site and then installs the application from it.

Prerequisites


There are various requirements that must be met before an application can run in a Blackberry.
The application must be signed if it uses APIs that requires signing. Otherwise, the application will install in the device.

IT policies will need to be considered. For example, if the IT Policies do not allow running certain functions that the application is using, then the application cannot be used.

Also, the Trust Level of the application must be considered. The user or the administrator may disable certain permissions that might required to run the application.

Desktop Manager


The Desktop Manager is a software that allows a user to install a Blackberry application if they have a PC and a USB lead. The user will need COD and ALX files to be able to load the application. Eclipse automatically creates the COD files when the application is run or debugged. Eclipse automatically creates the ALX files when the application is packaged unless otherwise mentioned in the Blackberry_App_Descriptor.xml.


JAD, JAR and DEBUG files can also be found which might be useful.
To load the application on the device, start Desktop Manager, click on Application Loader and then click on Add / Remove Applications. Click on Browse and point to the ALX file and then follow the prompts.

Javaloader


Javaloader is a development purpose deployment method and should not be used to distribute applications. This tool requires a user to load the application using the command prompt. The user, therefore, will need to know the syntax to load the application.

Javaloader is part of the JDE kits and can be found in Blackberry JDE's bin folders.

Application Web Loader


Application Web Loader is the easiest way to load an application over the USB lead. The user does not need to know the command prompt functionality and nor does he need to install and use the Desktop Manager.
The user needs to go to the website, connects the device using USB lead, enter password if prompted and click on the Load button. The application will be loaded in the device. The JAD, COD and AxLoader cab files need to be on the web server. The mime type settings may need to be updated to allow the web server to publish the files to the site. The web server will need to associate web loader to the .jad file.

Over The Air


Using this method, a user can download and install an application from the web server wirelessly. Thus, Over The Air option allows easier and cheaper option to distribute the application.

The Blackberry browser can show the installation page and allow a user to download and install the application. The user can set permissions for the application.

The COD and JAD files need to be on the web server and the mime types on the server may need to be updated.

Blackberry Enterprise Server


Applications can be deployed to Blackberry devices automatically that are connected to Blackberry Enterprise Server. The Blackberry Enterprise Server administrator can log inn from any computer and easily deploy the application to specific users or groups. The administrator can also set the permissions of the application.

Blackberry App World


Blackberry App World offers opportunity to showcase an application to all Blackberry device users. Any developer can submit applications to the App World which will then be approved by RIM before making into the App World. Blackberry App World supports deploying applications running OS version 4.2.0 or higher.

Exercise 15 - Topic 10

1)What is meant by a location based service? Explain using the Web applications found on a late model mobile device.

A location based service (LBS) is one that is accessible via mobile devices and takes advantages of the user's location to provide services to the users. An example would be to find the nearest train station or a bank's branch through the mobile device. Another example would be advertising directly to users depending on the user's location or to provide weather report to the user based on the location.

2)Describe the purpose of the Open Mobile Alliance Initiative.

The Open Mobile Alliance (OMA) is the body that develops open standards for the mobile phone industry. It's mission is to provide interoperable services across countries, operators and mobile terminals. The specifications from OMA are meant to work with any cellular network technology.

3)What are the main components of a mobile Web services framework?

Mobile Web Services framework or Mobile Service Oriented Architecture uses existing emerging standards and extends SOA to mobile devices.

Location Services: Finds information about the user locations and provides him information based on the location.
Voice Services: Call Controls and Rounting.
Data Services: Provides data to user using sms, email, mms.
Identity Services: Checks for the identity of the user.
3rd party Web Services: Web Services created by third party performing various services.
Billing and Payment Services: Provides security while making payment over the mobile device.


4)Visit an airline Web site and search for information on WAP or SMS or 3G mobile application access to booking airline services. The same services exist in banking. How do both industries compare?

Virgin Blue provides Virgin Blue Travel Application that can be installed in a Blackberry from AppWorld. The application provides options to check-in, check boarding passes, create and manage bookings, check airport guide, and provides different information like Velocity Rewards points program. While creating a booking, the app provides option to search for flights and make bookings.

Commonwealth bank does not provide any app on Blackberry, however, the site can be accessed via the Blackberry browser from http://netbank.com.au/mobile. It seemed slow compared to the Virgin Blue app. It had options to view accounts, transfer money and BPay.

Both industries provide different services but security, accuracy and realtime data are the most important concerns for both the industries since both the industries will need to process payments and charge correct fees when applicable.

References:
http://en.wikipedia.org/wiki/Location-based_service
http://en.wikipedia.org/wiki/Open_Mobile_Alliance
http://developers.sun.com/learning/javaoneonline/2008/pdf/TS-5147.pdf

Monday, May 24, 2010

Workshop 7 - Debugging Blackberry Application in Eclipse IDE

Debugging Tools:
There are different ways to troubleshoot a Blackberry application. The application can be debugged on the simulator while writing the application using Eclipse. In this example, I will debug an application that was written for previous tutorials.

To debug an application, click on the Debug menu item in the Debug menu or click F11. Choose Blackberry simulator if options come up and hit Ok.


The simulator may take a while before it starts working when the Debugger is attached. This will also open up the Console window as shown below.


On the top-right section, the Java button is selected. Clicking on the Debug button will show the Debug interface. The Debug interface is shown below.



Just below the Debug interface is the source code for the file. In this source code, we can set breakpoints as shown below.



Breakpoints allow the application to stop when it is run in the simulator at this particular point.
Below the source code, is the Console window that displays messages from JVM and also from the application. The Console window is helpful to debug application as we can display messages from the catch section of a try-catch block and print out the exception details if it is hit.

The Variables window appears next to the Debug window. When the application is run and hits the breakpoints, the variables are displayed in the Variables window as shown below.



The application can be resumed by clicking on the Resume (F8) option as shown below.



Blackberry Memory Statistics
To set the memory statistics view, click on the Window > Show View > Other > Blackberry and choose Blackberry Memory Statistics View as shown below.


To use this, set a breakpoint and run the application. When the application pauses, click on the refresh button on the Blackberry Memory Statistics View. An example of the data is shown below.



Blackberry Objects View
This shows all the objects running from all the application. This can be viewed the same way as blackberry memory statistics by choosing the Blackberry Objects View. Typical data returned is shown below.


We can also the Garbage Collection function to check if the objects are properly deallocated.


Blackberry Profiler View
The Profiler displays information on where the application spends most of its time. It can be run same way as before by choosing the Blackberry Profiler View. Typical data returned is below.




Garbage Collection
Blackberry is Java based and it automatically frees up memory as necessary. Though garbage Collection can be called manually, Blackberry highly recommends against it.

Memory Leaks
Memory leaks can happen when the application maintains a reference to an object that is no longer needed. It can usually happen within the data structures, local variables, runtime stores and listeners. This can be very hard to detect but we can look for symptoms like the hourglass that appears as it performing garbage collection quite often.

Deadlocks
Deadlocks can happen when multiple threads are waiting for each other and hence the application gets blocked forever. The JVM can detect this issue and eventually end the application. On Blackberry, it is easy to identify a deadlock by having the “Interrupt debugger on potential deadlock” selected from the Run > Debug Configuration option as shown below.



While running the application, it will close the simulator and display the deadlock details in the Console window.

Setting up the simulator
We can modify simulator settings to work in different environments. For example, we may need to connect to a network using MDS or choose a specific model. We can change the settings by navigating to Run > Debug Configuration > Simulator as shown below.




Conclusion
Creating and debugging Blackberry applications in Eclipse IDE is quite easy as the application can be debugged and configured quite easily.