Skip to Content

Have you ever been stopped in your development because the framework did not fit all the components or libraries required? An example of this issue could be an application written in java for a WAS requiring libraries for exporting data collections to an excel format; does your WAS have these libraries from factory settings? And what about mobile environments with such limited and hard to understand frameworks they are uncommon-emerging technologies?

This blog shows you how to solve these kinds of issues, this means, how to use external libraries on your custom app. for mobile client 7.1 (handhelds and laptops).

Step by step solution:

Part I – Creating an External Library DC

1.       Create am External Library DC Component

 

image

2.       Fill the required fields (vendor and name) and press the Finish button.

 

image

3.       The system will ask you to switch the perspective, press Yes (if the system did not ask you, switch to the Resource perspective anyway).

 

4.       Locate the desired library (.jar file) on your hard drive and copy it (yes, like a traditional copy and paste) and past it into your project libraries folder. For this example we will use the crimson and jaxp jars files.

 

image

5.       Switch the Development Infrastructure perspective, under the component browser, select your development component, after that you might see in the right side the component properties view, select the Public Parts tab.

 

image

 

6.       Add a new public part for sharing your libs to others DCs, fill the required fields (name and purpose). Always set COMPILATION purpose.

image

 

7.       Right click on your new public part and select the Manage Entities option.

  

image

8.       Expand the Archive option, check the desired libraries and finish.

image

9.       Right click on the root project folder and select the build option.

image

 

After these steps your external library will be ready to use in your DCs projects. Remember the step number 6, we chose COMPILATION purpose, this means that the public part will be used just for compilation and not for execution purposes. In our case, we will include these libs manually on the application container (SAP Mobile Client 7.1). Just copy and paste the required jars into the lib folder of your mobile client installation and reboot it (stop and start for laptop mobile clients or warn reboot in handhelds environments).

image
Mobile Client for Laptops root folder
image
Mobile Client for Handhelds root folder

 

Part IU – Using external libraries in your DC application

1.       Create a new DC type WebDynpro (mobile for handheld, mobile for laptop or traditional WebDynpro). For us, we will develop a handheld Mobile UI Component. Fill the required fields (Vendor and Name).

image

2.       Next step is to add dependencies to the WebDynpro DC. Check that you are in the Development Infrastructure perspective, select the Dependencies tab under the Component Properties view and press the Add button.

 

4.       Find and select the external library from the list of DCs to be referenced to, check it and press the Next button.

image

5.       On the configure dependencies window, just leave checked the runtime option for the root node (external_lib [test.cts.com]) and click finish.

image

Now your WebDynpro project is ready to use the external libraries, just include the required imports, write your java sentences, build and deploy your DC. Remember that we just selected the COMPILATION purpouse for the external library DC, and you have to include the jar files into the lib folder.

 

Hope you enjoy  – comments are most welcome,

David Faustini

To report this post you need to login first.

2 Comments

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

  1. Vidyadhar Nemalapuri
    We need to observe some caution especially for mobile handhelds when using extwernal libraries…
    I tried to use Apache axis 2 libs for using webservices on handheld apps and it works fine on desktop but fails when running on actual handhelds…reason java runtime on handhelds is 1.3 compatible and axi2 is 1.4 compatible…so your external libs must be 1.3 compatible if it were to run in mobiles…
    (0) 
  2. Vidyadhar Nemalapuri
    We need to observe some caution especially for mobile handhelds when using extwernal libraries…
    I tried to use Apache axis 2 libs for using webservices on handheld apps and it works fine on desktop but fails when running on actual handhelds…reason java runtime on handhelds is 1.3 compatible and axi2 is 1.4 compatible…so your external libs must be 1.3 compatible if it were to run in mobiles…
    (0) 

Leave a Reply