Note : This blog is only meant to show you how to start developing mobile applications with SUP. Most of the information provided here can be found in the online help onSyBooks Online. Do not hesitate to read the official documentation, it contains much more details and some great tutorials.

 

Developing Mobile Applications with Sybase Unwired Platform (1/3)

Developing Mobile Applications with Sybase Unwired Platform (2/3)

Developing Mobile Applications with Sybase Unwired Platform (3/3)

 

In this tutorial, we will use the Device Application Designer (DAD) to develop a mobile application for BlackBerry devices. This tool allows you to model the user interface of the mobile application so you don’t have to develop the application using the native tools and language of the platform (i.e. Java for BlackBerry and C# for Windows Mobile).

 

BlackBerry Java Plug-in for Eclipse Installation

The DAD needs the BlackBerry development tools to generate an application for BlackBerry devices.

You can either install the plug-in from Sybase Unwired Workspace or download it from RIM website.

Note : you’ll need to enter a BlackBerry Developer Zone id and password during the installation process so you should register here.

 

Start Sybase Unwired Workspace and select Install New Software from the Help menu then click on the Add button :

image 

 

Type the URL : http://www.blackberry.com/go/eclipseUpdate/3.5/javainto the location text box and type BlackBerry Java Plug-in Update Site in the name text box :

image 

 

Select the components you wish to install. You must select the BlackBerry Java Plug-in component and at least one BlackBerry Java SDK component :

image

Device Application Designer Configuration

Now we need to configure the DAD and specify the location of the BlackBerry devices simulators.

Select Preferences from the Window menu and expand the Sybase, Inc tree.  Select BlackBerryin Sybase, Inc > Mobile Development > Device Application Designer > Devices :

image 

 

Edit the items to specify the location of the simulators. For the BlackBerry Curve 8300 the path should look like :

C:SybaseUnwiredPlatformEclipseplugins
et.rim.ejde.componentpack4.5.0_4.5.0.28componentssimulator

image

Mobile Application Creation

Right click on the MyFlights project then select New > Device Application Designer. Choose the platform device target you want to create the DAD for and click on Finish :

image 

 

Note : you could also automatically create a DAD with auto-generated content by right-clicking on the project and selecting Create Device Application Designer.


Search Flights Screen Creation

Click onStart in the Device Application Designer Introduction view to open the Flow Design view. Our flow does not contain any screen so let’s create the first one. Create a new empty screen by selecting the Empty element in the Palette > Screens container and clicking in the Flow Design view :

image 

 

Double click on the new screen to open the Screen Design view :

image 

 

Use the Palette to add some controls to the screen by drag and drop. We’ll need 3 Labels, 2 choices, 1 Edit Box and 1 Button :

image

 

 

Rename the controls via the Properties tab :

image

 

 

Remove the Back button from the navigation bar and align the button to the right by adjusting the properties :

image

 

 

In a real application, the list of airports would be retrieved from the backend (sairport table in your SAP backend) using a BAPI. For this tutorial we will manually add a couple of entries to the 2 choices :

image

 

 

At the end, this is what your screen should look like :

image

 

Flights Screen Creation

Now we need to create a couple of screens to display the flights. The DAD is able to create these screens automatically. Right click in the Flow Design view and select Flow Design > Add Mobile Business Object Screen. Click on Search, select the Flights MBO and click on OK :

image

 

 

The Flights, Flights Details and FlightAvail Details screens will be automatically created :

image

 

Edit the properties of the new screens to change the labels and choose which MBO fields will be displayed.

 

Actions Creation

We want to synchronize the data and display the flights when the user clicks on the Submit button. To achieve this we need to create some actions for this button.

 

In the Search Flights screen, click on the Submit button then on the Button > Actions tab :

image 

 

Click on the little button next to the New…button to create a new action :

image 

 

First create a Synchronize action. Click on Search… in the following screen to select the Default Synchronization Group :

image

 

 

Check the Customize synchronization option and click on Configure… to map the synchronization parameters to the corresponding controls :

image

 

 

Now create a new Connection action to connect to the Flights screen :

image

 

 

The Submit button has now 2 actions :

image

 

When the user clicks on this button, the MBOs will be synchronized using the parameters provided in the Search Flights screen and the Flights screen will be displayed.

 

Device Application Generation

In the Flow Design view, right click and select Generate Device Application :

image 

 

Accept the default settings and make sure the following options are checked then click on Finish :

image

 

 

The device application will be generated then the BlackBerry device and MDS simulators will be started. In the BlackBerry simulator, click on Applications then on your application icon to start the device application :

image 

 

Select the airports and the flight date and click on the Submit button (use the BAPI_FLIGHT_GETLIST BAPI on the backend system to find valid parameters) :

image

 

 

The search results will be displayed on the Flights screen :

image

 

 

Click on one of the flights to display more details :

image

 

 

Click on the menu key then select Flight Availability to display the last screen :

image

Next Step

The Device Application Designer is a nice tool and it can be used to quickly create basic applications or prototypes.  However if you want to create a device application with a very nice UI, you may have to use another approach. Search the SUP documentation for “Custom Development” for more information (and tutorials). Note that you can develop applications for the iPhone with SUP using this method.

To report this post you need to login first.

20 Comments

You must be Logged on to comment or reply to a post.

    1. Pierre Dominique Post author
      Hi,

      You can authenticate the user on the SUP server using a stock login screen. If you want to authenticate the user on the backend you need to change the “Runtime Data Source Credential and Connection Properties” during the MBO creation. I’ll write a blog on how to achieve this next week. 

      Regards,

      Pierre

      (0) 
      1. Tahir Öz
        Hi,

        This is really excellent and very helpfull work thank you for sharing with us.
        My question is similiar with Upendra Agrawal but a bit diffrent so, how could i make my own login screen if that user in  database then login to system if not show error.

        Regards
        Tahir

        (0) 
  1. Ron Sargeant
    Pierre, I saw this tool demoed at a developer day so was looking forward to getting to work with it for a some applications. However, I am working on the CRM Sales client for iPhone and for that you do NOT use this toolset, in fact it is a million miles away! The CRM client makes heavy use of the Netweaver Mobile gateway, which brings up the question: will all future applications need to be served by the gateway as the backend or will ‘direct’ connections still be allowed?
    (0) 
    1. Pierre Dominique Post author
      Hi Ron,

      Yes, this toolset is only used for 100% custom applications. The current SAP/Sybase solutions use both SUP and NetWeaver Mobile 7.1 and are quite complex.

      We don’t know much about the new platform but I hope SAP and Sybase will keep SUP as the mobile application development tool and use NW Mobile as the middleware.

      Regards,

      Pierre

      (0) 
      1. Joao Sousa
        Use SUP as development tool and NW Mobile as middleware?

        Don’t you think that is a too complex scenario? We’ve got complex mobile applications (much more complex than CRM Mobile Sales) that connect to SAP ERP with no SUP and no NW Mobile, and they are working fine.

        Why should I pay licencing for SUP, if I’ve got to use custom development anyway (SUP will only provide the synch API), and still maintain the monster that is NW Mobile?

        I don’t see the value proposition in SUP if it needs to work with NW Mobile (although after going to SUP training I’m starting to understand why it needs NW Mobile). 

        (0) 
  2. Rahul Muraleedharan
    Hi Pierre,

    Thank you for posting such a nice blog…it really helps one to get a hang of SUP.

    I have tried out this sample application, but there is some prob with the application I have made. When I run the application, no data is getting displayed. The initial screen is working fine but after that when I input some values no data is getting fetched and in the second screen it shows ’empty’. I have tested the BAPI_FLIGHT_GETLIST in SAP server, there with the same input the BAPI is working fine. Please help me with this issue.

    Thanks and Regards,
    Rahul M. B.

    (0) 
    1. Francesco Bassino
      Hello Everbody,

      I’ve another similar problem.
      When i click on Search Button to get FlyList data bleckberry simulator show “Retrieving synchronization group default: Uploading data…” message.

      No other messages are display, it stay in thys state for more time and nothing happens.

      some help?
      thank you very much
      Francesco

      (0) 
  3. Jenny Bachmann
    Hi Pierre, hi community,

    unfortunately the BlackBerry Plug-in is as of recently only available as a stand-alone installation, meaning you cannot just include it in the SUP any longer. This makes custom coding considerably more difficult. For those you still need and want to do it, I want to refer you to the SyBooks manual on how to set up your BlackBerry custom coding projects in the BlackBerry Eclipse Plug-in stand-alone: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00835.0155/doc/html/vhu1297442060100.html
    Good luck with the development!

    Best regards,
    Jenny

    (0) 
  4. Bobu George Putheeckal
    I implemented a similar application which fetches a table from the backend upon receiving the 2 mandatory inputs. Its working fine, but the problem is, when i enter another set of inputs, the page is not getting refreshed. still the old ouputs is present. How to update the screen?
    (0) 
  5. Tapan Nathvani
    Hello Expert,

         I am using SUP 2.0 and in it, DAD is not there so how to used that Flight’s application in Blackberry java plug-ins  ? please reply

    And if you created other blogs related to BAPI with SUP then please sene me link of it.

    Really i got more help from you blog and will be.

    Regards,
    Tapan

    (0) 
  6. Miguel Garcia Velasco

    Hi,

    Is there any tutorial like this but with windows mobile?
    I have been searching all over the web and i couldnt find any examples of a BAPI working with SUP in windows mobile.

    I have already downloaded all the SUP and sybase manuals but there is something that they dont explain and i culdnt get it to work even coping and pasting the code in the documents.

    Any little help will be apreciated.

    Regards.

    (0) 

Leave a Reply