Sup22installation
Upcoming SlideShare
Loading in...5
×
 

Sup22installation

on

  • 1,159 views

 

Statistics

Views

Total Views
1,159
Views on SlideShare
1,159
Embed Views
0

Actions

Likes
0
Downloads
16
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Sup22installation Sup22installation Document Transcript

  • MOBILITY Installing the Sybase Unwired Platform 2.2 for Android Devices By Mark Gearhart, SAP Contents dure is designed for a single instance of theThere is nothing more useful Sybase Unwired Platform on a Windows Introduction 1 7 laptop.when developing SUP ap- Step 1: Preparing Your Machine 2 Step 2: Download Packages 4 It is important to note that the Syb-plications than to work with Step 3: Install the Runtime Package 6 ase Unwired Platform is a fluid product.the entire product, self-con- Step 4: Install the SDK Package 10 Things have changed drastically from onetained, on your laptop. This Step 5: Install the EBF Package 13 release to the next. In fact, this installationarticle describes an installa- Step 6: Configure Unwired Workspace 14 procedure has been re-written four times Step 7: Install Android SDK 15 in the last year alone. The procedure is nottion of SUP 2.2 suited for this Step 8: Configure Android SDK 18 backward-compatible, and it may not betype of development environ- Step 9: Install ADT Plug-in 18 forward-compatible either.ment, and pulls together sev- Step 10: Create Android Emulators 21 The Sybase Unwired Platform is aeral installation procedures Step 11: Configure Android Device 23 platform used to build mobile applica- Step 12: Set up a Network 26into one place. Step 13: Register the Devices in SCC 29 tions. The nice thing about the platform is that you will be able to build some Conclusion 32 functional mobile applications which can send and receive data to databases on a Introduction host. Not only that, the database can be Over the last year, installation of the Sybase ASE, SQL Anywhere, Sybase IQ, Sybase Unwired Platform has gotten much or even SAP HANA. This, in my view, is better. Last year at this time, it took a day one thing that makes the Sybase Unwired to install. With the newest release of SUP Platform more valuable than the straight 2.2, the installation time has dropped to Android SDK mobile application develop- about 2 hours in my experience, following ment used by the general public. Sybase the steps described in this article. Many has added database connectivity to ap- errors and workarounds from previous plications running on mobile devices. Not releases have been fixed, and the external only that, if you write a native Application Android support packages have also been (versus an HTML5 Application), you can cleaned up quite a bit. create an Ultralite database on the device There are still many things to consider itself so that your application can operate when installing the Sybase Unwired Plat- with a local device database without even form. Since I install it several time per year being connected to a host. Mark Gearhart is a Senior Consultant as assignments, Sybase Unwired Platform For the simple installation described with SAP. He is involved in the devel- releases, and laptop contents change, this in this article, we will be installing the De- opment of database architectures and article is meant to be the reference point velopers Edition of the Sybase Unwired rich internet applications for temporal for installing the Sybase Unwired Platform Platform on a Windows 7 laptop. This edi- and realtime systems. His background without having to flip back and forth be- tion consists of an Unwired Server, a sam- encompasses the energy and financial tween several installation guides and in- ple SQL Anywhere database for applica- industries with a special interest in data ternet sites. This article captures, in one tion testing and a Software Development storage architectures and fast user inter- spot, a successful method for installing the Kit (SDK). We will also be installing an faces. He can be reached at mark.gear- Sybase Unwired Platform version 2.2, Android emulator, and of course the ac- hart@sap.com. with the latest EBF 20726 (SP01 PL01) for tual Android device. It will be connected Android devices. The installation proce- to my PC with a USB cable for test pur-1 Installing the Sybase Unwired Platform
  • poses. Additionally, I will also set up a private network between For the Sybase Unwired Platform 2.2, here are the support-my laptop and the device (in lieu of a Sybase Relay Server) to use ed android development environments and operating systemsthe system in realistic scenarios. straight from their documentation: Within the Sybase Unwired Platform, there is an Eclipse- android 4.0.4based Unwired Workbench that you use to build mobile appli- android 4.0cations, a Sybase Control Center which manages your growing android 3.2collection of mobile applications, an Android SDK (Software De- android 3.1velopment Kit) Manager, and an Android AVD (Android VirtualDevice) Manager. android 3.0.0 android 2.3.5 For larger installations, there can be multiple Unwired Serv-ers running in conjunction with things called Sybase Relay Serv- android 2.3.3ers and Sybase Clustered Enterprise Systems. But we’re not going android 2.3.2that far with the installation. We’ll just stick to something you can android 2.2.1get running on your laptop. android 2.2 Before starting the setup, there are two important things Also, make sure you are installing the Sybase Unwired Plat-you should know. The first is your laptop and Android device form on the correct OS. Although you can deploy an app to iOS,configuration, and the second is permissions for executing the you must use windows to develop the app and host the Sybaseprograms. Unwired Server. Here are the version 2.2 platform requirements: The Platform Operating System Service Pack CPU I am using my SAP-supplied laptop for the Sybase Unwired Microsoft Windows XP; Professional SP2, SP3 32-bit onlyPlatform installation. For purpose of Sybase product downloads Microsoft Windows Vista; Business, Enterprise, or SP1 32- and 64-bitand the Sybase Unwired Platform configuration, here is the in- Ultimateformation for my laptop that I used for during the installation: Microsoft Windows 7; Professional, Enterprise, or SP2 32- and 64-bit Ultimate • hostname: bth516785a Microsoft Windows Server 2003 SP2 64-bit • IPv4 address: 10.24.49.215 (this changes frequently) Microsoft Windows Server 2008 SP2 64-bit • Physical address: 00-21-CC-66 Microsoft Windows Server 2008R2 SP1 64-bit • platform: Windows 7 x64 You can find this information, except for the platform, by Watch our for Permissionsopening up a DOS prompt and typing ipconfig /all. The platforminformation can be found from Start -> Control Panel - > System. A lot of people think because they are associated to the localLook at the system type. That will tell you if you have a 32 or 64 admin account, they have admin-level rights and permissions.bit machine. This assumption is wrong for Windows 2008, Vista and Windows 7. The local admin account is really a power user’s account. With It is unusual to use your IP address for anything. Usually that in mind, always right click on a program and Run as Admin-a hostname will suffice. However, the Android emulator will be istrator; otherwise, things may not go so well when updating theunable to communicate with Unwired Server using a host name, system directories and registry keys.so an IP address will be needed instead. We’ll cover this later. In fact, I make it a habit especially for the Sybase Unwired I am also using my Android smart phone for the actual de- Platform to run everything as an administrator. Even when Iployment device. For the installation, I needed this information: open up a DOS command prompt, I always right click and Run • Device Manufacturer: Motorola as Administrator. • Android Version: 2.3.6 OK, let’s get started. To find the Android version, power up your device and gointo Settings -> About phone. You’ll see a line called Android ver- Step 1: Preparing Your Machinesion which contains your version number. Even though my An- If you use a VM, there are a couple things you must do:droid says version 2.3.6, which means that applications should • Build the VM for Windows 2008 R2 Standard 64 bit.be built using version 2.3.6 or earlier of the Android SDK, I laterfound out that I could load the latest Android SDK 4.2 and build • Make sure you have at least 8GB RAM on you host. Ifa “Hello World” application that would run on my 2.3.6 device. you try to run the VM with only 1GB RAM as I didHowever, it is probably a dangerous idea to assume that the An- once, then the product installation will take 6 hours in-droid SDK 4.2 is backward-compatible all the way to a version stead of 1 hour, and when you start up the Sybase Un-2.3.6 device. wired Platform, the Unwired Server start-up will prob- ably time-out and fail.2 Installing the Sybase Unwired Platform
  • • Define an environment variable $JAVA_HOME and point it to the JDK included with the Sybase Unwired Platform. • Loosen up the security for the Internet Explorer. Allow installation of a Flash Player 11 (Sybase Control Center will automatically prompt for download if not present). • Disable User Access Control and add a USB port so you can connect your android device via a USB cable and have it recognized by the VM. • If you want to use Connectify in order to set up a private WiFi network (more on this later), then you will need to 1 activate the .NET Framework in the VM. • You should run your VM from VMware Workbench or VMware VSphere Client, not through a Remote Desk- top Connection. RDC will prompt the Sybase Unwired Platform installation to ask for a served license which is overkill. You’ll probably need a System Administrator for some ofthis unless you are an Admin Rocket Scientist. I am old-school, so I usually prefer bare-metal. You do haveto clean up first from prior installations if you go this route. If you 2use a VM, then cleaning up from previous releases is not neces- My installation directory for the Sybase Unwired Platform issary because you can start off with a clean VM. I’ve installed sev- C:SybaseSUP22. Installshield for the Sybase Unwired Platformeral bare-metal versions of the Sybase Unwired Platform several “recommends” using the default path of C:SybaseUnwired-times on my laptop. Plus, I’ve had several SCC, SQL Anywhere, Platform. This is not a good idea. I have ASE, ASA and IQ on myASE and IQ installations as well as a couple JDK downloads. laptop as well, as well as multiple releases of each, so my prefer-Therefore, the windows registry has a lot of extra stuff in it. ence is to use a path which is specific to the product and version. The last time I installed the Sybase Unwired Platform ver- Even though I have overidden the “recommended” location forsion 2.1, the Unwired Workspace behaved strangely. After I con- the Sybase Unwired Platform, I’ve never had any problems be-nected to an ASE or SQL Anywhere databasee within the Enter- cause of this.prise Explorer View, I tried to click on the Tables folder for the Go to the release directory and run C:SybaseSUP22Un-databases. I got a Java runtime error. After cleaning up my lap- installersMobileSDK22uninstaller.exe as an administrator.top and re-installing the entire Sybase Unwired Platform release Here is the uninstall screen: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 thingsup. First, if you have a prior Sybase Unwired Platform installed,make sure both the SDK and the Runtime and the Android SDKTools have been uninstalled. Before uninstalling, shutdown allthe Sybase Unwired Platform services. These services show up inthe Windows Services below. If you have SUP 2.1 installed you’llsee a service called “Advantage Database Server”. In SUP 2.2, thisservice no longer exists: 13 Installing the Sybase Unwired Platform
  • Then, run C:SybaseSUP22UninstallersUnwiredPlat-formuninstaller.exe as an administrator. Here is the uninstallscreen: 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.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- One last thing. Remove the C:SybaseSUP22 directory. Af-ing on All Programs -> Android SDK Tools -> Uninstall Android ter all this cleanup, we should be ready to start the installation!SDK Tools: Step 2: Download Packages For 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:Marksupdownloads The Runtime and SDK Packages Let’s go get the SUP stuff. You can no longer go to the Syb- ase Product Download site at https://sybase.subscribenet.com in order to get downloads for the current version of products. This site now contains only old versions. Since this site seems to be changing, there is no telling how long you will even be able to go here. Instead, go to the SAP Support Portal at http://service.sap. com/support. You’ll be looking for entries for SYBASE UN-1 WIRED PLATFORM 2.2 (Installation Product): 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:4 Installing the Sybase Unwired Platform
  • 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 SDK This 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 PC My 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 Within this link, you can find an entry for Sybase Unwired laptop to the Android device, you’ll need to download a USBPlatform. Select this entry and go to downloads for the Enterprise Driver. I have a Motorola device, and I found the driver here:Developer Edition. Download both the Sybase Unwired Platform2.2 Runtime and the Sybase Unwired Platform 2.2 SDK for win- http://www.motorola.com/Support/US-EN/Support-dows x64. There are two versions of SUP, an Enterprise Edition Homepage/Software_and_Drivers/USB-and-PC-Charging-and a Developer’s Edition. I use the Developer’s Edition because Driversit comes with a sampledb, which is an SQL Anywhere database From this site, I downloaded this file:instance that you can use to store data in lieu of connecting to MotorolaDeviceManager_2.2.23.exean EIS backend system. The sampledb is very handy for testingand building mobile applications without the need for a big SAP For other manufacturers, you’ll need to find the USB Driverbackend installation or some other database installation such as which matches that manufacturer.ASE. Plus, when you install the Developer’s Edition, sampledb Another use for the Android USB Driver is to downloadwill automatically get configured as an available connection, and HybridWebContainer.apk and SybaseDataProvider.apk to theit will be placed into the Windows Services list so that it auto- device during the installation, as described in Step 11. You canmatically starts when you start up the Unwired Server. Very nice. also download them from google play through your normal pub- You will also need a license for the Runtime and SDK. For lic WiFi device connection, but I prefer to download the versioneither a virtual machine or a bare-metal machine, you can use that comes with the installation.an Unserved licences. This is fine for development purposes. In a Once you have WiFi connectivity between the Sybase Un-real production shop, you may want to consider a Served license. wired Server and your android device (via a private WiFi withEven though the instructions said I needed a license for the Syb- Connectify, or via non-blocked ports in your company’s WiFiase Unwired Platform SDK, nowhere in the installation did I use network), you never need to connect your device with a USBit. The procedure for obtaining licence keys varies depending on cable again. All SUP application deployments are done across thewhether you are a customer or a SAP employee, so you’ll have to network.refer to your own procedures for this. After you download the Runtime and SDK products, you Connectifycan unzip them and place the folders in two directories: There are a couple ways to set up a communication path be- C:Marksupdownloadssup2.2sup0220rtwin64_64_02 tween the Sybase Unwired Platform and your Android device. for the Runtime You can use an available public or corporate WiFi network with certain ports opened up, or you can use either a Sybase Relay C:Marksupdownloadssup2.2mblesdk0220win86_ Server or a private WiFi network between just your laptop and x64_3264 for the SDK your device. I often go for the private WiFi network for reasons Also download the latest EBF (or Service Pack, as SAP calls explained in Section 12.it), which can be found at www.sybase.com in the support section To configure a private WiFi nework, you can install Connec-under EBF’s/Maintenance, or at the SAP Support Portal under tify on your laptop. The download for it is here:SYBASE UNWIRED PLATFORM 2.2 (Maintenance Product). http://www.connectify.me5 Installing the Sybase Unwired Platform
  • The file to download is called: ConnectifyHotspotInstaller.exe I put everything in my supdownloads directory. When allthe downloads are complete, here is what the supdownloads di-rectory looks like:1 1Step 3: Install the Runtime Package Installing the Sybase Unwired Platform Runtime is fairly un-eventful. Make sure you have downloaded the Sybase UnwiredPlatform and generated a licence file. For the Sybase UnwiredPlatform Runtime, Sybase Unwired Platform SDK, and the Syb-ase Unwired Platform EBF, we will be working off the folders inthis directory: C:Marksupdownloadssup2.2 To install the Sybase Unwired Platform Runtime, run thefollowing executable as administrator: C:Marksupdownloadssup2.2sup0220rtwin64_64_02 setup.exe The sequence proceeds as follows: 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:16 Installing the Sybase Unwired Platform
  • 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: 11 1 The installation creates Sybase Unwired Platform services. These new services can be configured to start automatically1 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:7 Installing the Sybase Unwired Platform
  • 1 1 In the next screen, you will enter the supAdmin passwordfor the supAdmin account. This is the account you use when log-ging into the Sybase Control Center. It is also the account usedwhen 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 haveto be since the app will prompt for a new password upon the firstinitiation. In fact, in a production system you would never dosomething like this. 1 After you click Install, the progress bar will start up and you’ll wait for a couple minutes while the installation executes:18 Installing the Sybase Unwired Platform
  • 11 Once the installation is complete, the success screen will ap- pear:1 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:19 Installing the Sybase Unwired Platform
  • 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 installation1 of the SUP runtime platform if you configured it that way. There will also be three desktop shortcuts on your screen, Step 4: Install the SDK Packagefor Start Sybase Unwired Platform, Stop Sybase Unwired Platform,and Sybase Control Center: Like 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:Marksupdownloadssup2.2mblesdk0220win86_ x64_3264setup.exe The sequence proceeds as follows:1 New services will also be added: 110 Installing the Sybase Unwired Platform
  • 42 13 Right here is where you’d expect to enter a licence key. Butfor my installation, the screen did not appear. It doesn’t seem tobe a problem since the system operated as expected. After you click Install, the progress bar will start up andyou’ll wait for a couple minutes while the installation executes.Once the installation is complete, the success screen will appear: 111 Installing the Sybase Unwired Platform
  • 1 1 One thing to note about version 2.2 is the additon of the Mo- After the installation is complete, you will have a new entrybile Analytics Kit (MAKit). This is a new feature which provides in your system menu for Sybase -> Unwired Platform -> Unwiredthe support needed to build mobile charts and graphs. Workspace2.2. The entry will be a launch point for the Unwired Just as the installation is completing, a strange thing hap- Workspace: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 alreadypast the point of needing this, so I just close the browser.11 5 There will also be a desktop shortcut on your screen, for Start Sybase Unwired Workspace:12 Installing the Sybase Unwired Platform
  • 2 As the script executes, it shows the status of each step, and ends with a completion message:6Step 5: Install the EBF Package 2 To install the EBF, first shut all the services down. Find the Also upon completion, the script starts up the Sybase Un-desktop icons and left-click Stop Sybase Unwired Platform -> Run wired Platform services. Shut them down again, so we can installas Administrator. the EBF for the SDK: Now open a DOS prompt as administrator and run the in- C:Marksupdownloadssup2.2ebf20726sdk-sup-stallebf.bat file in the installation directory: portpack-2.2.1-uep22sdksp01p01-20121102.200347- 24-drop1installebf.exe C:Marksupdownloadssup2.2ebf20726rt-support-pack-2.2.1-uep22-20121101.051840-31-drop3installebf.bat 31 The script will ask for the SQL Anywhere database username and password for the SQL Anywhere instances configuredfor the product. It only asks once, so apparently all SQL Any-where instances have the same username and password. Enterdba 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: 1 As the script executes, it shows the status of each step, and ends with a completion message:13 Installing the Sybase Unwired Platform
  • 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:2 The EBF is now installed. This script does not start up theSybase Unwired Platform services, so they remain shutdown.Step 6: Configure Unwired Workspace Before you start anything here, make sure the Unwired Serv-er is running. We will need the sample SQL Anywhere databaseup as well as the Unwired Server so we can test out the connec-tions. Since we have now installed all the Sybase Unwired Plat- 1form products, this would be a good time to reboot you machine. The first thing to do is create a database connection and a Unwired Server connection. You’ll need to do this only once. To startup the Unwired Server, run the Start Sybase Unwired From then on, as you build projects within the Unwired Work-Platform desktop shortcut as adminstrator. 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,1 check the box so that the connection is opened everytime the Now let’s set up the Unwired Workspace. This is an Eclipse- workbench is started:based tool that is used to build the mobile applications, so you’llneed to get it configured before you start any kind of develop-ment. First set up the workspace area. This is a folder on disk whereall the projects will be stored. Instead of the default Windows 7C:Usersi830410workspace, which is equivalent to C:Docu-ments and Settings for other Window OS’s, I prefer to put theworkspace somewhere closer to where I usually navigate, but notin the SUP directory. I create a workspace as follows and alsocheck the box so I am not prompted all the time for a location: C:marksup22workspace 1 Next, proceed to the Sybase ASA Connection Properties:114 Installing the Sybase Unwired Platform
  • 1 1 1 The host name is the name of your laptop, and the port num- The password in the next screen needs to be filled in. It isber is 5500. This was the default port number of the SQL Any- the password you entered during your Sybase Unwired Platformwhere database when it was installed. The login is “dba” and the Runtime installation. Also check Save Password.password is “sql”. I usually check Save Password so I don’t have to 1reenter it all the time. Once all this is done, click Test Connection After the Database and Unwired Server are defined and con-to make sure the ping works, and then click Finish to save the nected, your Unwired Workspace should look like this: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 hereclick on the connection and adjust some of the options. First,check the box so that the connection is opened everytime theworkbench is started: 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 SDK This is a good time to reboot your machine. All the Sybase1 Next, proceed to the Unwired Server Connection Properties: 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.15 Installing the Sybase Unwired Platform
  • Now install the Android SDK by calling a DOS promt as ad-minstrator and running the installer: C:Marksupdownloadsinstaller_r21-windows.exe 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 the1 If all goes well you will see the following screen when you SDK development team many times, but not fixed.click Next. 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:SybaseSUP22JDK1.6.0_26 to C:Program FilesJavaJDK1.6.0_26 2. create a system environment variable JAVA_ HOME=C:Program FilesJavaJDK1.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:1 android-sdk_r21-windows.zip However, several times I’ve gotten this error: If you unzip this file to C:SybaseSUP22android-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:16 Installing the Sybase Unwired Platform
  • 1 2 1 When you get to this screen, enter the path for the AndroidSDK: C:SybaseSUP22android-sdk You can see the result by looking for a new directory in your installation:1 As the installation completes, you’ll get three screens: 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:117 Installing the Sybase Unwired Platform
  • 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:1Step 8: Configure Android SDK We are not quite finished with the Android SDK installation 1yet. Even though it is installed, we will need to check off a list of If you then look back at the original dialog box in whichinstalled packages by calling up the Android SDK Manager. You you selected the different versions of Android, you should seecan do this from the system menu by clicking Android SDK tools that everything was installed. In the event that something wasand then right-clicking SDK Manager -> Run as Administrator. not installed, go ahead and install it again. I may not have been You’ll notice a bunch of SDK Platforms for Android. These installed due to dependency conflicts with other installs.are the various flavors of the Android operating system. You canfind out what version your phone runs by looking under thephone’s Setting section, under About Phone. I have been selecting the latest SDK for Android 4.2 (API17), and also the SDK for Android 3.2 (API 13) and Android2.3.3 (API 10). My own phone currently runs API 10. 1 Step 9: Install ADT Plug-in The Android Development Tools (ADT) Plug-in provides a real nice interface to the Android SDK, making application de- velopment efficient (not my sentence).1 Before installing the ADT Plug-in, update the version of Eclipsed shipped with the Sybase Unwired Platform. If you don’t Select what you need. At this point you’re pretty much set. do this, you may run into errors as I did, because the baseline ver-Go ahead and click the Accept All radio button, and then click sion of Eclipse supplied with the Sybase Unwired Platform mightInstall. Things should proceed smoothly. You may have to click be to old.each individually and install sequentially if the Install button isstippled out. Some SDK components might have depedencies To update Eclipse, click Help->Check for updates...18 Installing the Sybase Unwired Platform
  • Upon completion, a list of updates will appear. Go ahead andselect all of them. 1 The update process will apply the updates and show a status in a dialog box:1 11 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.1 A license agreement screen will appear. Accept the terms I know things worked at some point or the product would neverand click Finish: 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/19 Installing the Sybase Unwired Platform
  • 1 Click OK. If you have trouble acquiring the plugin, try using“http” in the Location URL, instead of “https” (https is preferredfor security reasons). In the Available Software dialog, select thecheckboxes next to Developer Tools and NDK Plugins, and clickNext: 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.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, thenclick Finish. 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-1 dow > Preferences... to open the Preferences panel:20 Installing the Sybase Unwired Platform
  • 17 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 1this procedure until you click Proceed. When clicked the AVD Manager will launch: For the SDK Location in the main panel, click Browse... andlocate your downloaded SDK directory. Then click Apply. MySDK directory is: C:SybaseSUP22android-sdk After this, you will see entries in the SDK list for each of theSDK’s you configured. If you had configured more than one SDK,then you would choose which SDK to use and click Apply. In mycase, I am using Android 2.3.3 SDK, so I click this one and thenclick Apply, then OK. If you are developing applications targeted to different ver-sions of Android, you will no doubt become familiar with thisscreen as you switch between SDK’s.Step 10: Create Android Emulators 1 I create virtual devices for each of the packages downloaded An Android emulator is not the same thing as an actual An- in the previous step 8. For each device, I create a phone and adroid device. The Android emulator is a program that runs on tablet. Since I downloaded the packages for Android 2.3.3, 3.2,your laptop. It has a screen that looks kind of like the device. and 4.2, I created six virtual devices.Under the covers, it will have some ports open to the Sybase Un-wired Server so that it can receive a download of the mobile ap- To create the Android 2.3.3 virtual device, select the Newplication as well as send and receive data as it operates. The An- button on the menu, and fill in the information. The name of thedroid emulator is used to test your application before deploying emulator is Android233phone:it to the actual Android device. We create and launch the Android emulator by calling upthe Android AVD Manager. AVD stands for “Android VirtualDevice”. You can call it up from the system menu by clicking An-droid SDK tools and then right-clicking AVD Manager -> Run asAdministrator:21 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: 52 After all six devices are created, the Device Manager screenshould look like this: Then, finally, you will see this, which is good:3 Now the fun starts. Let’s start up android233phone. Fromthe AVD Manager. Select the android233phone entry and hit theStart button. You’ll get a dialog box as follows: 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:SybaseSUP22android-sdkplatform-tools 2. adb install C:SybaseSUP22MobileSDK22Hyb- ridAppContainersAndroidHybridWebContainer.4 apk22 Installing the Sybase Unwired Platform
  • 3. adb install C:SybaseSUP22MobileSDK22ObjectA- PIAndroidSybaseDataProvider.apk7 After loading the application packages, exit the emulatorand launch it again with the AVD Manager. When the emulatorcomes up, click the menu button in the button grid above thekeypad and then click the white tick-tack-tow grid at the bottomof the display area. Then you can scroll through the applicationsand find an icon with a circle bordered by an oval and two dia-monds. Click it and you will enter the Sybase Mobile Workflowapplication: 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 Device This 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 When you get there, a password screen will appear. It is part program:of the Hybrid Web Container. It appears each time the HybridWeb Container is stsarted and will re-appear after a certain time- C:MarksupdownloadsMotorolaDeviceMan-out period. Don’t ask me why. 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: 123 Installing the Sybase Unwired Platform
  • 2 5 63 1424 Installing the Sybase Unwired Platform
  • 1 11 11 125 Installing the Sybase Unwired Platform
  • 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 1out, you must configure some setting on your device. From here, you can send and receive things. Under the cov- Tap Settings -> Applications, then tap Unknown sources. ers, a driver was also installed that will allow for programmaticThen, tap Development and tap USB Debugging. This enables the download of files to the device. 5application to be installed on the device. Now we need to load the special Sybase Unwired Platform Then, connect your Android device to your laptop with a Android Application Package (.apk) files to the device. We didUSB cable. When you connect for the first time, you get a setup this earlier for the emulator, and we must also do it for any An-screen: 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:SybaseSUP22android-sdk platform_tools. Then, run the adb with the devices option: adb devices1 Once this one-time-only screen is entered, the MotorolaGUI is launched: 6 You should see that the Android device is recognized. Now download the .apk files: 1. cd C:SybaseSUP22android-sdkplatform-tools 2. adb install C:SybaseSUP22MobileSDK22Hyb- ridAppContainersAndroidHybridWebContainer. apk 3. adb install C:SybaseSUP22MobileSDK22ObjectA- PIAndroidSybaseDataProvider.apk Step 12: Set up a Network In the minimum scenario, when you are just developing a native Android application using the Android Development26 Installing the Sybase Unwired Platform
  • Kit (ADT) from android.developer.com, you can deploy it fromyour 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 astandalone mode. It does not transmit data back and forth to theserver. For a full-blown Sybase Unwired Platform application, in-stead of deploying using the Android Development Kit, we aregoing to use the deployment capabilities of the Sybase UnwiredPlatform. This is more complicated since deployment will beacross the network rather than across a USB cable. Obviously if you are going into the business of deployingapplications, you don’t want to go around plugging devices intoyour 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 1on your laptop, to select, insert, update, and delete data from any Download Connectify Lite to your laptop, install it, configuredatabase which the Unwired Server can connect to. it, and set the password for your hotspot. Here is the installer: So, instead of plugging in your Android device into your C:MarksupdownloadsConnectifyHotspotInstaller.exelaptop with a USB cable, connect both the laptop and Androiddevice to a network that allows them to communicate with each I had to give my hotspot a name in order to identify its Wi-Fiother. At this point, I ran into some problems. location. I called it: The first method I tried failed miserably. I connected both Connectify-grasshopper1my 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 wellas any other port I configured was blocked, and no amount ofcoercion would sway the system administrators. One solution tothis problem is to use the Sybase Relay Server or Sybase Afariaproduct which can proxy ports. The Sybase Relay Server is part ofthe Sybase Unwired Platform product and is not sold separately.It is either part of SQL Anywhere, SMP (SUP) or Afaria Afaria,however, is sold separately. Before going down this route, I de-cided to try a smaller solution to my small 2-machine problem. The next option was acceptable and worked perfectly. I setup a private Wi-Fi network consisting of 2 machines, my laptopand my Android device. To to this, I set up my laptop as a Wi-Fihotspot. As a hotspot, my laptop became an access point with itsown hotspot IP address. Other devices could then connect to my 1access 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 couldalso do all types of other things expected from a service provider.This is exactly how coffee shops and airports do it all around theworld, but in my case, the scope is limited to my laptop and myAndroid device (and anyone else who knows about my hotspotand the hotspot password). A product called Connectify can turn your machine into ahotspot. This product is located at www.connectify.me:27 Installing the Sybase Unwired Platform
  • 2 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: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 letsyou start and stop the hotspot. You should start the hotspot. 4 On your Android device, you should also see the connection information for Connectify-grasshopper1:28 Installing the Sybase Unwired Platform
  • 5 With this, we now have a private network between the Syb- 1ase Unwired Platform on the laptop, and the Android device. You realize, of course, that disabling the firewall can lead toNow, instead of testing things with an emulator, we can down- all sorts of security holes. Do do know this, right?load and test on a real device! Step 13: Register the Devices in SCCMake sure you can access SUP from the Device This is a one-time-only setup, applicable only to Hybrid Web Make sure your Android device has access to the Unwired Container applications. If you are developing Native applicationsServer running on your laptop. This will be the way to make sure you don’t need to go through this setup.you have a workable network configuration. To check connectiv- In order to deploy any mobile application, there needs to beity, first bring up the Unwired Server by running the Start Sybase a communication path so that the application can be automati-Unwired Platform desktop as administrator. Then go to your An- cally downloaded from the server to the emulator or device. Thedroid device and call up a browser. Enter http://ipaddressofun- place to define this communication path is in the Sybase Controlwiredserver:5001. You should see a white screen: 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:1 If you don’t see this, your Unwired Server is probably notrunning, or you haven’t got the IP address of your laptop correct.You’ll need to get this working before you can deploy to yourAndroid device. Another showstopper might be that your lap-top has Windows Firewall Protection turned on. To turn it off, goto Control Panel->System and Security->Windows Firewall andtoggle the settings:29 Installing the Sybase Unwired Platform
  • 1 2 Let’s register an application connection for each possible Once done, you will now have some Application Connec-device. In this article, we will be using the six device emulators tion entries. The status will be “Pending Activation”. This is OK.mentioned earlier. We also have an actual device and this is reg- Once we bring up the Android emulator or the Android device,istered as well. Click Register. In the Register Application Connec- a connection will be established and the status will go “Online”.tion window, fill in the information for the device. Applications can be deployed and data can now be exchanged For the Sybase Unwired Platform verson 2.2, two things are between the Unwired Server and the clients. Here is the initialextremely important. If you don’t do this right, nothing will work: state for android233phone: • 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 ipaddress and an activation code. To register the android233phone emulator, here is what youdo: 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:30 Installing the Sybase Unwired Platform
  • 1 1 Tap it, and enter the login information: 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 Tap Menu to see the configuration screen if it does not auto-matically appear. Enter the configuration information: 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.31 Installing the Sybase Unwired Platform
  • Conclusion In my experience, a major part to keep the Sybase UnwiredPlatform working revolves around connections dropping back toOffline or remaining in a Pending Activation state. Workaroundsusually involve restarting the Sybase Unwired Server or deletingand reregistering the devices using the SCC. If you can get pastthis as well as the installation process, then its just a matter ofconcentrating on developing applications. The installation process is fairly long and there are not manyways to make it shorter. With the possible exception using theSybase Relay Server instead of building a private WiFi networkbetween the laptop and the device, everything else is required. Ofcourse, introducing a Sybase Relay Server into the setup carriesits own set of installation instructions. I have attempted to include every component needed todevelop an Android application using the Sybase Unwired Plat-form. Hopefully, this will help you through your own installationefforts.■32 Installing the Sybase Unwired Platform