Category Archives: IDE

TListView DesignMode and DynamicAppearance

Getting to grips with TListView DesignMode and DynamicAppearance, part of the 10 Berlin release of RAD Studio

TListView

The TListView is a fast scrollable list that is typically used to display, select and navigate through data.

For those new to the TListView using FireMonkey see FMX TListView tutorial

TListView DesignMode

With the release of RAD Studio 10 Berlin, it is now possible to modify the look of TListView Items, TListView Header and TListView footer using the Toggle DesignMode.

When you right-click your list view on the Form Designer and select the new Toggle DesignMode, you enable the visual list view item editor. Rather than having to manually adjust the position of each component that makes up the item layout, you can now visually modify the control.

TListView DesignMode
Using the TListView DesignMode

TListView DynamicAppearance

The listview control also supports a new type of item appearance (also available for the edit mode), DynamicAppearance, that you can use to customise the elements that make up your list view: labels, images, buttons, and so on.

DynmanicAppearance for use with TListView DesignMode
TListView ItemAppearance set to DynamicAppearance, adding new items to the design

On your TListView item change the ItemAppearance property to DynamicAppearance, and then use the + to add in new objects.

Once added they appear under the Objects and can be renamed and modified manually as before or you can use the design mode to modify them.

 

Embarcadero Acquires Castalia and Usertility from TwoDesk Software

I did a blog post recently about Castalia which includes a video demoing some of the additional features Castalia adds to super charge the RAD Studio IDE.

Having played with it for over a month now, I’m really excited that it will have tighter integration in the future following the announcement yesterday that Castalia has been acquired by Embarcadero.

In addition to the news on Castalia, Usertility has also being acquired. This brings some exciting possibilities for the future around analytics and I can’t wait to see what happens further with this powerful add-on. Can’t wait to see how this fits into the single code base native IoT and multi-device development that we have today!

Full Embarcadero press release:

http://www.embarcadero.com/press-releases/embarcadero-acquires-castalia-and-usertility-from-twodesk-software

 

Castalia IDE Plugin Free with XE7 (ends soon)

One present I’m going to be playing with over Christmas is the Castalia IDE plug in. If you want to know why, check out the 10 minute demo here of some of the cool refactoring and IDE tools that Castalia provides.

Don’t forget if your latest version is XE2 your last chance to qualify for upgrade pricing is now.  http://www.embarcadero.com/radoffer

The Embarcadero sales teams will be in between Christmas and new year so there is still time to code smarter in the new year.

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

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