Delphi and the #Code2014 Rankings

The Twitter #Code2014 ranking have become a bit of a tradition. At the end of the year everyone votes for the  programming languages they used, or were their favorite for the year. Then they all get tabulated up to see how they rank. Once again Delphi did quite well, coming it at #9, just ahead of other mainstream languages like C and C++ as well as niche languages like Objective-C and Swift (developing for only one platform is so 2013). It was neck and neck with C#, ending with only 11 votes different.

Delphi finished 9th in the #Code2014 rankings on Twitter

Delphi finished 9th in the #Code2014 rankings on Twitter

There are actually still people voting, but the deadline was Friday, so the votes don’t count. I still appreciate the enthusiasm. Watching Delphi climb the charts was a real treat, and shows two things:

  1. Delphi is still a very popular language
  2. The Delphi community is amazing

I believe this second point to be the most important one. The community really came together to vote for Delphi and move it up the rankings. Makes me happy to be part of such an amazing community.

 # Language Count
 1 javascript 2414
 2 python 1355
 3 java 1317
 4 ruby 1044
 5 sql 936
 6 php 882
 7 bash 871
 8 c# 814
 9 delphi 803
 10 c 692
 11 c++ 598
 12 go 566
 13 clojure 504
 14 haskell 452
 15 scala 449
 16 objective-c 375
 17 swift 343
 18 livecode 280
 19 coffeescript 262
 20 f# 246

Looking at the top languages, they mostly have a web development theme. I’ve heard before that Twitter seems to have a web development bias, and this seems to reinforce that. Also since you are allowed to vote for more than one language we see SQL with a very high ranking, even though I imagine it had very few votes just for it (I may be wrong, but it seems like the kind of language you use with a general purpose language).

 

Episode 54 – Sarina DuPont

Welcome back to the Podcast at Delphi.org. This is my first podcast since I’ve started working for Embarcadero Technologies back in 2013. When I first started I’d planned to resurrect the podcast, but got caught up with all the new projects, travel and excitement and it fell by the wayside.

With the New Year it seems fitting to recommit to the podcast. I’ve got a lot of changes planned. I’m not sure about the frequency format and other details, but figure it is better to get a rolling start.

I actually recorded this interview with Sarina DuPont (@SarinaDuPont) back in August of 2013, right before the RAD Studio XE5 release added Android support. So some of the comments are dated in that regard, but most of it is still relevant. So while XE5, XE6 and XE7 have all shipped since the podcast, Sarina is still a product manager and the focus of getting to know her and her vision for RAD Studio is still relevant.

[Download]

Typically I am in the Scotts Valley office about one week a month. My plan is to start recording some interviews when I am there. I’ve really enjoyed getting to know people behind the scenes with my favorite development tools, and hope you will too.

In the next episode I’ll have an interview with John Thomas (@FireMonkeyPM), or JT, the Senior Director of Product Management here at Embarcadero Technologies.

Oh, and check out the new Embarcadero Community Podcast by David I.

Tweet Delphi #Code2014

If you code in Delphi, then be sure to Tweet Delphi #Code2014 to have your vote counted. I’ve made it really easy for you, if you just log into Twitter and click the link you cast your vote. You can see the rankings on Code2014.com or just check the list of all the tweets for Delphi.

Vote, and tell your friends to vote. They filter to one per Twitter account.

Mobile Push Notifications without a BaaS

Delphi, C++Builder and RAD Studio XE7 include support for mobile push (remote) notifications via a Parse and Kinvey BaaS providers. This makes it really easy to send push notifications to your users on mobile devices. Both Parse and Kinvey offer free service levels (as well as paid), and you can also download App42 SDK for Appmethod and use the App42 BaaS instead.

BaaS or Backend As A Service Providers are companies that maintain the backend servers necessary for many application development tasks. They handle things like user authentication, data storage, push notifications, etc. Sometimes they are referred to as mBaaS or Mobile-BaaS because if the heavy focus on mobile application development these days, but they typically are not tied to mobile.

This doesn’t mean you have to use a BaaS provider to send mobile push notifications. This is just the easy way. During CodeRage we’ve had sessions on how to do push notifications without a BaaS provider. It is different for both iOS and Android, so you are looking at a lot more code and effort, but it is possible.

CodeRage 9 had a session by Jeff LeFebvre had a session on Android Push notifications via Google Cloud Messaging (GCM):

Here is a transcript of the Q&A as well as download links.

For iOS & iPhone use of Apple Push Notifications (APN) Luis Felipe and Anders Ohlsson have some blog posts and videos on the subject. Luis did the original post and video in Spanish, and then Anders translated and expanded on it.

Luis’ post on iOS notifications with XE4 (Spanish but you can use Google Translate). It includes some source code downloads too. The video is also in Spanish but it shows a lot of source code, so it is easy enough to follow along.

Ander’s blog post expanding on it (English), and his CodeRage video on the subject (English)

Keep in mind that this is about the same level of complexity to use most other tools for sending and receiving push notifications.

Last Minute Christmas Shopping Ideas

If you still have a few people on your Christmas gift list that you just don’t know what to do for, check out the RAD Offer page. You’ll save some serious money, and they will get the best development tool for building highly connected multi-device native apps.

Get Free Bonuses with the purchase of RAD Studio XE7,
Delphi XE7 and C++Builder XE7 until December 31, 2014

Rapid SQL XE6
Rapid SQL® is the intelligent SQL IDE empowering database developers and DBAs the ability to create high-performing SQL code on all major databases from a single interface. Purchase RAD Studio, Delphi and C++Builder XE7 Enterprise or above and receive a license of Rapid SQL XE6. Redeem your license.

New Object Pascal Handbook by Marco Cantu
This brand new 300-page ebook is a complete guide to the current, modern Object Pascal programming language by best-selling Delphi books author and Delphi Senior Product Manager Marco Cantu. This new language manual for new & existing Object Pascal developers covers core language features, object-oriented programming with Object Pascal, and the latest language features like generics, anonymous methods, and reflection in todays’ Delphi compilers.

Mida Converter Basic
Mida Basic for RAD Studio XE7 is a special edition of the popular VCL to FireMonkey converter. Helps converting your VCL forms to multi-device, including data bindings and other advanced features with support for over 200 components.

Castalia for Delphi
Castalia is a premier code productivity plug-in for Delphi. With code refactoring, structural highlighting, parenthesis matching, flow control, highlighting, and live syntax checking, Castalia makes you more productive than ever. Use project statistics and code analysis to better understand your team productivity and code quality.

VCL and FireMonkey
Premium Styles

Customize the look of your VCL Windows applications with five premium styles including Coral, Diamond, Emerald, Sterling or Jet style. Customize your multi-device applications with seven premium FireMonkey styles including Jet, Sterling, Diamond, Emerald Crystal, Emerald Dark, Coral Crystal and Coral Dark styles.

FastCube VCL 2
FASTCUBE VCL is a set of OLAP Desktop components and a tool for effective data analysis. FastCube enables you to analyze data and to build summary tables (data slices) as well as create a variety of reports and graphs both easily and instantly. It’s a handy tool for the efficient analysis of data arrays.

Availability: Rapid SQL XE6 is available on Enterprise and above ESD purchases from Oct 20-December 31, 2014 (network licenses do not qualify). Other bonus pack items are available on purchases from Oct 1-December 31, 2014.See qualifying SKUs.

How to get it: After purchasing, click here to get your free bonus items. (Redeem free items within 14 days of offer expiration date). Not available with purchase of Starter edition.

Restrictions Apply. Not all products qualify for this offer.

Upgrade from any previous version and save up to 45%

Get the upgrade price on Delphi XE7, C++Builder XE7 or RAD Studio XE7 through December 31, 2014 regardless of what previous version you have. Save up to 45% off the regular new user price for the product license and stay up-to-date with automatic enrollment in the Recharge program.

Availablility: All eligible XE7 purchases from Oct 20-December 31, 2014. See qualifying SKUs.

Download and activate your trial and get
Coding in Delphi by Nick Hodges for free.

By activating your trial, you will receive a free copy of Coding in Delphi. This ebook covers a variety of powerful Delphi programming features and techniques including Generics, Interfaces, Exception Handling, Anonymous Methods and more!

How to get it: After activating your trial, click here to download the ebook.

What is the Internet of Things?

You’ve no doubt seen talk of the Internet of Things, or the Internet of Everything even, but you may still wonder what it is. Well, it isn’t a product or a feature you will buy, it has more in common with the “information age” or “industrial revolution” then “smart phone” or even the Internet itself.

It took me a while to warm up to the idea. At first I thought it was just marketing hype, but now I am really excited and see it as part of a huge trend that is going to really change life as we know it. In fact we’ve already seen a lot of the changes. The Internet of Things (IoT) isn’t something coming someday; it is something already here and is only going to get bigger.

Gartner's 2014 Hype Cycle of Emergine Technologies

Gartner says we are 5 to 10 years away from seeing the full productivity of IoT

 

The basic idea is that all sorts of “ordinary things” get connected to the Internet, but I believe that really misses the point. IoT is really the combination of four technologies: The cloud, computer miniaturization & commoditization, smart devices, and ubiquitous connectivity. I’d say ubiquity is a theme of IoT. These four technologies have been gaining steam individually, but as they come together we see massive changes.

Over the next few blog posts we can discuss each technology individually, and then we can discuss what they mean together. I’d love to hear your feedback along the way.

Did you know RAD Studio XE7 is great for building apps that connect with the Internet of Things? I’ll discuss that more in some of my future posts, but right now there are a lot of great special offers that make upgrading to XE7 a no brainer. I’d feel bad if you missed these special offers because you were waiting for me to get to the point. If you just download and activate the trial by Nov 21st you get a free copy of Nick’s book.

Developing on the Samsung Gear Live Smart Watch

Previously I created a blog post about using Delphi and RAD Studio XE7 to develop for the Moto 360. The new FireUI Multi Device Designer (MDD) makes is a breeze to design for the new smaller UI. I’ve since updated the FireUI Devices project on GitHub to cover the Samsung Gear Live & LG-G watches in addition to the Moto 360.

I thought I would walk through the steps for developing with the Samsung Gear Live. One advantage it has over the Moto 360 is that it has a physical USB cable connection, so you don’t need to deploy via BlueTooth. This makes for a much faster deploy cycles. With a USB cable though, you need to install the ADB USB Drivers.

  1. Put the device in USB Debugging Mode
    1. Hold the home / side button until the settings menu appears (couple seconds)
    2. Select About and tap Build Number until it notifies you that developer options are enabled.
    3. Swipe left to right to go back
    4. Select Developer Options and enable USB Debugging.
  2. You still need to have the watch paired with a phone via the Android Wear app since the confirmation dialog is displayed there.
  3. Run the SDK Manager / Android Tools and Make sure you have Android SDK Tools, Platform-tools and Build tools updated (this moves the ZipAlign.exe, so you need to tell the IDE where to find it.)
  4. Install the Samsung Android USB Driver for Windows
  5. Gear Live should appear as an Other Device in device manager once you connect it to windows via USB.
  6. Select Update Driver Software
  7. Browse my computer for Driver software
  8. Let me pick from a list of device drivers on my computer
  9. Then select ADB Interface
  10. Select SAMSUNG Android ADB Interface
  11. On your phone you will see a dialog “Allow Wear Debugging” Check “Always allow .. . ” and then select OK.

Gear Live - Device Manager Driver Update

 

Once you have done all of that, it will show up in your IDE as a target, and when you load the FireUI custom device for it, then you will have a great design surface for it too.

GearLive in XE7 IDE

 

And you are ready to build your Gear Live app with Delphi XE7.

Delphi XE7 on the Samsung Gear Live

I’m sure I’ll have more coverage on Android Wear in the coming months too.

Voice Enable Your Android Apps

During CodeRage 9 I revisited adding voice support to Android apps. There are some updates from my previous skill sprint coverage on the topic and my original post on launching Google Glass apps via Voice.

You can download the Samples and Components on GitHub. It covers voice recognition, text to speech and launching apps on Google glass with your voice. The examples also cover Android Wear.

Voice Launching Google Glass Apps

  • Add a Voice Trigger XML file:
  • Modify the Android Manifest Template:
    • Add an Intent Filter
      • <action android:name=”com.google.android.glass.action.VOICE_TRIGGER”/>
  • Add Meta Data for Filter
    • <meta-data android:name=”com.google.android.glass.VoiceTrigger”
             android:resource=”@xml/my_voice_trigger” />

Custom Glass Voice Trigger

  • Change XML to from Command to Keyword.
  • Use arbitrary text for voice trigger.
  • Use the Development permission:
    • <uses-permission
      android:name=”com.google.android.glass.permission.DEVELOPMENT”/>
    • Added to android manifest template
  • Not allowed for app store distribution
    • Usable for in-house or ad-hoc use

Additional Prompts on Google Glass

  • Collect additional Voice recognition input when app is launched.
    • Add an Input Prompt to the Voice Trigger XML
      • <?xml version=”1.0″ encoding=”UTF-8″?>
      • <trigger command=”TAKE_A_NOTE”>
      •     <input prompt=”What shall I say?” />
      • </trigger>
  • In FormCreate get speech guesses from Intent Extras
    • SharedActivity.getIntent.getExtras. getStringArrayList(TJRecognizerIntent.JavaClass.EXTRA_RESULTS);

Voice Recognition on AndroidAndroid/Google - Speak Now

  • Prompts user for voice input
  • Returns up to 5 “guesses”
  • Works offline too
    • (only returns 1 guess)
  • Reusable component for download.
  • Requires RECORD_AUDIO & INTERNET permissions.
  • Sends audio to Google’s servers.
  • Uses context to select words.
  • Pronounce punctuation (period, comma, etc.)
  • Works on Android phones & tablets
  • Works on Google Glass
  • Works on Android Wear
  • Doesn’t work on iOS (no exposed API)

Using TSpeechRecognition Component

  • Properties
    • Language: en-US
    • Prompt: Speak now
    • AlwaysGuesses: True
  • Methods
    • Listen
    • ListenFor
  • Events
    • OnRecognition
    • OnRecognitionEx
    • OnCommand

Text-To-Speech on Android

  • Converts Text to spoken word.
  • Reusable component based on Jeff Overcash’s translation.
  • Code shows example of handling Java Listener events.
  • Works on Android phones & tablets
  • Works on Google Glass
  • Doesn’t work on Android Wear (no speaker)
  • iOS Support is possible . . . . (needs implementation)

Using TAndroidTTS Component (component name may change)

  • Just one procedure: Speak

A Note About iOS

  • iOS does not expose voice recognition API
    • (Need to use 3rd party)
  • iOS 7 supports Text to Speech API
    • AVSpeechSynthesizer
    • Just haven’t implemented in component yet

Google Glass Voice Trigger Sample

The replay video will be available here later.

Download the XE7 Trial today and check out the special offers.

Fire UI and the Multi-Device Designer

During CodeRage 9 I had a session on Fire UI and the Multi-Device Designer. You can also check out my previous post on creating a custom FireUI view for the Moto 360.

Fire UI is made up of three parts:

  1. Behavior Services – Runtime & design time platform design information
  2. Multi-Device Designer – Unified project – Tweak UI for platforms
  3. TMultiView Component – Adaptive layout

Behavior Services at Design Time

  • Examples:
    • TTabControl.TabPosition
      • Bottom on iOS, top otherwise
    • Font.Size & Font.Family
    • Many controls have Size.PlatformDefault = True
    • TMultiView mode

Behavior Services at Runtime

  • TBehaviorServices class in FMX.BehaviorManager.pas
  • IDeviceBehavior defines
    • GetDeviceClass: TDeviceInfo.TDeviceClass;
    • GetOSPlatform: TOSPlatform; // Windows, OSX, iOS, Android
    • GetDisplayMetrics: TDeviceDisplayMetrics;
  • IFontBehavior defines
    • GetDefaultFontFamily & GetDefaultFontSize

OS Specific example

 var
  DeviceBehavior: IDeviceBehavior;
begin
  if TBehaviorServices.Current.SupportsBehaviorService(?
    IDeviceBehavior, DeviceBehavior, Self) and
    (DeviceBehavior.GetOSPlatform = TOSPlatform.iOS) then
    // behavior specific to iOS
end;

Display metrics example

var
  DisplayMetrics: TDeviceDisplayMetrics;
begin                        // self is a form in this case
  DisplayMetrics := DeviceBehavior.GetDisplayMetrics(Self);
  if DisplayMetrics.AspectRatio > x then
    // AspectRatio specific behavior
end;
type
TDeviceDisplayMetrics = record
    PhysicalScreenSize: TSize;
    LogicalScreenSize: TSize;
    AspectRatio: Single;
    PixelsPerInch: Integer;
    ScreenScale: Single;
    FontScale: Single;
end;

More Information

Check back later and I’ll have the video replay available too.

Download the XE7 Trial today and check out the special offers.

Meet Me in São Paulo, Brazil at the Embarcadero Conference

Last year was my first visit to the Embarcadero Conference in São Paulo, Brazil and I loved it. So I am going back again this year. As an added treat I’m be joining Marco Canto, the Delphi product manager. We both speak together on Delphi Present and Future, then Marco does The Fun Side of Delphi and later I’ll cover Internet of Things, Bluetooth and AppTethering when I will also show some Delphi powered Brain-Computer Interface demos and a lucky volunteer will fly a quadricopter with their thoughts.

The Embarcadero Conference in Brazil is huge with a lot of great sessions. I always consider it a treat when I get to see Marco’s Fun Side of Delphi presentation. I wonder if he will show off the Elf & Wizard classes that are new in XE7?