Category Archives: General

For stuff I forget to categorise! Doh!

Debugging to PA Server on Windows

PA Server – What and why?

When developing software for multiple platforms you often need to debug and run applications on machine and devices that are not your development PC. The RAD Studio and Appmethod approach to this is an ingenious little program that acts as a go-between from the IDE to the remote device / machine. Called PAServer (PA = Platform Assistant) allows the IDE to retrieve the full call stack at run time, pause code with break points, inspect values etc, exactly as you would do debugging a local application.

PA Server is often used on a Mac OS X target for running and debugging applications to Mac OS X, iOS Simulator and iOS Devices, however there is also a windows version of PAServer and this can also be used to simplify preparing for deployment.

PA Server runs over TCP/IP and while developers often use it for local network work, in theory there is no reason why you can not use it to remote debug that trouble some customer where you can’t quite recreate what they are doing. (as long as they are happy for you to install the PA Server client on their machine).

PA Server is also great for deploying files directly to a remote machine when used with the Deployment Options for the project. This ensures that all the files specified are pushed remotely. This is great for updating a remote server or internal build machines.

Installation of PAServer

PA Server needs to be installed on the machine you want to run applications on remotely The install files both Windows and Mac OS X are located in the PAServer folder under your Appmethod / RAD Studio / Delphi / C++ Builder installation. e.g. with RAD Studio XE7 they are located at C:\Program Files (x86)\Embarcadero\Studio\15.0\PAServer.

Both installers (Windows / Mac OS X) just require you to push the next button a few times to install the server.

Running PA Server remotely…

PA Server is ultimately a Console application that you launch, enter a session password (that remote developers will need to connect to the session) and leave running without having to go back to it, but this is how to launch it on each platform.

..on MAC OS X

To launch PAServer on a Mac you have two choices.

  1. Go to “Applications” and choose PAServer 15.0 (for XE7)
  2. Use the new GUI in LaunchPad called PAServer Manager PAServer Manager Icon

If you use PAServer Manager you will see the icon appear at the top of your screen in the menu bar. Clicking on this allows you to “Add Server” (I just call it MyMac by default) and then start and stop the services as well as other useful things like viewing the information (such as IP Address etc).  A lot easier than remembering command codes.

PA Server Manager

PA Server Manager is also useful for managing groups of developers who want to run multiple instances of PA Server on the same machine when developing.

..On Windows

To launch PA Server on windows once installed, you need to browse to the PAServer folder (typically C:\Program Files (x86)\Embarcadero\PAServer\15.0) and double click on the PAServer application.

PAServer on Windows Running
PAServer running on Windows

 Connecting to PAServer running on a Windows machine from the IDE

With PA Server installed, opened and a password set for the session, it is possible to make the remote connection (or even a loopback for a more advanced local test). To achieve this we need to configure a profile for connecting to the remote PAServer instance. – this is really quick to do.

Firstly select the desired compilation target of Win32 or Win64  in the Project Manager, and then right click and choose properties.  The platform properties window is then opened allowing you to choose a profile for the target.

Platform Properties

By default you will need to choose “Add New…” under platforms the first time you run this step, subsequently you will already have the profile saved.

 

Following the wizard for Add New, you can enter a name (e.g. MyPC) and then the IP address (port 64211 should be default unless you have changed it during install). Once you have the IPAddress or pc name entered you can “Test Connection” to verify that the path is working correctly.

Platform Properties Wizard 2

If this fails then check you IP Address is correct – if unsure type “i” into the PAServer console and hit enter to get a list of the listening IPAddresses and check your firewall.

Once you have selected the Platform Profile and its tested, all you need to do is hit run just like before.  Rather than deploying to your project directory, deploying to PA Server sends out all the files into a the PAServer scratch directory (under Documents\PAServer) e.g. C:\Users\Steve\Documents\PAServer\15.0\scratch-dir\

Tip for making things simple?

If you have selected any feature files or added your own files under Deployment Options when developing your applications, e.g. enabling InterBase, IBLite or DBExpress etc. These files will be packaged up for you when running out to PAServer giving you a complete folder structure with files ready for packaging. This also makes testing locally a lot lot simpler 🙂

Getting back to normal

Once you are done testing against a remote profile you can easily return to running locally by right clicking on the target and choosing to Revert to Default Connection.

Revert to default connection

Summer School 2014 – Android and iOS development training

Last year I had the pleasure of hosting the majority of the mobile development training series “Developer Direct – Summer School“.  It was great fun covering everything from Application UI design to local storage through to remote data collection.

The last year has seem some major enhancements to RAD Studio and Appmethod with new components making some of this easier and more exciting with new possibilities, so the content has been updated and re-run by David I and Jim McKeeth in both C++ and Object Pascal/Delphi programming lessons.

SummerSchool2014

To watch the 6 iOS and Android native development lessons register for free at http://forms.embarcadero.com/RADSummerSchool2014

Checking your Android device is ready for development

In this blog I want to take you through the steps for getting your Android device working with the standard USB device drivers, including steps to follow to check if what you have done has worked.

Jim McKeeth did a blog post a while back about installing custom specified Android devices that is worth reading if your device does not work with the standard drivers, however I would recommend trying this first.

Developer mode Enabled?

When you plug in your Android device, you will need to ensure you have  enabled developer mode and confirmed that you want to enable USB Debugging. Under “Setting”, you should be able to see

{ } Developer options

as a menu item. If you don’t, tap “About phone” menu item 5 times to start the messages about going into developer mode.

It is also worth checking at this point that “USB Debugging” is enabled under developer options. You will still need to confirm on the phone when you finally have it all setup and you plug the phone in for the first time, but this is the first steps.

Phone drivers installed?

On windows, you need to have the drivers installed for the phone to enable it for developer work. Once you plug the device in, check the device manager. If it shows under Other Devices with a yellow alert, then you will need to update the drivers.

Nexus 4 showing in Device Manger when its not installed correctly
Nexus 4 showing in Device Manger when its not installed correctly

You can download the drivers if you search the web for them and point to those, or you can download and install them easily with the Android SDK Manager.

Launching the Android SDK Manager

To launch the Android SDK Manager, first open a command prompt and navigate to the android SDK tools folder. With Appmethod / RAD Studio they will be installed by default in the public documents. You can reach them using the cd command. e.g.

cd \Users\Public\Documents\Embarcadero\Studio\14.0\PlatformSDKs\adt-bundle-windows-x86-20131030\sdk\tools

From the SDK tools folder type in Android and hit enter and the SDK manager will open.

Installing the USB Drivers

With the Android SDK Manager launched you can now see the packages installed / to update. Specifically we are looking for the Google USB Driver. (see image below) Once found, choose “Install xx packages” button at the bottom of the screen.

Android SDK Manager, USB Drivers ready to update
Android SDK Manager, USB Drivers ready to update

Note: If you don’t see it, then install any packages that are pending update, close and re-open. It should then connect back to the Internet and refresh the list and make the Google USB Driver visible ready to install.

Updating the device driver

Once you have the drivers on your machine, the next step is to update the driver back in the device manager.

Update Driver in Device Manager
Update Driver in Device Manager

Choose to browse the computer and go back to the PlatformSDKs folder (path above) and choose to search sub folders.

Set path to find Android SDK for Appmethod / RAD Studio
Set path to find Android SDK for Appmethod / RAD Studio

If you have not already said to “always trust” google inc. You should see immediately be asked to confirm installing the driver.

Confirm Install
Confirm Install

Once installed the Android Composite ADB Interface driver will be installed and you will get confirmation.

Confirmed, Driver Installed
Confirmed, Driver Installed

At this point, you should be able to see in the device manager the device is installed.

Android Device Installed
Android Device Installed

With the phone drivers installed, it is now time to check the ADB command line can see your device. If it can, then you are ready to use it for development.

Checking ADB can see your Android device

To check that ADB can see your device, its time to head back to the command line and run the ADB application.  ADB.exe lives in the ..sdk\platform-tools folder. From the command line you should be able to get there with something like…

cd \Users\Public\Documents\Embarcadero\Studio\14.0\PlatformSDKs\adt-bundle-windows-x86-20131030\sdk\platform-tools

Once your command prompt window is open at Platform Tools, run the following command to view the connected devices.

adb devices

The following screen below shows the output. Here I have my android device connected, but as yet I have not confirmed the connection on my phone as being allowed This causes the device to show as unauthorized.

Un-authroised Device
Un-authroised Device

If the android device shows as unauthorized then unlock the phone and choose to Allow USB debugging.

Approving Debugging for Android
Approving Debugging for Android

Once the device is approved, you should be able to re-run the ADB devices command and see the device id nows shows the status of “device”

ADB for approved device
ADB for approved device

At this point you are ready to use your android device for development! Refresh your Android devices in your IDE (right click on Android as a Target platform in the Project Manager and it will become visible.

Screen Shot 2014-07-30 at 17.13.58

@Appmethod and @InterBase in Sweden

Yesterday I had the pleasure of speaking at the 2014 Dev:Mobile event in Gothenburg on Navigating the enterprise road to mobile with @Appmethod and also around Secure Multi-platform database development with @InterBase.

Stephen Ball in Gothenburg with Appmethod

The sessions had lots of Interesting questions, some of which from the database side will be covered in the next weeks webinar “Rising to the data security challenge” (Wednesday 28th May)

There were lots of amazed faces seeing how with Appmethod you can develop fast applications faster with Visual Live Bindings, access to BaaS etc and still have the applications as compiled native code! For those wanting to learn more quickly then I recommend the new series of 20 minute drop in Developer Skill Sprints running every Tuesday and Thursday (starting on the 29th May)

Looking to rise to the data security challenge?

Join me on Wednesday 28th May as we rise to the database security challenge on Windows, Android, iOS, Mac OSX, Linux and Solaris.

Data security is a hot topic right now, and one that is causing a lot of headaches. When it comes to securing your data and applications, small changes can make a massive difference. During the webinar there will be a number of tips relevant to whatever platform or database you develop with. We will also look at how to address a number of these challenges easily by exploring secure database storage with InterBase.

To find out more on this topic, or even if you can’t make it and want to catch the replay later, register now and “Rise to the Data Security Challenge”.

Wednesday, May 28, 2014

  • 6AM San Francisco / 9AM New York / 2PM London / 3PM Milan
  • 11AM San Francisco / 2PM New York / 7PM London / 8PM Milan
  • 5PM San Francisco / 29-May 9AM Tokyo / 29-May 10AM Sydney

Mobilizing Enterprise data – Free White Paper.

If you want to get a head start before the webinar, then it may also be worth downloading this free white paper

RAD lectures at Jyväskylä University, Finland

Last week I was on the road again, this time visiting Finland for customer meetings but mainly to lecture and help with student lab time at Jyväskylä University. This trip was part of our commitment towards education and arranged by the local partner for Delphi and C++ Builder in Finland, Moonsoft@MoonsoftOy

Jyväskylä is about 4 hours drive from Helsinki and so I’m told the heart of a technical area where a lot of Nokia is based, so it was kind of fun to show off the Nokia X with Delphi App running that I picked up in Barcelona.

The lecture was hosted both in the university and streamed live and was the follow on to a number of sessions run earlier in the year by Juha Piispa from Moonsoft. After the lecture in the morning I had the pleasure of lunch with the dean before looking at some really old hardware, including what I was told was Finland’s first super computer and a massive IBM hard drive from before I was even born! Kind of geeky cool; before heading to the labs, where we had not 1 but 4 labs booked out (around 50 PCs) with students working together through a number of tutorials on http://docwiki.embarcadero.com learning about Visual LiveBindings, FireDAC and also the base language capabilities before running the output to both Windows preview and Android emulators / devices.

Unfortunately, I was so focused on what I was doing I forgot to take a load of pictures!

Are you sleep walking into XP end of life?

Today I came across an excellent blog post by Simon Rice from the ICO looking at the business reasons you and your customers need to look to get off XP. Microsoft XP goes end of life on 8th April.

iconewsblog.wordpress.com/2014/03/10/data-security-officers-set-your-alarms-10032014

If you are still developing on XP and on an old edition of Delphi of C++ Builder then now is a great time to upgrade with special offer running to the end of March for those on any old edition.

For more about the latest offers on RAD Studio, Delphi and C++ Builder, including a current promotion of 50% off the mobile pack for XE5 then visit http://www.embarcadero.com/radoffer now!

NokiaX + DelphiApp = Shipped;

Following on from my last blog post about the development of the 3D application created using Delphi Programming for iOS, Android, Windows and Mac from the same code base, I am now happy to confirm that the application is submitted, accepted and live on the Nokia App Store.

Nokia’s new direction seems to be to focus on earning money from the backend services serviced by Nokia and Microsoft. In a similar way Amazon took a base version of Android and added their own store etc, Nokia have done something very similar with then new phones. They have also gone to the length of wrapping a number of 3rd party API’s to their own services to make it easier for developers to migrate over to the Nokia store. This should solve the issue of developers not targeting the Nokia phones (due to WindowsRT) and will allow a great phone manufacturer to regain market share and value.

Honestly, I was surprised how easy it was to get the app published. To publish onto the Nokia app store (ready for the Nokia X being sold) you need to setup an account via http://developer.nokia.com/. You can also easily check your APK compatibility by uploading your APK file onto the website and get immediate feedback which was great (but not this is not acceptance of the app, just that it seems to be compatible). The hardest part of submitting my application was actually creating the icon and having to get screen shots in the right screen resolution, but this was easily solved with a device to hand by just running the APK on the device. Here is me doing this last week at the mobile world congress in Barcelona on the Nokia bus (note the Android Green colour scheme lol).

Following on from the initial submission, there is then a review process at Nokia that hopefully results in acceptance emails being sent over to you and your application shows as submitted. The Nokia development portal online is easy to navigate and under published content you can see the details of your submission and the current state of review.

 

nokiadeveloper2
Once approved, you can then use a Nokia X to download the application from their store. I think that as the store is in Beta right now the links are not publicly visible, but as soon as this goes live I will post that link up.

Anyway – As you can see I downloaded the approved application from the app store and by using the power and volume buttons was able to get a screen shot.

nokia3

I actually really like the Nokia X from first glance and I think its going to be a great (budget) phone, and the choice to use Android under the Windows Tile look and feel is a great move to gain share and developers to use the services that make the money behind the scene and help people get used to the Microsoft driven style.

The process of posting the application to the store was relatively simple and painless, but I was not using any advertising or anything else so I can’t comment on the experience of doing this, but over all, so far so good!

Will be really interesting to see what this means for the future of Windows Mobile, but right now: Nokia + DelphiApplication := Shipped!