31

Click here to load reader

MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

  • Upload
    lequynh

  • View
    216

  • Download
    4

Embed Size (px)

Citation preview

Page 1: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

1 Installing the Sybase Unwired Platform

Installing the Sybase Unwired Platform 2.2 for Android DevicesBy Mark Gearhart, SAP NS2

IntroductionOver the last year, installation of the

Sybase Unwired Platform has gotten much better. Last year at this time, it took a day to install. With the newest release of SUP 2.2, the installation time has dropped to about 2 hours in my experience, following the steps described in this article. Many errors and workarounds from previous releases have been fixed, and the external Android support packages have also been cleaned up quite a bit.

There are still many things to consider when installing the Sybase Unwired Plat-form. Since I install it several time per year as assignments, Sybase Unwired Platform releases, and laptop contents change, this article is meant to be the reference point for installing the Sybase Unwired Platform without having to flip back and forth be-tween several installation guides and in-ternet sites. This article captures, in one spot, a successful method for installing the Sybase Unwired Platform version 2.2, with the latest EBF 20726 (SP01 PL01) for Android devices. The installation proce-

dure is designed for a single instance of the Sybase Unwired Platform on a Windows 7 laptop.

It is important to note that the Syb-ase Unwired Platform is a fluid product. Things have changed drastically from one release to the next. In fact, this installation procedure has been re-written four times in the last year alone. The procedure is not backward-compatible, and it may not be forward-compatible either.

The Sybase Unwired Platform is a platform used to build mobile applica-tions. The nice thing about the platform is that you will be able to build some functional mobile applications which can send and receive data to databases on a host. Not only that, the database can be Sybase ASE, SQL Anywhere, Sybase IQ, or even SAP HANA. This, in my view, is one thing that makes the Sybase Unwired Platform more valuable than the straight Android SDK mobile application develop-ment used by the general public. Sybase has added database connectivity to ap-plications running on mobile devices. Not only that, if you write a native Application (versus an HTML5 Application), you can create an Ultralite database on the device itself so that your application can operate with a local device database without even being connected to a host.

For the simple installation described in this article, we will be installing the De-velopers Edition of the Sybase Unwired Platform on a Windows 7 laptop. This edi-tion consists of an Unwired Server, a sam-ple SQL Anywhere database for applica-tion testing and a Software Development Kit (SDK). We will also be installing an Android emulator, and of course the ac-tual Android device. It will be connected to my PC with a USB cable for test pur-

ContentsIntroduction 1Step 1: Clean Up Your Machine 2Step 2: Download Packages 4Step 3: Install the Runtime Package 5Step 4: Install the SDK Package 10Step 5: Install the EBF Package 12Step 6: Configure Unwired Workspace 13Step 7: Install Android SDK 15Step 8: Configure Android SDK 17Step 9: Install ADT Plug-in 18Step 10: Create Android Emulators 20Step 11: Configure Android Device 23Step 12: Set up a Network 26Step 13: Register the Devices in SCC 29Conclusion 31

MOBILITY

Mark Gearhart is a Senior Consultant with SAP. He is involved in the devel-opment of database architectures and rich internet applications for temporal and realtime systems. His background encompasses the energy and financial industries with a special interest in data storage architectures and fast user inter-faces. He can be reached at [email protected].

There is nothing more useful when developing SUP ap-plication than to work with the entire product, self-con-tained, on your laptop. This Article describes an installa-tion of SUP 2.2 suited for this type of development environ-ment, and pulls together sev-eral installation procedures into one place.

Page 2: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

2 Installing the Sybase Unwired Platform

poses. Additionally, I will also set up a private network between my laptop and the device (in lieu of a Sybase Relay Server) to use the system in realistic scenarios.

Within the Sybase Unwired Platform, there is an Eclipse-based Unwired Workbench that you use to build mobile appli-cations, a Sybase Control Center which manages your growing collection of mobile applications, an Android SDK (Software De-velopment Kit) Manager, and an Android AVD (Android Virtual Device) Manager.

For larger installations, there can be multiple Unwired Serv-ers running in conjunction with things called Sybase Relay Serv-ers and Sybase Clustered Enterprise Systems. But we’re not going that far with the installation. We’ll just stick to something you can get running on your laptop.

Before starting the setup, there are two important things you should know. The first is your laptop and Android device configuration, and the second is permissions for executing the programs.

The PlatformI am using my SAP-supplied laptop for the Sybase Unwired

Platform installation. For purpose of Sybase product downloads and the Sybase Unwired Platform configuration, here is the in-formation for my laptop that I used for during the installation:

• hostname: bth516785a

• IPv4 address: 10.24.49.215 (this changes frequently)

• Physical address: 00-21-CC-66

• platform: Windows 7 x64

You can find this information, except for the platform, by opening up a DOS prompt and typing ipconfig /all. The platform information can be found from Start -> Control Panel - > System. Look at the system type. That will tell you if you have a 32 or 64 bit machine.

It is unusual to use your IP address for anything. Usually a hostname will suffice. However, the Android emulator will be unable to communicate with Unwired Server using a host name, so an IP address will be needed instead. We’ll cover this later.

I am also using my Android smart phone for the actual de-ployment device. For the installation, I needed this information:

• Device Manufacturer: Motorola

• Android Version: 2.3.6

To find the Android version, power up your device and go into Settings -> About phone. You’ll see a line called Android ver-sion which contains your version number. Even though my An-droid says version 2.3.6, which means that applications should be built using version 2.3.6 or earlier of the Android SDK, I later found out that I could load the latest Android SDK 4.2 and build applications which would run on my device. It is probably a dan-gerous idea to assume that the Android SDK 4.2 is backward-compatible all the way to version 2.3.6, since I am sure things must be getting deprecated as time goes along. So far, though, I’ve been able to run Android 2.3.6 applications on Android 4.2.

Watch our for PermissionsA lot of people think because they are associated to the local

admin account, they have admin-level rights and permissions. This assumption is wrong for Windows 2008, Vista and Windows 7. The local admin account is really a power user’s account. With that in mind, always right click on a program and Run as Admin-istrator; otherwise, things may not go so well when updating the system directories and registry keys.

In fact, I make it a habit especially for the Sybase Unwired Platform to run everything as an administrator. Even when I open up a DOS command prompt, I always right click and Run as Administrator.

OK, let’s get started.

Step 1: Clean Up Your MachineI’ve installed several versions of the Sybase Unwired Plat-

form several times on my laptop. Plus, I’ve had several SCC, SQL Anywhere, ASE and IQ installations as well as a couple JDK downloads. Therefore, the windows registry has a lot of extra stuff in it.

The last time I installed the Sybase Unwired Platform ver-sion 2.1, the Unwired Workspace behaved strangely. After I con-nected to an ASE or SQL Anywhere databasee within the Enter-prise Explorer View, I tried to click on the Tables folder for the databases. I got a Java runtime error. After cleaning up my lap-top and re-installing the entire Sybase Unwired Platform release from scratch, the problem went away.

So, clean up your machine before starting an installation, and you’ll avoid strange errors. Here is what I do to clean things up.

First, if you have a prior Sybase Unwired Platform installed, make sure both the SDK and the Runtime and the Android SDK Tools have been uninstalled. Before uninstalling, shutdown all the Sybase Unwired Platform services. These services show up in the Windows Services below. If you have SUP 2.1 installed you’ll see a service called “Advantage Database Server”. In SUP 2.2, this service no longer exists:

1

Page 3: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

3 Installing the Sybase Unwired Platform

2

My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22. Installshield for the Sybase Unwired Platform “recommends” using the default path of C:\Sybase\Unwired-Platform. This is not a good idea. I have ASE, ASA and IQ on my laptop as well, as well as multiple releases of each, so my prefer-ence is to use a path which is specific to the product and version. Even though I have overidden the “recommended” location for the Sybase Unwired Platform, I’ve never had any problems be-cause of this.

Go to the release directory and run C:\SybaseSUP22\Un-installers\MobileSDK22\uninstaller.exe as an administrator. Here is the uninstall screen:

1

Then, run C:\SybaseSUP22\Uninstallers\UnwiredPlat-form\uninstaller.exe as an administrator. Here is the uninstall screen:

1

Also remove the Android SDK Tools if you have it installed. You can do this by going to the Windows Start Menu and click-ing on All Programs -> Android SDK Tools -> Uninstall Android SDK Tools:

1

Now call up the Registry Editor and delete all registry en-tries from the previous installations. To run the Registry Editor, invoke the program Windows program regedit.exe:

Page 4: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

4 Installing the Sybase Unwired Platform

1

I delete all entries which match the following searches - SCC, SUP22, and Android. After the registry is clean, I move on and delete all the left-over system environment variables, specifi-cally, JAVA_HOME, DJC_HOME and ANDROID_HOME. It is interesting to note that the Sybase Unwired Platform does not require any of these environment variables to exist, but if they do happen to exist, the platform will use them often to bad effect.

Also delete the system environment variable SYBASE_MES-SAGING_SYSTEM_HOME. This is an environment variable left from SUP 2.1. It is no longer used in SUP 2.2.

One last thing. Remove the C:\SybaseSUP22 directory. Af-ter all this cleanup, we should be ready to start the installation!

Step 2: Download PackagesFor the installation, you’ll need three things - the Sybase

Unwired Platform Runtime and Sybase Unwired Platform SDK from Sybase, the Android SDK, and the Android USB Driver for Microsoft PC.

I like to get everything downloaded before I start the instal-lation. That’s why all of this is in Step 2. I put everything in my supdownloads directory on my laptop, which is located here:

C:\Mark\supdownloads

The Runtime and SDK PackagesLet’s go get the SUP stuff. I normally go to the Sybase website

shown below. However, it looks as if this site is changing so there’s no telling how long you’ll be able to download products from www.sybase.com.

From the main Sybase site, you can go to the Sybase Product Download Center at:

https://sybase.subscribenet.com

Here, you can find an entry for Sybase Unwired Platform. Select this entry and go to downloads for the Enterprise Devel-oper Edition. Download both the Sybase Unwired Platform 2.2 Runtime and the Sybase Unwired Platform 2.2 SDK for windows x64. There are two versions of SUP, an Enterprise Edition and a Developer’s Edition. I use the Developer’s Edition because it comes with a sampledb, which is an SQL Anywhere database instance that you can use to store data in lieu of connecting to an EIS backend system. The sampledb is very handy for testing and building mobile applications without the need for a big SAP backend installation or some other database installation such as ASE. Plus, when you install the Developer’s Edition, sampledb will automatically get configured as an available connection, and it will be placed into the Windows Services list so that it auto-matically starts when you start up the Unwired Server. Very nice.

You will also need a license for the Runtime and SDK. My machine is not a virtual machine, so I generate Unserved licenses. If your machine is a VM, then you want to use a Served license. Even though the instructions said I needed a license for the Syb-ase Unwired Platform SDK, nowhere in the installation did I use it.

If you do not have access to the Sybase Product Download Center, then you can also get the installation packages from the SAP Support Portal. What you’ll be looking for are entries for SYBASE UNWIRED PLATFORM (Installation Product):

Page 5: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

5 Installing the Sybase Unwired Platform

After you download the Runtime and SDK products, you can unzip them and place the folders in two directories:

C:\Mark\supdownloads\sup2.2\sup0220rtwin64_64_02 for the Runtime

C:\Mark\supdownloads\sup2.2\mblesdk0220win86_x64_3264 for the SDK

Also download the latest EBF (or Service Pack, as SAP calls it), which can be found at www.sybase.com in the support section under EBF’s/Maintenance, or at the SAP Support Portal under SYBASE UNWIRED PLATFORM (Maintenance Product). You might be tempted to skip this, but there are quite a few bug fixes since the baseline 2.2 so be sure to get the latest EBF.

The Android SDKThis link has the information you need to get the download

the Android SDK as well as install it:

http://developer.android.com/sdk/installing.html

This is a pretty good website. What you’ll be looking for is a link to download this file:

installer_r21-windows.exe

Once you get this file downloaded, you’ve got everything you need to install the Android SDK.

The Android USB Driver for Microsoft PCMy environment is used for Sybase Unwired Platform de-

velopment as well as straight Android development. For straight Android development, in order to quickly deploy code from your laptop to the Android device, you’ll need to download a USB Driver. I have a Motorola device, and I found the driver here:

http://www.motorola.com/Support/US-EN/Support-Homepage/Software_and_Drivers/USB-and-PC-Charging-Drivers

From this site, I downloaded this file:

MotorolaDeviceManager_2.2.23.exe

For other manufacturers, you’ll need to find the USB Driver which matches that manufacturer.

For Sybase Unwired Platform applications, you don’t need a USB Driver to deploy, since deployments are done across the network instead.

ConnectifyThere are a couple ways to set up a communication path be-

tween the Sybase Unwired Platform and your Android device. You can use an available public or corporate WiFi network with certain ports opened up, or you can use either a Sybase Relay Server or a private WiFi network between just your laptop and your device. I often go for the private WiFi network for reasons explained in Section 12.

To configure a private WiFi nework, you can install Connec-tify on your laptop. The download for it is here:

http://www.connectify.me

The file to download is called:

ConnectifyHotspotInstaller.exe

I put everything in my supdownloads directory. When all the downloads are complete, here is what the supdownloads di-rectory looks like:

1

Step 3: Install the Runtime PackageInstalling the Sybase Unwired Platform Runtime is fairly un-

eventful. Make sure you have downloaded the Sybase Unwired Platform and generated a licence file. For the Sybase Unwired Platform Runtime, Sybase Unwired Platform SDK, and the Syb-ase Unwired Platform EBF, we will be working off the folders in this directory:

C:\Mark\supdownloads\sup2.2

To install the Sybase Unwired Platform Runtime, run the following executable as administrator:

C:\Mark\supdownloads\sup2.2\sup0220rtwin64_64_02\setup.exe

The sequence proceeds as follows:

Page 6: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

6 Installing the Sybase Unwired Platform

1

1

1

In order to enter the correct information for the next screen, you will need to refer to your license file. This file contains the product edition and license type. Open up the license in note-pad and look for the entries PE=ED and LT=DT. ED stands for Enterprise Development and DT stands for Development and Test License:

If you have something other than this, then you’ve got a li-cense file different than what I usually use. No problem though; just make sure you enter the correct types in the screen below:

1

Page 7: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

7 Installing the Sybase Unwired Platform

1

1

1

The installation creates Sybase Unwired Platform services. These new services can be configured to start automatically when you start up your laptop, or you can configure them to start manually. For me, automatic start up is a bad idea because I don’t always want to start things everytime a reboot my laptop. Therefore, I install all the Sybase Unwired Platform services to start manually. Then, after I start up my laptop, I just run the Start Sybase Unwired Platform desktop shortcut as adminstrator whenever I’m ready, and the services come up just fine. To con-figure the system for manual startup, override the checkbox la-beled Set Sybase Unwired Platform services to start automatically on the following screen and unclick it:

1

In the next screen, you will enter the supAdmin password for the supAdmin account. This is the account you use when log-ging into the Sybase Control Center. It is also the account used when configuring a Server connection from the Unwired Work-space to the Unwired Server. So, don’t forget the password.

It is also the account I use when when calling up the Hy-brid Web Container app on the device, although it doesn’t have to be since the app will prompt for a new password upon the first initiation. In fact, in a production system you would never do something like this.

Page 8: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

8 Installing the Sybase Unwired Platform

1

1

1

After you click Install, the progress bar will start up and you’ll wait for a couple minutes while the installation executes:

1

1

Page 9: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

9 Installing the Sybase Unwired Platform

1

1

Once the installation is complete, the success screen will ap-pear:

1

We are now done with the Sybase Unwired Platform Run-time installation.

There a couple things to note. After the installation is com-plete, you will have a new entry in your system menu for Sybase -> Unwired Platform:

1

There will also be three desktop shortcuts on your screen, for Start Sybase Unwired Platform, Stop Sybase Unwired Platform, and Sybase Control Center:

Page 10: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

10 Installing the Sybase Unwired Platform

1

New services will also be added:

1

One last thing. You should now have a bunch of stuff in your Sybase Unwired Platform installation directory:

C:\SybaseSUP22

If you configured the services to start up automatically, then shutdown the Sybase Unwired Platform by running the Stop Sybase Unwired Platform desktop shortcut as Administrator. It would have been started automatically following the installation of the SUP runtime platform if you configured it that way.

Step 4: Install the SDK PackageLike the Sybase Unwired Platform Runtime, installing the

Sybase Unwired Platform SDK is also fairly uneventful. Make sure you have downloaded the Sybase Unwired Platform. Once downloaded, you are ready to go.

To install the Sybase Unwired Platform SDK, run the follow-ing executable as administrator:

C:\Mark\supdownloads\sup2.2\mblesdk0220win86_x64_3264\setup.exe

The sequence proceeds as follows:

1

2

3

Page 11: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

11 Installing the Sybase Unwired Platform

Right here is where you’d expect to enter a licence key. But for my installation, the screen did not appear. It doesn’t seem to be a problem since the system operated as expected.

After you click Install, the progress bar will start up and you’ll wait for a couple minutes while the installation executes. Once the installation is complete, the success screen will appear:

4

1

11

1

One thing to note about version 2.2 is the additon of the Mo-bile Analytics Kit (MAKit). This is a new feature which provides the support needed to build mobile charts and graphs.

Just as the installation is completing, a strange thing hap-pens. A browser is launched with a URL to the Mobile SDK In-stalation Guide. I don’t think it is very useful, since we are already past the point of needing this, so I just close the browser.1

Page 12: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

12 Installing the Sybase Unwired Platform

1

1

After the installation is complete, you will have a new entry in your system menu for Sybase -> Unwired Platform -> Unwired Workspace2.2. The entry will be a launch point for the Unwired Workspace:

5

There will also be a desktop shortcut on your screen, for Start Sybase Unwired Workspace:

6

Step 5: Install the EBF PackageTo install the EBF, first shut all the services down. Find the

desktop icons and left-click Stop Sybase Unwired Platform -> Run as Administrator.

Now open a DOS prompt as administrator and run the in-stallebf.bat file in the installation directory:

C:\Mark\supdownloads\sup2.2\ebf20726\rt-support-pack-2.2.1-uep22-20121101.051840-31-drop3\installebf.bat

Page 13: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

13 Installing the Sybase Unwired Platform

1

The script will ask for the SQL Anywhere database user name and password for the SQL Anywhere instances configured for the product. It only asks once, so apparently all SQL Any-where instances have the same username and password. Enter dba for the user name, and sql for the password.

Then, the SQL Anywhere launch screen automatically ap-pears and then minimizes to the Windows tray:

2

As the script executes, it shows the status of each step, and ends with a completion message:

2

Also upon completion, the script starts up the Sybase Un-wired Platform services. Shut them down again, so we can install the EBF for the SDK:

C:\Mark\supdownloads\sup2.2\ebf20726\sdk-sup-portpack-2.2.1-uep22sdksp01p01-20121102.200347-24-drop1\installebf.exe

3

1

As the script executes, it shows the status of each step, and ends with a completion message:

2

The EBF is now installed. This script does not start up the Sybase Unwired Platform services, so they remain shutdown.

Step 6: Configure Unwired WorkspaceBefore you start anything here, make sure the Unwired Serv-

er is running. We will need the sample SQL Anywhere database up as well as the Unwired Server so we can test out the connec-tions. Since we have now installed all the Sybase Unwired Plat-form products, this would be a good time to reboot you machine.

To startup the Unwired Server, run the Start Sybase Unwired Platform desktop shortcut as adminstrator.

1

Now let’s set up the Unwired Workspace. This is an Eclipse-based tool that is used to build the mobile applications, so you’ll need to get it configured before you start any kind of develop-ment.

First set up the workspace area. This is a folder on disk where all the projects will be stored. Instead of the default Windows 7 C:\Users\i830410\workspace, which is equivalent to C:\Docu-ments and Settings for other Window OS’s, I prefer to put the workspace somewhere closer to where I usually navigate, but not in the SUP directory. I create a workspace as follows and also check the box so I am not prompted all the time for a location:

C:\mark\sup22workspace

Page 14: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

14 Installing the Sybase Unwired Platform

1

Once in, you can set the window arrangement. Here is the window arrangement I like. You can set it from Window -> Open Perspective -> Other -> Mobile Development:

1

The first thing to do is create a database connection and a Unwired Server connection. You’ll need to do this only once. From then on, as you build projects within the Unwired Work-space, you can just open up those connections to use them. Us-ing the database connection, you can grab table schemas to put into your MBO’s (Mobile Business Objects). Using the Unwired Server connection, you can deploy your application.

Go to the Database Connections folder. You’ll see that it con-tains an entry called My Sample Database. This is a pre-config-ured SQL Anywhere database supplied with the Developers Edi-tion of the Sybase Unwired Platform. All you need to do here click on the connection and adjust some of the options. First, check the box so that the connection is opened everytime the workbench is started:

1

Next, proceed to the Sybase ASA Connection Properties:

1

The host name is the name of your laptop, and the port num-ber is 5500. This was the default port number of the SQL Any-where database when it was installed. The login is “dba” and the password is “sql”. I usually check Save Password so I don’t have to reenter it all the time. Once all this is done, click Test Connection to make sure the ping works, and then click Finish to save the connection.

Now go to the Unwired Servers folder. You’ll see that it con-tains an entry called My Unwired Server. All you need to do here click on the connection and adjust some of the options. First, check the box so that the connection is opened everytime the workbench is started:

Page 15: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

15 Installing the Sybase Unwired Platform

1

Next, proceed to the Unwired Server Connection Properties:

1

1

The password in the next screen needs to be filled in. It is the password you entered during your Sybase Unwired Platform Runtime installation. Also check Save Password.1

After the Database and Unwired Server are defined and con-nected, your Unwired Workspace should look like this:

1

It is useful to note that these connection settings are appli-cable to the sup22workspace. If you decide to use another work-space, then you will have to re-create the connections for the new workspace.

Next we will get the Android stuff added. If you have some-thing other than Android, this is as far as you can go in this ar-ticle. The rest of the article will be Android-specific.

Step 7: Install Android SDKThis is a good time to reboot your machine. All the Sybase

Unwired Platform stuff has been installed and the Sybase Un-wired Workspace connections have been set up, so it is time to move on to the Android configuration. After you’ve rebooted, make sure the Unwired Server is not running. If you look at the services, they should all be down.

Now install the Android SDK by calling a DOS promt as ad-minstrator and running the installer:

C:\Mark\supdownloads\installer_r21-windows.exe

1

If all goes well you will see the following screen when you click Next.

Page 16: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

16 Installing the Sybase Unwired Platform

1

However, several times I’ve gotten this error:

If you get this, you cannot proceed. If you do a google search on this, you will find many people saying that if you hit the Back and Next button, things will work. Not true in my experience, at least on my laptop. It looks like its been a problem reported to the SDK development team many times, but not fixed.

Other people report that the JDK is not in the right place, so to solve the problem you would do something like this:

1. copy C:\SybaseSUP22\JDK1.6.0_26 to C:\Program Files\Java\JDK1.6.0_26

2. create a system environment variable JAVA_HOME=C:\Program Files\Java\JDK1.6.0_26

That worked a couple times, but not consistently.

One other workaround was to press the Report Error button, close the report dialog. This is sometimes enough to get the Next button enabled. If you can just get that Next button clickable, then you are home free.

There is another way to install the Android SDK but I do not recommend it. From the Android download site referenced in Step 2, you can also get the following zip file:

android-sdk_r21-windows.zip

If you unzip this file to C:\SybaseSUP22\android-sdk, the SDK will be installed. However, there are some valuable shortcuts for the SDK Manager and AVD Manager that will not be added to your desktop, so you’ll have to hunt around and add them to your desktop manually. I did this the first time I tried the instal-lation, so its not a show stopper if you absolutely cannot get the .exe to work.

When you get to the next screen, leave the default radio but-ton highlighted:

1

When you get to this screen, enter the path for the Android SDK:

C:\SybaseSUP22\android-sdk

1

As the installation completes, you’ll get three screens:

Page 17: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

17 Installing the Sybase Unwired Platform

1

2

1

You can see the result by looking for a new directory in your installation:

1

As shown below, there will also be a Android SDK Tools startup folder in your desktop menu, to start the SDK Manager and AVD Manager. This is the thing that will be missing if you install from the .zip file:

1

Step 8: Configure Android SDKWe are not quite finished with the Android SDK installation

yet. Even though it is installed, we will need to check off a list of installed packages by calling up the Android SDK Manager. You can do this from the system menu by clicking Android SDK tools and then right-clicking SDK Manager -> Run as Administrator.

You’ll notice a bunch of SDK Platforms for Android. These are the various flavors of the Android operating system. You can find out what version your phone runs by looking under the phone’s Setting section, under About Phone.

I have been selecting the latest SDK for Android 4.2 (API 17), and also the SDK for Android 3.2 (API 13) and Android 2.3.3 (API 10). My own phone currently runs API 10.

Page 18: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

18 Installing the Sybase Unwired Platform

1

Select what you need. At this point you’re pretty much set. Go ahead and click the Accept All radio button, and then click Install. Things should proceed smoothly. You may have to click each individually and install sequentially if the Install button is stippled out. Some SDK components might have depedencies which prevent them from downloading. It all depends on the state of the SDK at the time you download.

1

It will take a while. A log file will automatically appear to show you the progress. When things are done, you’ll see the last entry in the log file as Done loading packages:

1

If you then look back at the original dialog box in which you selected the different versions of Android, you should see that everything was installed. In the event that something was not installed, go ahead and install it again. I may not have been installed due to dependency conflicts with other installs.

1

Step 9: Install ADT Plug-inThe Android Development Tools (ADT) Plug-in provides a

real nice interface to the Android SDK, making application de-velopment efficient (not my sentence).

Before installing the ADT Plug-in, update the version of Eclipsed shipped with the Sybase Unwired Platform. If you don’t do this, you may run into errors as I did, because the baseline ver-sion of Eclipse supplied with the Sybase Unwired Platform might be to old.

To update Eclipse, click Help->Check for updates...

Upon completion, a list of updates will appear. Go ahead and select all of them.

1

1

Page 19: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

19 Installing the Sybase Unwired Platform

1

A license agreement screen will appear. Accept the terms and click Finish:

1

The update process will apply the updates and show a status in a dialog box:

1

After the installation is complete, you will get one final screen:

1

Go ahead and push the Restart Now button.

OK, here is a HUGE note. Later on, if you start having problems with Unwired Workspace such as xml files than can-not be viewed, property buttons that do not push, or other very weird things, odds are that these Eclipse updates have broken the Workspace code. Rats. It has happened several times to me. I know things worked at some point or the product would never have shipped, so it becomes a matter of backing out the updates. A re-install is the best way to do this.

We are now ready to install the ADT Plugin. Go into the Unwired Workspace and select Help -> Install New Software... In the top-right corner click Add. The dialog below will appear. In this dialog, enter “ADT Plugin” for the name and the following URL for the location:

https://dl-ssl.google.com/android/eclipse/

1

Click OK. If you have trouble acquiring the plugin, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons). In the Available Software dialog, select the checkboxes next to Developer Tools and NDK Plugins, and click Next:

2

In the next window, you’ll see a list of the tools to be down-loaded. Click Next. Read and accept the license agreements, then click Finish.

Page 20: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

20 Installing the Sybase Unwired Platform

1

1

1

Note: If you get a security warning saying that the authentic-ity or validity of the software can’t be established, click OK.

1

After the installation is complete, you will get one final screen:

1

Go ahead and push the Restart Now button.

Now that the ADT plugin is installed, we can configure it. Modify your ADT preferences in Eclipse to point to the Android SDK directory. Call up the Unwired Workspace and select Win-dow > Preferences... to open the Preferences panel:

1

7

Select Android from the left panel. You may see a dialog ask-ing whether you want to send usage statistics to Google. If so, make your choice and click Proceed. You cannot continue with this procedure until you click Proceed.

For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. Then click Apply. My SDK directory is:

C:\SybaseSUP22\android-sdk

After this, you will see entries in the SDK list for each of the SDK’s you configured. If you had configured more than one SDK, then you would choose which SDK to use and click Apply. In my case, I am using Android 2.3.3 SDK, so I click this one and then click Apply, then OK.

If you are developing applications targeted to different ver-sions of Android, you will no doubt become familiar with this screen as you switch between SDK’s.

Step 10: Create Android EmulatorsAn Android emulator is not the same thing as an actual An-

droid device. The Android emulator is a program that runs on your laptop. It has a screen that looks kind of like the device. Under the covers, it will have some ports open to the Sybase Un-

Page 21: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

21 Installing the Sybase Unwired Platform

wired Server so that it can receive a download of the mobile ap-plication as well as send and receive data as it operates. The An-droid emulator is used to test your application before deploying it to the actual Android device.

We create and launch the Android emulator by calling up the Android AVD Manager. AVD stands for “Android Virtual Device”. You can call it up from the system menu by clicking An-droid SDK tools and then right-clicking AVD Manager -> Run as Administrator:

1

When clicked the AVD Manager will launch:

1

I create virtual devices for each of the packages downloaded in the previous step 8. For each device, I create a phone and a tablet. Since I downloaded the packages for Android 2.3.3, 3.2, and 4.2, I created six virtual devices.

To create the Android 2.3.3 virtual device, select the New button on the menu, and fill in the information. The name of the emulator is Android233phone:

2

After all six devices are created, the Device Manager screen should look like this:

3

Now the fun starts. Let’s start up android233phone. From the AVD Manager. Select the android233phone entry and hit the Start button. You’ll get a dialog box as follows:

4

Page 22: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

22 Installing the Sybase Unwired Platform

Click Launch. The emulator appears! It will sit there forever and ever and ever. Don’t panic yet. It feels like minutes:

5

Then, finally, you will see this, which is good:

6

We are almost done. We need to put some Sybase stuff on the emulator. This is the database connectivity software as well as the workspace application which let’s you get to mobile applications which were developed as Hybrid Web Containers.

Open up a DOS prompt as administrator and load the ap-plication package files. By all means make sure the emulator is up and running. Use the AVD Manager to start it up, but make sure its up or the load will fail:

1. cd C:\SybaseSUP22\android-sdk\platform-tools

2. adb install C:\SybaseSUP22\MobileSDK22\Hyb-ridApp\Containers\Android\HybridWebContainer.apk

3. adb install C:\SybaseSUP22\MobileSDK22\ObjectA-PI\Android\SybaseDataProvider.apk

7

After loading the application packages, exit the emulator and launch it again with the AVD Manager. When the emulator comes up, click the menu button in the button grid above the keypad and then click the white tick-tack-tow grid at the bottom of the display area. Then you can scroll through the applications and find an icon with a circle bordered by an oval and two dia-monds. Click it and you will enter the Sybase Mobile Workflow application:

When you get there, a password screen will appear. It is part of the Hybrid Web Container. It appears each time the Hybrid Web Container is stsarted and will re-appear after a certain time-out period. Don’t ask me why.

Page 23: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

23 Installing the Sybase Unwired Platform

8

This entire sequence of launching an emulator and down-loading apk files should be repeated with the other five emula-tors.

Step 11: Configure Android DeviceThis step allows you to transfer files from the laptop to the

Android device via a USB cable. This is not how the Sybase Un-wired Platform works. It uses an internet connection for traffic, not a USB cable. We will configure this type of connection in Step 12.

However, we do have to download two Sybase Unwired Plat-form .apk packages to the device before deploying applications via the internet, and there are also cases where I develop non-SUP Android applications in which the quickest way to deploy them for testing is to copy the application to USB-connected de-vice.

So, to enable a download capability for the Android device, go to the developer site for your manufacturer. In my case, it is Motorola. As described way back in Step 2, I downloaded the program:

C:\Mark\supdownloads\MotorolaDeviceMan-ager_2.2.23.exe

Go ahead and open up a DOS prompt and execute the pro-gram. It will take you through an installation sequence:

1

2

3

4

Page 24: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

24 Installing the Sybase Unwired Platform

5

6

1

1

1

1

Page 25: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

25 Installing the Sybase Unwired Platform

1

1

1

1

Done. We should be able to send and receive data to the de-vice through the USB cable. Before you plug in the cable to test it out, you must configure some setting on your device.

Tap Settings -> Applications, then tap Unknown sources. Then, tap Development and tap USB Debugging. This enables the application to be installed on the device.

Then, connect your Android device to your laptop with a USB cable. When you connect for the first time, you get a setup screen:

1

Once this one-time-only screen is entered, the Motorola GUI is launched:

Page 26: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

26 Installing the Sybase Unwired Platform

1

From here, you can send and receive things. Under the cov-ers, a driver was also installed that will allow for programmatic download of files to the device.5

Now we need to load the special Sybase Unwired Platform Android Application Package (.apk) files to the device. We did this earlier for the emulator, and we must also do it for any An-droid device that will be running SUP applications.

With your Android device still connected to your laptop with a USB cable, check to see if the device is recognized for download. Run the Android debug utitity, adb. Open up a DOS prompt as administrator and cd to C:\SybaseSUP22\android-sdk\platform_tools. Then, run the adb with the devices option:

adb devices

6

You should see that the Android device is recognized. Now download the .apk files:

1. cd C:\SybaseSUP22\android-sdk\platform-tools

2. adb install C:\SybaseSUP22\MobileSDK22\Hyb-ridApp\Containers\Android\HybridWebContainer.apk

3. adb install C:\SybaseSUP22\MobileSDK22\ObjectA-PI\Android\SybaseDataProvider.apk

Step 12: Set up a NetworkIn the minimum scenario, when you are just developing a

native Android application using the Android Development

Kit (ADT) from android.developer.com, you can deploy it from your laptop (the Server) to a device by transmitting the pack-age across a USB cable which connects your laptop to the device. Once deployed in this manner, the mobile application runs in a standalone mode. It does not transmit data back and forth to the server.

For a full-blown Sybase Unwired Platform application, in-stead of deploying using the Android Development Kit, we are going to use the deployment capabilities of the Sybase Unwired Platform. This is more complicated since deployment will be across the network rather than across a USB cable.

Obviously if you are going into the business of deploying applications, you don’t want to go around plugging devices into your laptop with a USB cable, therefore the Sybase Unwired Plat-form network deployment method is the way to go. In addition, when your device and server are both on the network, transmis-sion of data is possible. Therefore, you can use your mobile ap-plication on the device, in conjunction with the Unwired Server on your laptop, to select, insert, update, and delete data from any database which the Unwired Server can connect to.

So, instead of plugging in your Android device into your laptop with a USB cable, connect both the laptop and Android device to a network that allows them to communicate with each other. At this point, I ran into some problems.

The first method I tried failed miserably. I connected both my laptop and device to the corporate Wi-Fi network, and im-mediately ran into blocked ports and corporate firewall issues. When the Sybase Unwired Server downloads the mobile applica-tion to the device, by default is uses port 5001. This port as well as any other port I configured was blocked, and no amount of coercion would sway the system administrators. One solution to this problem is to use the Sybase Relay Server or Sybase Afaria product which can proxy ports. Both products are sold separate-ly. Before going down this route, I decided to try a smaller solu-tion to my small 2-machine problem.

The next option was acceptable and worked perfectly. I set up a private Wi-Fi network consisting of 2 machines, my laptop and my Android device. To to this, I set up my laptop as a Wi-Fi hotspot. As a hotspot, my laptop became an access point with its own hotspot IP address. Other devices could then connect to my access point by opening the Wi-Fi connection of the access point. My access point contains applications (such as the Sybase Un-wired Server). It could connect to the public internet and could also do all types of other things expected from a service provider. This is exactly how coffee shops and airports do it all around the world, but in my case, the scope is limited to my laptop and my Android device (and anyone else who knows about my hotspot and the hotspot password).

A product called Connectify can turn your machine into a hotspot. This product is located at www.connectify.me:

Page 27: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

27 Installing the Sybase Unwired Platform

1

Download Connectify Lite to your laptop, install it, configure it, and set the password for your hotspot. Here is the installer:

C:\Mark\supdownloads\ConnectifyHotspotInstaller.exe

I had to give my hotspot a name in order to identify its Wi-Fi location. I called it:

Connectify-grasshopper1

1

2

3

When Connectify Lite starts up, you get a screen in your Win-dows tray. There is a button at the bottom of the screen which lets you start and stop the hotspot. You should start the hotspot.

Page 28: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

28 Installing the Sybase Unwired Platform

3

Now, on to the Android device. Connect to the Wi-Fi by go-ing to Setting -> Wireless & networks -> Wi-Fi Settings. In the resulting screen, you should be able to find Connectify-grass-hopper1. Connect to it and enter the password for the connec-tion. Once connected, the Connectify Lite screen on your laptop should show an entry for your Android device as shown below:

4

On your Android device, you should also see the connection information for Connectify-grasshopper1:

5

With this, we now have a private network between the Syb-ase Unwired Platform on the laptop, and the Android device. Now, instead of testing things with an emulator, we can down-load and test on a real device!

Make sure you can access SUP from the DeviceMake sure your Android device has access to the Unwired

Server running on your laptop. This will be the way to make sure you have a workable network configuration. To check connectiv-ity, first bring up the Unwired Server by running the Start Sybase Unwired Platform desktop as administrator. Then go to your An-droid device and call up a browser. Enter http://ipaddressofun-wiredserver:5001. You should see a white screen:

1

If you don’t see this, your Unwired Server is probably not running, or you haven’t got the IP address of your laptop correct. You’ll need to get this working before you can deploy to your Android device. Another showstopper might be that your lap-top has Windows Firewall Protection turned on. To turn it off, go to Control Panel->System and Security->Windows Firewall and toggle the settings:

Page 29: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

29 Installing the Sybase Unwired Platform

1

Step 13: Register the Devices in SCCThis is a one-time-only setup, applicable only to Hybrid Web

Container applications. If you are developing Native applications you don’t need to go through this setup.

In order to deploy any mobile application, there needs to be a communication path so that the application can be automati-cally downloaded from the server to the emulator or device. The place to define this communication path is in the Sybase Control Center (SCC). Once the path has been defined, then anytime you deploy the application to the Unwired Server, a copy of the ap-plication will be shipped out.

Before you start anything, make sure the Unwired Server is running. To start up the Unwired Server, run the Start Sybase Un-wired Platform desktop as administrator. Now call up the SCC. You can do this by running the Start Sybase Control Center desk-top as administrator. When it comes up, login with supAdmin for the user, and use the password you set up during the Sybase Unwired Platform installation. Click on Applications, and in the view in the right pane, click the Application Connections tab:

Let’s register an application connection for each possible device. In this article, we will be using the six device emulators mentioned earlier. We also have an actual device and this is reg-istered as well. Click Register. In the Register Application Connec-tion window, fill in the information for the device.

For the Sybase Unwired Platform verson 2.2, two things are extremely important. If you don’t do this right, nothing will work:

• Enter an ip address for your Unwired Server, not a host-name. In my case, this is the ip address of my laptop obtained from the ipconfig /all command. If you enter a hostname, deployments will silently fail. There are no clues whatsoever about what’s wrong. It took a day to figure this out.

• Enter an activation code. If you unclick Specify Activation Code and proceed, the box will get automatically re-clicked and you will be assigned a random 3-character activation code. You will never know it happened, so when you try to deploy your application, the deployments will silently fail again with no clues whatsoever. It took two days to figure this one out.

You will save yourself lots of debug time by entering an ip address and an activation code.

To register the android233phone emulator, here is what you do:

Page 30: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

30 Installing the Sybase Unwired Platform

1

2

Once done, you will now have some Application Connec-tion entries. The status will be “Pending Activation”. This is OK. Once we bring up the Android emulator or the Android device, a connection will be established and the status will go “Online”. Applications can be deployed and data can now be exchanged between the Unwired Server and the clients. Here is the initial state for android233phone:

Establish a Sybase Unwired Server registration from your Android emulator or device by tapping the Workflow icon from the main application page, and then entering the form informa-tion. This sequence is as follows.

Find the Hybrid Web Container icon:

1

Tap it, and enter the login information:

1

Tap Menu to see the configuration screen if it does not auto-matically appear. Enter the configuration information:

Page 31: MOBILITY Installing the Sybase Unwired Platform 2.2 for ... · PDF file3 Installing the Sybase Unwired Platform 2 My installation directory for the Sybase Unwired Platform is C:\SybaseSUP22

31 Installing the Sybase Unwired Platform

1

Tap Menu and then tap Save. Once this is done. tap Menu->Restart Engine. Then tap Menu->Show Log. You should see log entries indicating a connection. The SCC should show Online for android233phone.

The SCC status may switch back to Offline if the connection is lost, or the Sybase Unwired Server goes down, or if an emulator is brought up simultaneously. But, once things are back, and the emulator is running, and you have logged on to the Hybrid Web Container, the status will return to Online.

1

And that’s it. You can now build a Hybrid Web Application and deploy it. Native applications are a little different as far as registration goes, and I’ll cover all this later with examples.

ConclusionIn my experience, a major part to keep the Sybase Unwired

Platform working revolves around connections dropping back to Offline or remaining in a Pending Activation state. Workarounds usually involve restarting the Sybase Unwired Server or deleting and reregistering the devices using the SCC. If you can get past this as well as the installation process, then its just a matter of concentrating on developing applications.

The installation process is fairly long and there are not many ways to make it shorter. With the possible exception using the Sybase Relay Server instead of building a private WiFi network between the laptop and the device, everything else is required. Of course, introducing a Sybase Relay Server into the setup carries its own set of installation instructions.

I have attempted to include every component needed to develop an Android application using the Sybase Unwired Plat-form. Hopefully, this will help you through your own installation efforts.■