Friday, 25 May 2012

InterBase links/info

This week’s instalment of the UK-based Developer Direct webinar series is called From Data to Business Information with RAD Studio XE2, which focused on InterBase, the multi-platform database that runs on Windows, Mac, Linux and Solaris. The following is a set of links and general information picked up during the broadcast.

Links:

Info:

  • Access InterBase from Delphi/C++Builder using:
    • InterBase Express (IBX) – components on the InterBase page of the tool/component palette. These surface lots of InterBase-specific functionality
    • dbExpress (DBX) – components on the dbExpress page of the tool/component palette. This accesses InterBase to the same level that any other database can be accessed.
  • InterBase supports triggers, which are special cases of stored procedures that are automatically called before/after insert/update/delete calls
  • InterBase supports events to notify client apps (e.g. using TIBEvents IBX component) of things of interest to avoid the need for polling. Event alerters in the DB are special cases of stored procedures associated with insert, delete or update operations.

Tuesday, 22 May 2012

C++Builder info/resources

Embarcadero seem to be ramping up their C++ machine now and are issuing a bunch of information on the subject of C++Builder. This seems in keeping with Microsoft who are doing the same, what with C++ being one of the standard tools for developing Windows 8 applications.

As recently posted, DavidI is delivering a weekly series on learning FireMonkey and this is broadcast twice, once for Delphi users and once for C++Builder users.

There is also a dedicated C++ webinar looming at the end of May. This will be presented by Dan Wahlin, a Microsoft MVP and is all about creating Windows and Mac OS X applications from a single C++ code base. The signup link is here.

A new C++ white paper is now available, entitled From Visual C++ to Mac in 90 Seconds, written by Jason Vokes. This looks at how readily Visual C++ developers can pick up FireMonkey to produce applications targeting the growing Mac user base.

An important posting came from John Ray Thomas, Embarcadero Director of Product Management, that being the C++ roadmap from Q2 2012. This lays out the plans for the new C++ tool chain, targeting 64-bit Windows, ARM for iOS and Android, support for C99 and C++11, BOOST and ACE and more. Much of this is already in Beta 1 and soon to enter Beta 2. The current plan is to support C++11, 64-bit Windows and iOS before the end of 2012, with Android support coming in the first half of 2013.

Given that C++Builder XE2 already makes use of a highly customised clang front-end, some have speculated (see the comments on this post) that it would make sense that a lot of this support would come from continuing this development and making use of the LLVM back-end, as that already supports multiple targets.

Finally, Embarcadero are offering the following deal to C++Builder users. If you buy XE2 with maintenance then you will get priority access to a preview of the new compiler as and when it starts appearing and also get you all this new functionality as and when it ships. In addition, the cost will be discounted by 20% until 29th June 2012.

Friday, 18 May 2012

Delphi Language links/info

This week’s instalment of the UK Developer Direct webinar series is called Delphi Language Focus (Object development, RTTI, 64 Bit). The following is a set of links and general information picked up during the broadcast.

Links:

Miscellaneous info

  • XML documentation comments against types, methods, etc. are automatically turned into descriptive tooltips through IDE facility called Help Insight. To ease the process of creating correctly formed XML comments for this purpose, you can use Documentation Insight. This is a third part tool (it’s the Express version DevJet’s Documentation Insight product) bundled with the IDE that adds in a window to the IDE to help automate the process of adding in the correct comments, based on editor context. To access Documentation Insight, press Ctrl+Alt+D or choose Tools, Documentation Insight, Show Documentation Insight
  • Ctrl+Shift+G generates a GUID and inserts it in the code editor, including the appropriate braces, quotes and square brackets
  • Extended RTTI is only supported on Win32/Win64, not currently OS X. At least I think this is what I heard. If so, this is most likely due to assembly code in the RTTI support code that is pending translation to be suitable for OS X.
  • Delphi now supports scoped enumerations, as per C# and the Oxygene language. This reduces the need for prefix letters on enum values.
  • TOSVersion is a new record type in the SysUtils unit to analyse which platform architecture and version you are running on.
  • Multi-platform enabled TZipFile is available in the System.Zip unit. It supports, among other things, adding an existing file into an archive but such that it is stored in the archive with another name.

64-bit information:

  • 64-bit Windows application development has been introduced in RAD Studio XE2
  • On 64-bit Windows, Task Manager highlights 32-bit (x86) applications by suffixing the process name with *32; 64-bit (x64) applications have no suffix.
  • The Project Manager’s Target Platforms section allows a VCL app to target either Win32 or Win64, and FMX (FireMonkey) applications can target Win32, Win64 or OS X.
  • A primary benefit of targeting 64-bit Windows is the ability to range as much memory as your machine can address. In the case of a 32-bit app running in a 32-bit OS, a max of 4GB of memory, but that includes memory reserved by the graphics card and various system devices and all the memory space Windows reserves for itself. Generally a 32-bit Windows OS can access between 2.75GB and 3.5GB max and user processes have a maximum accessible memory space of 2GB (or 3GB if Windows is started with a special switch). See this MS article for more details.
  • The size of pointer types (e.g. object references) change between 32-bit and 64-bit.
  • NativeInt is 32-bit or 64-bit based on target platform. The TComponent Tag property is defined to be NativeInt to cater for the common habit of developers storing pointers (such as object references) in Tag (with a suitable typecast).
  • Integer remains 32-bit when targeting 64-bit apps.
  • To build a 64-bit app all dependent libraries must also be 64-bit. 32-bit DLLs and libraries are not usable in 64-bit apps.
  • 64-bit has but one calling convention, very much unlike 32-bit. However the 64-bit compiler just ignores the Delphi calling-convention keywords register, pascal, cdecl & stdcall, so you can leave them in. No need for conditional compilation.
  • Assembler code: rewrite it in Pascal so it works on any target. Inline assembly code is platform-dependant and so will need rewriting for 64-bit and will require a _lot_ of learning – there are many differences. Additionally, if targeting OS X there will be a host of additional requirements thanks to the way the OS architectures differ.
  • 32-bit values (e.g. Integer) will shl & shr in 32-bit space.
  • 64-bit does not support the Extended type (well, ok it does, but it’s mapped onto the 10-byte type Double) but Delphi offers the TExtended80Rec record type to process extended values from binary data files.
  • Thursday, 17 May 2012

    Mono for Android 4.2 introduces a UI designer

    One of the common complaints regarding Android development, regardless of the development tool in use, is the lack of a good UI designer. The usual result is that UIs are designed in XML by hand.

    The people at Xamarin have clearly taken this rather seriously and spent some time building up a new UI designer for Mono for Android projects, which is now available in the recently released Mono for Android 4.2.

    The UI designer offers all the standard UI controls in the Visual Studio toolbox, and gives you the option of visual drag/drop/property editing or the more traditional manual XML editing.

    AndroidUIDesigner

    Also new in 4.2 is:

    Full details of the Mono for Android 4.2 release can be found on this announcement post.

    DataSnap information links/info

    Last Friday’s instalment in the Developer Direct webinar series was entitled Multi-tier, Scalable Development with DataSnap. During the session I collated the links and references together so i could post them here for reference (I’ll doubtless need some of them at some point).

    Random information picked up during the webinar:

    • in Delphi 2006, MIDAS (Multitier Distributed Application Services Suite) was renamed to DataSnap
    • Delphi 2007 re-architected DataSnap to be entirely written in Delphi and had all previous COM-dependencies removed. It was extended to support COM/DCOM, TCP/IP, HTTP & HTTPS
    • Delphi 2007 introduced a DBX (dbExpress) database driver to access data from remote DataSnap servers
    • DataSnap proxy classes can be regenerated (e.g. if the server has been extended to add functionality) using the context menu on the TSQLConnection component
    • Delphi XE DataSnap demos on Code Central can be made to work in Delphi XE2 by adding IndyPeerImpl into the project file uses clause
    • DataSnap servers are written using VCL so can be Win32 or Win64
    • DataSnap clients can be written on many platforms thanks to the wide range of mobile DataSnap connectors:
      • Delphi (VCL or FMX)
      • C++ (VCL or FMX)
      • C#
      • Delphi Prism
      • FreePascal (Delphi XE2 Update 4)
      • Objective-C
      • JavaScript
      • PHP
      • Java (inc. Android & Blackberry)
    • DataSnap server development requires the Enterprise or Architect version of Delphi, C++Builder or RAD Studio.

    Most of these notes I scrawled down as they came up so there is every chance the odd detail may be errant….

    Android development session at mobile-focused conference

    On 29th June, 2012 I’ll be travelling to Cambridge, UK to speak at Mobile East 2012, a mobile-focused conference. I’ll be delivering a session on Android development using RemObjects’ Oxygene for Java development tool and catching several of the other sessions during down-time on the day.

    I’m looking forward to it – it’s been some months since I’ve spoken at a conference!

    Tuesday, 8 May 2012

    Rooting a HTC Sensation XE

    A few months back I rooted my old phone, a HTC Desire, and put a custom ROM on it. I did this rather late in the day, after having upgraded to a newer HTC Sensation XE and encountered some stumbling blocks along the way thanks to various OTA (over the air) updates that had been installed on the older phone, which made many available rooting guides and tools out of date and unable to help. However, when eventually done, the phone received a custom ROM (Supernova), demonstrates a fabulous battery life and has all apps and data regularly backed up.

    The newer dual-core Sensation XE was demonstrating a sub-optimal battery life (whether or not this related to the recent OTA update to Android 4.03, or Ice Cream Sandwich (ICS), I couldn’t really be sure) and lacked a good solution for a thorough backup, so I thought it might be an idea to root this one also. This post is a write-up of various notes I’ve made getting my head around the quite complicated process of rooting a specific HTC Android phone.

    Friday, 4 May 2012

    FireMonkey information links/info

    I checked out today’s webinar on FireMonkey and collated a bunch of links and facts that came up during the presentation. Anyone looking at FireMonkey and wanting to get some background and foundation on the subject should check these out:

    Random information picked up during the webinar:

    • Delphi’s library delay loading is available on Windows but currently not on Mac.
    • C++Builder can readily consume a Delphi unit. Add the Delphi unit to the C++Builder project, then right-click on the file in the project manager and choose Make to produce a suitable C++ .hpp header file for inclusion elsewhere in the project.
    • Unlike the old Kylix project, Delphi & C++Builder in RAD Studio XE2 are both solely Windows applications. However Mac apps can be run and debugged across a network link using PAServer, which ships in the box. PAServer works on a specific port (64211 by default) so should be easy to configure in the context of a firewall.
    • Android support being looked at. When it is ready, your FireMonkey code will pay off and be usable on the Android platform.
    • Older toolbox code with assembly code needs work before it can be used with FireMonkey for cross-platform. Realistically it would be best re-written in high level Pascal code. Alternatively you would need to conditionalise and re-write for the various architectures (Mac, Windows 64-bit, Windows 32-bit), which presumably would involve a lot more work.
    • In FireMonkey control parents do not constrain the view of their children. A button on one side of a form can be a child of a control on the other side of the form, no intersection at all is required.
    • Frames. Create a form with all required controls, which in VCL might be done as a frame. At run-time add a layout on the form and set the parent of the would-be frame form to be the layout. The Biz Flow demo shows this in use.
    • David I is a big fan of the TMesh FireMonkey component.

    Getting Started with FireMonkey eLearning Series

    Over and above the Developer Direct series of weekly 2 hour webinars I posted about yesterday, I’ve also just bumped into a weekly series of training sessions on FireMonkey with David Intersimone.

    The format is a weekly half hour training session followed by 15 minutes Q&A, each Thursday, starting May 3rd 2012 (yes, I missed the start of this series too!) and running through to June 28th 2012. Each week there is a Delphi-oriented session (starting at 10am PDT, 1pm EDT, 5pm GMT, 6pm BST) and this is followed by the same session for C++Builder users (11am PDT, 2pm EDT, 6pm GMT, 7pm BST).

    You can sign up for the series at this link.

    Lesson Date Title
    1 03 May 2012 Introduction to FireMonkey and Development Environment Setup
    2 10 May 2012 Creating your First FireMonkey Desktop Application
    3 17 May 2012 The Integrated Development Environment
    4 24 May 2012 Programming Language Basics
    5 31 May 2012 Designing a FireMonkey HD User Interface
    6 07 June 2012 Connecting to Data
    7 14 June 2012 Creating a FireMonkey 3D Application
    8 21 June 2012 Using FireMonkey image and Animation Effects
    9 28 June 2012 Building Multi-Client, Multi-Platform, Multi-Tier applications

    Update: as the series goes on, this landing page is being updated with links to replays for the Delphi and C++ broadcasts as well as course workbook PDFs – great collation of resources from the series!

    Thursday, 3 May 2012

    Embarcadero Developer Webinar series

    I'm not sure why I didn't notice this series of free webinars starting, but i found out eventually, so that’s the main thing.
    Embarcadero have started a weekly series of 2 hour webinars on developing using their current RAD Studio toolset, RAD Studio XE2, primarily targeting a European audience, based on the broadcast times.
    You can see the list of webinars and their times and also register to take part using their sign-up link. The list of webinars is also shown in the table below.
    Episode Date Topic
    1 27 April 2012 Convince Your Boss To Upgrade You To RAD Studio XE2
    2 04 May 2012 FireMonkey : From Basics into Practice
    3 11 May 2012 Multi-tier, Scalable Development with DataSnap
    4 18 May 2012 Delphi Language Focus (Object development, RTTI, 64 Bit)
    5 25 May 2012 From Data to Business Information with RAD Studio XE2
    6 01 June 2012 Mac Development for Windows Developers
    7 08 June 2012 iPhone/iPad Development with RAD Studio XE2
    8 15 June 2012 RAD Cloud
    9 22 June 2012 Be Agile Today!
    10 29 June 2012 FireMonkey in Action...3D and Beyond! ….Plus! Season One Summary