Beruflich Dokumente
Kultur Dokumente
Contents
Introduction The Platform Step 1: Clean Up Your Machine Step 2: Download Packages Step 3: Install the Runtime Package Step 4: Install the SDK Package Step 5: Install the EBF Package Step 5: Configure Unwired Workspace Step 6: Install Android SDK Step 7: Configure Android SDK Step 8: Create Android Emulator Step 9: Install ADT Plug-in Step 10: Configure Android Device Conclusion 1 2 2 3 4 8 9 10 12 13 14 16 18 20
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 development used by the general public. Sybase has added database connectivity to applications running on mobile devices. For the simple installation described in this article, we will be installing the Sybase Unwired Platform version 2.1 on a Windows 7 laptop. The platform consists of an Unwired Server, an Advantage Database for used as a message repository, a sample SQL Anywhere database for application testing and a Software Development Kit (SDK). We will also be installing an Android emulator, and of course the actual Android device is connected to my PC with a cable so that I can download the applications. After I download, I can yank the cable and operate it. Within the Sybase Unwired Platform, there is an Eclipse-based Unwired Workbench that you use to build mobile applications, a Sybase Control Center which manages your growing collection of mobile applications, an Android SDK (Software Development Kit) Manager, and an Android AVD (Android Virtual Device) Manager. For larger installations, there can be multiple Unwired Servers running in conjuntion with things called Sybase Relay Servers and Sybase Clustered Enterprise Systems. But were not going that far with the installation. Well just stick to something you can get running on your laptop.
Introduction
The Sybase Unwired Platform has a lot of moving parts. Consequently, there are many things to remember when installing it. Since Ill be installing the Sybase Unwired Platform 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 between several installation guides and internet sites. This article captures, in one spot, a successful method for installing the Sybase Unwired Platform version 2.1 for Android devices. While part 1 of this article addresses installation mechanics, parts 2 and 3 will cover some basic procedures which can be used to build simple mobile applications for Android devices. These parts together can be used to quickly get up-to-speed or reintroduce concepts after a layoff. The Sybase Unwired Platform is a platform used to build mobile applications. The nice thing about the platform is
How to Install and Use the Sybase Unwired Platform for Android Devices
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 Platform
I am using my Sybase-supplied laptop for the Sybase Unwired Platform installation. For purpose of Sybase product downloads and the Sybase Unwired Platform configuration, here is the information for my laptop that I used for during the installation: hostname: bth516785a IPv4 address: 10.24.49.215 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. Well cover this later in part-2 of this article. I am also using my Android smart phone for the actual deployment device. For the installation, I needed this information: Device Manufacturer: Motorola Android Version: 2.3.4
To find the android version, power up your device and go into Settings -> About phone. Youll see a line called Android version which contains your version number. You should collect all this information about your laptop and Android device, and keep it handy.
My installation directory for the Sybase Unwired Platform is C:\SybaseSUP21. Installshield for the Sybase Unwired Platform recommends using the default path of C:\Sybase\UnwiredPlatform. This is not a good idea. I have ASE and IQ on my laptop as well, as well as multiple releases of each, so my preference 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, Ive never had any problems because of this.
How to Install and Use the Sybase Unwired Platform for Android Devices
Go to the release directory and run C:\SybaseSUP21\Uninstallers\MobileSDK\uninstaller.exe as an administrator. Here is the uninstall screen:
1
Now call up the Registry Editor and delete all registry entries from the previous installations. To run the Registry Editor, invoke the program Windows program regedit.exe:
1
I delete all entries which match the following searches - JDK, SCC, SUP21, and android. After the registry is clean, I move on and delete all the left-over system environment variables, specifically, 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 as noted in the lead-in to this section. Also delete the system environment variable SYBASE_MESSAGING_SYSTEM_HOME. This is the only platform-specific environment variable. I have no idea why the Sybase Unwired Platform has singled out a single variable when no other part of the Sybase Unwired Platform needs environment variables. Regardless, delete SYBASE_MESSAGING_SYSTEM_HOME anyway. One last thing. Remove the C:\SybaseSUP21 directory. After all this cleanup, we should be ready to start the installation!
Also remove the Android SDK if you have it installed. You can do this by going to the Windows Control Panel and clicking on Control Panel -> Programs and Features to launch the uninstall dialog:
It took hours to remove literally thousands of registry entries for JavaFX2.0SDK. I never used it. If I had known it was going to fill up my registry, I never would have installed it.
3 How to Install and Use the Sybase Unwired Platform for Android Devices
I like to get everything downloaded before I start the installation. Thats why all of this is in Step 2. I put everything in my downloads directory on my laptop, which is located here: C:\Mark\downloads
For other manufacturers, youll need to find the USB Driver which matches that manufacturer. I put everything in my downloads directory. When all the downloads are complete, here is what the downloads directory looks like:
1
How to Install and Use the Sybase Unwired Platform for Android Devices
How to Install and Use the Sybase Unwired Platform for Android Devices
How to Install and Use the Sybase Unwired Platform for Android Devices
After you click Install, the progress bar will start up and youll wait for a couple minutes. Once the installation is complete, the success screen will appear:
1
We are now done with the Sybase Unwired Platform Runtime installation. There a couple things to note. After the installation is complete, you will have a new entry in your system menu for Sybase -> Unwired Platform:
1
New services will also be added: There will also be three desktop shortcuts on your screen, for Start Sybase Unwired Platform, Stop Sybase Unwired Platform, and Sybase Control Center:
How to Install and Use the Sybase Unwired Platform for Android Devices
These new services are configured to start automatically when you start up your laptop. For me, thats bad idea because Ill just sit there instead of doing something productive. Therefore, I reconfigured 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 Im ready, and the services come up just fine. One last thing. You should now have a bunch of stuff in your Sybase Unwired Platform installation directory: C:\SybaseSUP21
How to Install and Use the Sybase Unwired Platform for Android Devices
Right here is where youd expect to enter a licence key. But for my installation, the screen did not appear. It doesnt seem to be a problem since the system operated as expected. After you click Install, the progress bar will start up and youll wait for a couple minutes. Once the installation is complete, the success screen will appear:
4
After the installation is complete, you will have a new entry in your system menu for Sybase -> Unwired Platform. The entry will be a launch point for the Unwired Workspace:
5
The script will ask for the SQL Anywhere database user name and password. Enter dba for the user name, and sql for the password:
There will also be a desktop shortcuts on your screen, for Start Sybase Unwired Workspace:
How to Install and Use the Sybase Unwired Platform for Android Devices
Upon completion, the script starts up the Sybase Unwired Platform services. Shut them down again, so we can install the EBF for the SDK: C:\Mark\download\sup2.1ebf\EBF19762\ebf19762\MobileSDK211-Build267-drop8p7\installebf.bat
3
Once in, you can set the window arrangement. Here is the window arrangement I like. You can set it from Window -> Open Perspective -> Mobile Development:
1
The EBF is now installed. This script does not start up the Sybase Unwired Platform services, so they remain shutdown.
The first thing to do is create a database connection and a Unwired Server connection. Youll need to do this only once. From then on, as you build projects within the Unwired Workspace, you can just open up those connections to use them. Using the database connection, you can grab table schemas to put into your MBOs (Mobile Business Objects). Using the Unwired Server connection, you can deploy your application. So here we go. Go down to the Enterprise Explorer (the lower left pane) and expand the Database Connection folder. Youll see an entry for My Sample Database. If you right-click on it, you can ping the SQL Anywhere database. You can also connect to it. From the default Sybase Unwired Platform installation, it looks like we already have a sample database to use and dont have to do anything extra unless we want to create a connection to another database:
There is a very active forum for SAP Mobility. It has participation from the SAP Mobility Engineering team. The site is at mobilityinternal.sybase.com
10
How to Install and Use the Sybase Unwired Platform for Android Devices
Now go down to the Unwired Servers folder. Youll see an entry here called My Unwired Server. Youll probably agree that this is not a great name. We actually want to have a connection to the Unwired Server running on our machine. I usually delete this entry and create one with a better name so I dont get confused about things. To create a connection, just right->click on the Unwired Servers folder->New...:
1
After the Database and Unwired Server are defined and connected, your Unwired Workspace should look like this:
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 note that the port number for the Message-based Sychronization is blank. If you click Test Connection, a ping executes, and if it succeeds then the port number will get filled in:
Thats it for now. Next we will get the Android stuff added and return for more Unwired Server configuration. If you have something other than Android, this is as far as you can go in this article. The rest of the part-1 and all of part-2 will be Androidspecific.
11
How to Install and Use the Sybase Unwired Platform for Android Devices
2.
This did not work either. My simple workaround was to press the Report Error button, close the report dialog, and sure enough, the Next button is now enabled. You can now press the Next button. Apparently, the development does not actually need a JDK, in order to install correctly. 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_r16-windows.zip If you unzip this file to C:\SybaseSUP21\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 youll have to hunt around and add them to your desktop manually. I did this the first time I tried the installation, so its not a show stopper if you absolutely cannot get the .exe to work. When you get to the next screen, enter the path for the Android SDK:
1
Ah, weve got a showstopper! An error will appear and 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 never 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:\SybaseSUP21\JDK1.6.0_26 to C:\Program Files\Java\JDK1.6.0_26
The installation shown in this article is not intuitive. Figuring all this out from two Sybase installation guides, four Sybase tutorials, five ISUG articles, and several Android, Motorola, and Eclipse web sites took a week. Hopefully, this will save you some time when you install the SUP.
12
How to Install and Use the Sybase Unwired Platform for Android Devices
and AVD Manager. This is the thing that will be missing if you install from the .zip file:
1
Youll 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 phones Setting section, under About Phone.
1
As shown below, there will also be a Android SDK Tools startup folder in your desktop menu, to start the SDK Manager
13 How to Install and Use the Sybase Unwired Platform for Android Devices February 16th, 2012
Select what you need. At this point youre pretty much set. Go ahead and click Install XX Packages and things should proceed smoothly:
1
It will take a while. A log file will magically appear to show you the progress. When things are done, youll see the last entry in the log file as Done loading packages:
1
I create a virtual device for each of the packages downloaded in the previous step 7. I downloaded the packages for Android 2.3.3 (which matches my own latest Motorola Android version) and 4.0.3 (which is the latest Android version). Each virtual device corresponds to an Android emulator. So, we have two emulators we can run to test our mobile application against two different versions of Android. 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 Android233: [Note: fix the name on this screen snapshot]
2
I do the same for Android 4.0.3 virtual device. Once done, you should see the following:
14
How to Install and Use the Sybase Unwired Platform for Android Devices
Now the fun starts. Lets start up Android233. From the AVD Manager. Select the Android233 entry and hit the Start button. Youll get a dialog box as follows:
Click Launch. The emulator appears! It will sit there forever and ever and ever. Dont panic yet. It feels like minutes:
If you go back to the AVD Manager, which should still be up, you can also try launching Android233. It looks about the same. 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 lets you get to your mobile applications. Open up a DOS prompt as administrator and load the application package files. By all means make sure the emulator is up on the screen. Use the AVD Manager to start it up, but make sure its up or the load will fail: 1. 2. cd C:\SybaseSUP21\android-sdk\platform-tools adb install C:\SybaseSUP21\ClientAPI\Workflow\ Android\SybaseDataProvider.apk
February 16th, 2012
Before deciding on which verions of the Android emulator to use, it might be a good idea to update your device with the latest release. I had an older release which was missing some download settings. I bought my phone new in mid-2011. On your phone, click Settings -> About phone -> System updates
15 How to Install and Use the Sybase Unwired Platform for Android Devices
3.
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 diamonds. Click it and you will enter the Sybase Mobile Workflow application:
When you get there, a password screen will appear. Im not sure what this is all about, but I entered the same password for my Sybase Unwired Platform Runtime installation:
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 checkbox next to Developer Tools and click Next:
16
How to Install and Use the Sybase Unwired Platform for Android Devices
In the next window, youll see a list of the tools to be downloaded. Click Next. Read and accept the license agreements, then click Finish. Note: If you get a security warning saying that the authenticity or validity of the software cant be established, click OK. You may have a problem here. The following is a window showing a problem with dependencies. It turns out that the bundled version of Eclipse which ships with the Sybase Unwired Platform may be old depending the baseline release, so youll need to update the Eclipse software.
3
There is a bug with the Sybase Unwired Platform version 2.1. Do not update anything with the words Data Tools Platform. If you do, then the database folders for connected databases will no longer operate. Once the updates are installed, try again. The installer may not allow the https URL previously used because it apparently remembers the previous URL and thinks youve already downloaded the ADT. So, use the alternate address instead. http://dl-ssl.google.com/android/eclipse/ This time, everything should work. When the ADT is downloaded, youll get this:
5
Go ahead and push the Restart Now button. Once the Unwired Workspace comes back, you will have some new entries under your Window pulldown:
To update Eclipse, cancel out of the error window and run Help->Check for updates:
To get an idea of how a mobile database application might behave, check out Ian Thains 7-part YouTube series at YouTubes SUPDeveloperPrograms channel. Its shown against an older version of the Sybase Unwired Platform, but still relevant.
17
How to Install and Use the Sybase Unwired Platform for Android Devices
For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. Then click Apply. My SDK directory is: Now that the ADT plugin is installed, we can configure it. Modify your ADT preferences in Eclipse to point to the Android SDK directory. Select Window > Preferences... to open the Preferences panel:
7
C:\SybaseSUP21\android-sdk After this, you will see entries in the SDK list for each of the SDKs you configured. Choose which SDK to use and click Apply. In my case, Im using the Android 2.3.3 SDK. This SDK matches the version of the Android emulator I built, called Android233, using the AVD Manager:
9
Select Android from the left panel. You may see a dialog asking 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:
18
How to Install and Use the Sybase Unwired Platform for Android Devices
Go ahead and open up a DOS prompt and execute the program. It will take you through an installation sequence:
1
This will allow the download to happen. Youll also need to adjust a few settings on your device. Go to Settings -> Applications, then check Unknown sources, then enter Development and check USB Debugging. This enables the application to be installed on the device. To check if the device is properly connected, you can run the Android debug utitity, adb, to check this out. Open up a DOS prompt as administrator and cd to C:\SybaseSUP21/ android-sdk\platform_tools. Then, run the adb with the devices option: adb devices
6
Whichever manufacturer you have, youll be looking for something called a USB Driver for Microsoft PC in your google search. There were lots of results for Motorola, and I managed to find one from the Motorola site itself.
19
How to Install and Use the Sybase Unwired Platform for Android Devices
You should see that the android device is now recognized. I think we are done with the installation. Yes, we are done!
Conclusion
That was quite long and involved. If you go through the official installation guides, there seems to be a lot of hand-waving and vagueness (e.g. refer to the this-and-that web site for details). In my opinion, the offical guides are not very good for someone coming into this unless theyve already done Android development. It would be nice to see if someday the installation can all be boiled down to a single installshield similar to what exists for Sybase ASE or Sybase IQ. For now though, youll need to handle on all the parts individually. In parts 2 and 3 of this article, we will build two applications. The first will be a simple Hello World to test the simplest possible application. The second will be a database application which will load data from a table on my laptop into a data grid on my device, and allow selection from the data grid. For both applications, we will test them through the Android emulator and the actual Android device.
20
How to Install and Use the Sybase Unwired Platform for Android Devices