Welcome!

PowerBuilder Authors: Chris Pollach, Jayaram Krishnaswamy, Kevin Benedict, Avi Rosenthal, Yakov Fain

Related Topics: PowerBuilder, Wireless, iPhone

PowerBuilder: Article

A Look at Appeon Mobile

You can write iPad applications in PowerBuilder

The following article is an excerpt from Rik's upcoming book, ‘Mobile Application Development using PowerBuilder and Appeon'

I am here to tell you it's true. You can write iPad applications in PowerBuilder. I'm sure that you are waiting for the other shoe to drop but ladies and gentlemen, there is no other shoe. It is simply the truth. You can write iPad applications in PowerBuilder.

Those of you who have iPads, have you ever seen an MDI application running on an iPad? No? Neither had I. That is until I took a PowerBuilder application and, using Appeon, deployed to my iPad and ran the app.

I guess the only real catch is that the product is in Beta test and won't be available to the general public until spring 2013. Still, it's going to be well worth the wait.

I have a first round beta version of the product and have to admit, this is a solid product. So far I've seen just one small bug that I can easily live with.

The General Idea
Allow me to begin with a very high level view.

To begin what we have is an application server on one machine and the target machine runs the application (see Figure 1). This is not new technology. It's mature and works. So, the developer writes his application then deploys it using the Appeon toolbar. The steps used are very similar to Appeon for the Web.

In the deployment process the developer has two critical decisions to make. One decision is whether the server-side deployment goes on his own machine or another server. In a production environment it would go to another server almost always but during development it would probably go to his own local machine.

I guess that brings us to the first really important point. Like a web-based application, there is a part that runs on a server. This server might be your local machine, especially during development, or it might be a production machine somewhere on a network. It may even be a cloud. This is the machine to which PowerBuilder deploys.

Then there is the client-side machine. That would be your iPad or other mobile device. You can deploy this with an IPA file or through the Appeon WS application.

Now we have the application deployed to the host machine.

The other decision is whether to deploy the native iPad application as a stand-alone IPA file or whether we will use the Appeon WorkSpace IPA file. Appeon Workspace is a container IPA file that allows the developer to avoid the complexities and associated annoyances of packaging a stand-alone IPA file. For this article and in fact probably all future articles on this subject I will use the Appeon WorkSpace because it's just so easy.

Next we install Appeon WorkSpace on the iPad. Appeon WorkSpace can be downloaded from the Apple app store simply by searching for Appeon. Once you have installed Appeon WorkSpace you will be able to add new applications to it. In the process of installing a new application Appeon WorkSpace will prompt the user for the URL off the host (Server-Side) machine and the specific application to which you deployed. It will then download the application. Bear in mind that Appeon WorkSpace is just a container application.

First of all the owner of the iPad has to have installed the Appeon Workspace. Once that is installed the user opens Appeon Workspace and adds a new application to it. Appeon Workspace will prompt the user for the tcpip address of the host machine. That's how the connection is made.

The Development/Deployment Machine
For the sake of this article we are going to assume that these are the same machine. In fact, in a production environment you would have a deployment machine somewhere else. Where it is and how you access is so configurable that I won't even address it here.

Let's talk about your development machine. You must have IIS installed on your local machine if you are deploying to a .NET server environment. Appeon also supports a Java server environment. You also need PowerBuilder and a DBMS but this is standard for PowerBuilder programmers and you should be familiar with this.

If you are using the .NET Server environment then .NET 4.0 is also required. It's important that you get that right so here is how you check:

Got to c:\windows\Microsoft.NET\Framework (see Figure 2) and you should see a folder that starts with v4NNNN.

You can also check from IIS (see Figure 3).

Go to the Control Panel and select Administrative Tools, then select IIS Manager. I have two, one version 6 and 7 I use the latest version. Under connections I select Application Pools and it will, if properly configured, display several ASP.NET 4.X application pools.

Besides the .NET Framework you need to have IIS installed. To check that you just open a browser and type localhost. You should see something like Figure 4.

Now you have to test to see if you correctly installed AEM. To do that go to your browser and type http://localhost/aem You should see a webpage that looks like Figure 5.

Your screen won't look precisely like Figure 5. I compressed it a little so it would fit on the page of the magazine better.

Did you not see Figure 5? Did you see something like Figure 6 instead?

You may even see a screen that says something about a thread being aborted (don't you hate it when that happens?) This means you need to go back to your IIS manager and restart the web server. See Figure 7 for that.

Once you have installed everything you will need two pieces of information because we are about to head over to our iPad and set that up too. You will need the name of the router connection that your development machine is using. You will also need the TCPIP address of the machine that is hosting IIS.

To get your TCPIP address just go to the Start menu, then type ‘CMD' in the Search box. When you get the command prompt type IPCONFIG

In all that information you will find IPv4 Address. That is your TCPIP address. Write it down.

You will also need the name of your wireless router. Yes, it has to be wireless (The iPad can't connect directly to a router.)

Your iPad
The first thing to do is verify that your iPad can connect to your IIS on the server machine. Open Safari and for the address type http://DEV_TCPIP_ADDR/AEM. If AEM comes up then the connection between your iPad and your development machine is good. If AEM doesn't come up, make sure that your iPad and your development machine are connected to the same router.

There are two ways to install the mobile application that was deployed using Appeon to your iPad. You can deploy them in the traditional way using IPA files in the case of the iPad (or APK files in the case of Android) or you can utilize the Appeon WorkSpace pre-packaged IPA file.

The developer will probably find using Appeon WorkSpace to be more convenient so I will concentrate on that.

You have to install Appeon WorkSpace on your iPad. If you carefully followed the installation instructions it will be there. Open the application. You should see a gear icon in the upper right corner of the screen. If you tap that you will see Settings, More Information, Help, and About.

Choose Settings.

This is where you can change the settings of an application that you have installed or you can install a new application. In both cases they only need one piece of information: the URL of the server that your application is deployed to. This is going to be the http://ipAddress/appName. The ipAddress is the TCPIP address of your development machine, remember? That's what I told you to write down. The appName is the folder name under IIS where your application is deployed.

How do you know that folder? When you deploy your application from PowerBuilder using the Appeon Toolbar you will be asked to provide that folder name. You may want to write that down as well.

Developing Your Application
Developing your mobile application is almost the same as developing a Web-based application using Appeon. That is to say, it's almost the same as developing a classic PowerBuilder application. There are very few considerations. There is some unsupported functionality in Web and Mobile application development, but not much and you can easily work around it.

One difference in using Appeon is that now you have two deployment options. You can deploy to the Web or mobile. Of course you can still deploy a classic PowerBuilder application as well.

Let's look at the new Appeon Configuration dialog. There are some changes.

Notice the Project Type in Figure 8. There is the new Mobile type. If you click on the edit button you will be able to set this to be either a Web or Mobile deployment. I would suspect that in some cases you might have a project for Web and another for mobile. It won't matter, the code base is the same and that is, for me, one of the main attractions of Appeon.

Apart from that the configuration is about the same as for the Web.

Some Final Considerations
While your development machine is hosting iPad applications you will probably need to turn off your Windows firewall and virus protection, especially on Windows 7 PCs.

Sometimes your iPad application may fail to connect to your server IIS. That's usually because your router has dynamically reassigned your IP address. In that case you'll need to go back to Appeon WorkSpace on your iPad and update. Of course in a production environment this won't be the case.

This should get you going. In my next article we will discuss the Configuration tool on the Appeon Toolbar in PowerBuilder. Using this tool you define the specifics of the application that is deployed on your server.

More Stories By Richard (Rik) Brooks

Rik Brooks has been programming in PowerBuilder since the final beta release before version 1. He has authored or co-authored five books on PowerBuilder including “The Definitive DataWindow”. Currently he lives in Mississippi and works in Memphis, Tennessee.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.