Delphi Handbooks Collection

Delphi XE Handbook

Delphi 2010 Handbook

Thursday, August 28, 2014

RAD Studio Tech Preview Webinar on September 4

Next thursday Embarcadero will host a tech preview webinar of the coming version of RAD Studio, Delphi, and C++Builder. If you want to know what's coming in the next version of our products, sign up now!

Next thursday Embarcadero will host a tech preview webinar of the coming version of RAD Studio, Delphi, and C++Builder. If you want to know what's coming in the next version of our products, sign up now at  forms.embarcadero.com/RADXE7FirstLookWebinar . The webinar will show the new product in action, with extensive demos and technical details.

At this point I guess you'll be wondering which new features are going to be covered and when the product will be announced. For that, you'll have to wait until next week. As you can read in the webinar description:

"Join Embarcadero’s John Thomas and Marco Cantu for this exclusive Tech Preview webinar for RAD Studio to:

  • See new and revolutionary innovations in multi-device development
  • Learn how to easily build and deploy enterprise services
  • Get expert advice on building connected apps..."

What does this exactly mean? At the webinar you'll see a breakthrough in designing multi-device user interfaces... but there is more. What if we also had a brand new parallel programming library you could use on all your existing VCL and FireMonkey applications? Enough said...





Monday, August 25, 2014

Mobile Platforms August 2014

Some completely personal consideration on the current status of mobile platforms, with a few interesting links.

Some completely personal consideration (not an Embarcadero point of view) on the current status of mobile platforms, with a few interesting links. Given this is a specific topic, I didn't want to include these in my Delphi bi-weekly blog posts. These are mobile posts with some comments:

IDC numbers regarding last quarter smartphone shipments (that is, new phones), indicate that Android lead is growing (both in absolute and relative numbers), iOS is growing in absolute numbers but reducing in market share, while Microsoft is doing pretty bad on both counts: http://www.idc.com/getdoc.jsp?containerId=prUS25037214. From the graph you can also see that iOS has a good percentage on the high-end devices (which is why Apple keeps making a lot of money), while Microsoft is focused on the lower and, even more than Android.

I find some Microsoft defenders tentative to belittle iOS a little childish. See for example Thurrott (see winsupersite.com/windows-phone/how-perception-will-kill-windows-phone): the value of the iOS market is beyond the device numbers. The Apple ecosystem is very healthy. Latest estimates I saw (sorry, cannot find the link any more) claim the developer ecosystems for iOS and Android to be very similar in size. What's about Microsoft? Their quality App Store seems not so quality driven (not that Android is that great, either, but it was supposed to be a great differentiator for Redmond).

Not saying this is the complete picture... but this is how it looks to me. Do you think Windows phone still has a real chance? That Android dominance is going to reduce over the next couple of years (by iOS, Windows, Tizen, or some other OS)? I think Google greatest enemy is Android forks, like Amazon, the many in China... and the now defuct Nokia X.

Update

Found a related additional article on Forbes about how the apps define the ecosysten and lock it: www.forbes.com/sites/ewanspence/2014/08/26/how-every-app-developer-helps-defend-android-and-ios-against-a-smartphone-revolution/

Tuesday, August 19, 2014

Fix for Buffer Overflow in VCL Bitmap Processing Code

A potential buffer overflow condition in the VCL bitmap processing code (specifically in the function PaletteFromDIBColorTable) could be potentially used to inject malicious code into an application. The problem goes back to the early days of Delphi (and C++Builder) and a code fix is available for all.

A potential buffer overflow condition in the VCL bitmap processing code (specifically in the function PaletteFromDIBColorTable) could be potentially used to inject malicious code into an application. So this is a serious issue and you are recommended to apply the patch to your new and existing Delphi and C++Builder applications.

If you have an XE6 version, there is a ready-to-install hot fix at  http://cc.embarcadero.com/Item/29913 (BMP Buffer Overflow hotfix). If you have an earlier version, you should follow the step provided at  http://support.embarcadero.com/article/44015 . The support article shows the two lines of code you shoudl add to the VCL.Graphics unit (or Graphics unit, if you are on an older version). Notice that the problem goes back to the early days of Delphi (and C++Builder) and a code fix is available for all, although there might be small differences in the source code to patch. 

For the record, the issue was found from an external security compnay, which correctly waited for our patch before an official announcement. As David W. mentioned on the Google+ Delphi Community at plus.google.com/u/0/116430453567926016001/posts/jgRhsy2TeKn: "This is the first security fix for Delphi I remember ever seeing. " Which is cearly good, given how many secutiry patches most other software programs require. Just saying.

 

Thursday, August 14, 2014

New AdMod Interfaces for Delphi XE6

Since August 1, Google Play Store doesn't accept apps that use the old AdMob API, making the upgrade to the new advertising API from Google Play Services compulsory. An update for RAD Studio XE6 is available, here is how to use it.

Since August 1, Google Play Store doesn't accept apps that use the old AdMob API, making the upgrade to the new advertising API from Google Play Services compulsory.

An update for RAD Studio XE6 is available (for registered users of one of the XE6 products) at  cc.embarcadero.com/item/29911 . Download and install it, and you are ready to go.

The update offers a version of the TBannerAd component that hooks to the new Google Play Services. You can keep using the same banner ID, so this means that you have nothing to do on your source code to migrate your applications to the new advertising API.

All good? Not exactly. If you run the app... it will simply crash. The reason is that you need to change the manifest file to indicate you want to use this new API, and you'll have to include lines like the following: 

      <meta-data 
      android
      :
      name
      ="com.google.android.gms.version"
      android
      :
      value
      ="4323000"/>
      <activity 
      android
      :
      name
      ="com.google.android.gms.ads.AdActivity" 
  android
      :
      configChanges
      ="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
      

A sample manifest file is included in the download. If you have an existing application, you'll have to update the manifest adding the "meta-data" line and replacing the secondary activity with the "gsm.ads" version. For a new application or if you never edited the manifest manually, just use the one included with the update.

By default, in fact, the manifest you get from the IDE doesn't support features like push notifications or advertising, which require extra line. Notice that the current documentation at docwiki.embarcadero.com/RADStudio/XE6/en/Adding_Advertising_to_Your_Mobile_Apps still lists the older manifest entries. 

 





Tuesday, August 5, 2014

August Series of Developer Skill Sprints

After the success of the June/July series, mostly done internally by Embarcadero folks, the Developer Skill Sprints gets back with an August series including many MVPs.

After the success of the June/July series, mostly done internally by Embarcadero folks, the Developer Skill Sprints gets back with an August series including many MVPs. If you haven't attended these webinars in the past, these are 20-minute online live tutorials on software development for Windows, Mac, Android and iOS. Languages used are Object Pascal and C++, and tools are C++Builder, Delphi, RAD Studio, and Appmethod.

You can register at forms.embarcadero.com/DeveloperSkillSprintsWebinarSeries  (I think your existing registration to the previous series will remain valid).

The current list of speakers (but we plan expanding the series into September) includes Ray Konopka, Alister Christie, Roman Yankovsky, Pawel Glowacki, Nick Hodges, Jeff Lefebvre, Bruno Fierens, and Cary Jensen. With their precious help, this webinar series will be even more interesting.

 

Monday, August 4, 2014

Delphi Blogs of the Week (or Month) #15

It has been a while, among business trips and some vacation. Here is a collection of noteworthy links, covering most of July.

It has been a while, among business trips and some vacation. Here is a collection of noteworthy links, covering most of July.

Embarcadero and Related

Mobile Development

Mobile Store Apps

Various

That's all for now. I hope to be a little more regular in the coming months, but given the workload, I kind of doubt.

 

Thursday, July 17, 2014

Apache Support in Delphi XE6

Today I'm giving a Developer Skills Sprint on Apache support in RAD Studio XE6, and I'd like to complement the session with this blog post, showing some of the code and providing the same hints and suggestions.

Today I'm giving a Developer Skill Sprint on Apache support in RAD Studio XE6 (I already gave the first session live, the recording will be replayed), and I'd like to complement the session with this blog post, showing some of the code and providing the same hints and suggestions.

First of all, the Apache support is part of WebBroker foundations, and so it can be used for direct WebBroker applications, DataSnap applications based on WebBroker, SAOP servers, and many other scenarios. In a simple WebBroker application, you now have the following options:

If you pick Apache, you'll see a second rather useless page asking for VCL or FMX compatibility (for the generated data module), while the third page has the Apache specific options:

Here you can set the version of Apache (this results in a specific unit being referenced, displayed in the third box, which you can easily change later) and the module name (which is also the project name). As you finish, you'll get a project made of a standard WebBroker data module plus a specific library project file.

Remember that depending if you have a 32 bit or 64 bit version of Apache, you'll have to compile the module as a Win32 or Win64 Delphi (or C++Builder) project.

This generated file includes, as comments, the Apache configuration. So if you go with all default, you'll have the following configuration suggestion:

 LoadModule webbroker_module modules/mod_webbroker.dll
 <Location /xyz>
    SetHandler mod_webbroker-handler
 </Location>

In the LoadModule directive the first element is the internal module name, which is the name of the exported configuration data:

var
  GModuleData: TApacheModuleData;
exports
  GModuleData name 'webbroker_module';

You can easily change that string and update the configuration accordingly. The second parameter of LoadLibrary is the DLL name.

The Location directive, instead, indicate the virtual URL the module is mapped to (/xyz in the demo) and the "handler" that is going to be processed. The module, in fact, registers a handler with Apache, and everything meant for that handler will be passed to the module. The default handler name is generated automatically form the project name, like  mod_webbroker-handler . If you want to use a custom handler name, you'll have to take the second line of the project initialization code,

  Web.ApacheApp.InitApplication(@GModuleData);

and change it by adding a second parameter to InitApplication, which is exactly the handler name. So you could change this to:

  Web.ApacheApp.InitApplication(@GModuleData, 'myhandler');

and update the configuration accordingly as:

 <Location /myurl>
    SetHandler myhandler
 </Location>
That's it. In the actual skill sprint I also discussed how to configure Apache as a proxy server to connect to a stand alone HTTP server executable. This is the relevant code snippet for reference:
  ProxyPass /another http://localhost:9099
  ProxyPassReverse /another http://localhost:9099
  ProxyPreserveHost On 
There are two more editions of the skill sprint today, and the replay will soon be available as well. I'll add a comment to this blog post when I'll have the replay URL.




Thursday, July 10, 2014

Versioning Mobile Store Applications

As you publish single source applications written in Delphi on the Apple App Store and the Google Play Store, you easily bump into an issue: each store uses a different version numbering rule.

As you publish single source applications written in Delphi on the Apple App Store and the Google Play Store, you easily bump into an issue: each store uses a different version numbering rule. This is my direct experience with the "My Minifigures" app I wrote with my son and published on both stores (see the links above).

On both stores, you have the concept of a version number (like 1.1) and a release number (like 14). In Delphi, you can enter those easily, doing manual increments or letting the system increase the release number at every build.

The way these version numbers are used, however, is totally different. On the Play Store, what matters is the internal, progressive release number. Each following release must have a higher release number (15, 16, 17 and so on -- but you can skip some). Rather simple. This implies that the version number is an additional information you can show to users, but nothing relevant for the store. Internally, the APK version is just a number:

This is the corresponding project options pane:

On the App Store the situation is exactly the opposite. While you can use build numbers as you wish, you need to use a "two elements" versions number, like 1.1, which have to be increased at each release in logical sequence (like 1.2, 1.3, 2.0, 2.1, etc). This is how the version is reported in iTunesConnect:

This is the specific project options pane:

So, how can you handle a common course with synchronous releases? basically by merging the two mechanisms and keeping them in parallel. As an example, if you have a release version 1.1.14 the next one could be 1.2.15. That is, version 15 for Android and version 1.2 on iOS. Actually if you see the Delphi project settings and the corresponding versions in the stores in the four images above, you can see the numbering schema I'm using for this app. 

Wednesday, July 9, 2014

Delphi Blogs of the Week #15

A little busy and it took a little to move the server hosting this blog, but here am I again with a other round of links.

A little busy and it took a little to move the server hosting this blog, but here am I again with another round of links.

RAD Studio and Appmethod Development 

Other Notable Blog Posts and News

 

Wednesday, June 25, 2014

RAD Studio Recharge Plan, Again

Just wanted to remind all of the existing XE5 users that they have a chance to upgrade to XE6 for a low cost, but should do that now.

 

Just wanted to remind all of the existing XE5 users that they have a chance to upgrade to XE6 for a low cost, using the recharge plan. This is automatically active for anyone who owns a license of Delphi XE5, C++Builder XE5, or RAD Studio XE5, with any edition (safe for the Starter). With recharge you can move your Professional or Enterprise license, and even higher SKUs and add-on packs, to the same edition of the last version of the product, XE6. The cost of a recharge is slightly less than half of the regular upgrade cost, so if you recharge twice in an year you end up saving, not spending more!

Notice that this is a one-time deal, that you'll be able to re-use again to move from XE6 to XE7 or so forth, but it has no implications for future upgrades. You get into the "recharge plan" anytime and get out any time: Just recharge your license to the latest, if applicable, and continue doing so for as long as you wish. No strings attached, no obliation, no upfront fee (like in the maintenance).

Of course, if you are interested you need to act now. The sooner you recharge, the more you take advantage of the value. You won't be able to recharge once we ship a new version, but waiting until the end of the release cycle will dilute the "recharge plan" value, compared to traditional upgrades.

Notice also that you can buy a "recharge" directly form us or from your favorite reseller. All of the details at:

www.embarcadero.com/products/rad-studio/recharge