Act fast to take advantage of the RAD Studio 10 Seattle Early Bird Offer. Expires September 30th, 2015. More information
Author: Jim McKeeth
In this special episode we talk with Allen Bauer, Chief Scientist here at Embarcadero Technologies. This month is the 7 year anniversary of the Podcast at Delphi.org, and today is Allen’s birthday. This conversation was recorded during Delphi Week, a celebration of Delphi’s birthday back in February.
We talk about what Allen does as a Chief Scientist as well as some of his side projects. We also discuss some of the new platforms we face today as developers and the challenges and likelihood of Delphi targeting them. Finally some discussion about features Allen would like to see added to Delphi in the future.
Adding to the Android User Dictionary
On Android there is a single UserDictionary that works across all keyboards, and any app (with the appropriate permissions) can query, add and remove words. Here is some simple code to add a word to the dictionary (via XE8):
uses Androidapi.JNI.Provider, Androidapi.Helpers, Androidapi.JNI.JavaTypes; procedure AddUserWord(const AWord: string); begin // Need WRITE_USER_DICTIONARY permission TJUserDictionary_Words.JavaClass.addWord( SharedActivityContext, // Context StringToJString(AWord),// Word to add 255, // Frequency: 1- 255 nil, // optional shortcut SharedActivityContext.getResources.getConfiguration.locale ); end;
If you also want to read the dictionary then you need to have the READ_USER_DICTIONARY permission. Check out the documentation for more information on the UserDictionary and it’s Words list.
If you followed Google I/O then you no doubt heard about Google’s announcements in the Internet of Things space: Project Brillo and Weave. Brillo is Google’s new operating system for Internet of Things devices, and Weave is the language for how the devices will communicate. Right now Brillo and Weave are just product announcements. You can sign up for more information, but there is no preview release or developer build available. A lot may change before they are released, so it is tough to talk about them, but you sill may wonder how they will play with Delphi and RAD Studio XE8.
Disclaimer: This is based on public information released by Embarcadero and Google as interpreted by me. I’m not announcing anything, nor sharing any internal secrets. Just connecting the dots. If you connect the dots and get a different picture then let me know.
Neither Brillo or Weave are on our official roadmap because they were just announced. But we do have a good record lately of supporting new platforms quickly with new releases when those platforms are in our area of focus: iOS, Android, Windows and OS X. Just with XE8 we added iOS 64-bit to meet Apple’s new requirement, and it was added in such a way that most projects just need a recompile (which is much better option than the other native tools out there)
Besides wishful thinking, lets look at what they are and what we already support with XE8.
Project Brillo is a modified (or scrubbed down) version of Android. There have already been a few new devices come out that are powered by Android beyond the traditional tablet and phone. This is because Android is an open platform that comes with a rich development and app ecosystem. Brillo is Google’s attempt to make Android more flexible for more new devices in the future. It is a great idea.
Project Brillo may be in response to Microsoft’s announcement of Windows 10 for Devices, specifically targeting Raspberry Pi 2. These devices are going to be huge in the Internet of Things (IoT). That is why Microsoft is targeting the Raspberry Pi 2, and why Google is releasing Project Brillo. They all want to be the operating system of the Internet of Things. This is one place in the IoT where Apple is behind the pack, since they are a hardware company, they don’t want to sell an OS without hardware.
What about Delphi support for Brillo? We can look at the last 3 big modified versions of Android: Amazon’s Fire OS, Google Glass and Android Wear. All three of these we supported “out of the box” with our current release at the time, and some of them we added features in future releases to enhance that support. This is because we have great support of the Android OS directly. So I would suspect we will support Brillo when it is released.
That being said, one of the goals of Brillo is to run on “broad silicon” beyond the common ARVv7 processors that most Android devices run on. We only currently support ARMv7 and ARMv8 (with NEON being part of the ARM standard going forward, so isn’t hardly worth mentioning). We’ve seen some recent success with Intel ATOM processor support thanks to libHoudini updates in KitKat. Now if a Brillo device is running a processors meeting these specs, it is likely to be supported “out of the box.” But if Brillo is running on an ARMv5 or “Bill and Ted’s Excellent CPU” then support is less likely.
Now it is possible that Brillo will be scrubbed down so much that it is no longer compatible with an Android app. Remember that Android is based on Linux, and Linux console apps are on our official roadmap for a future release, so support is still possible.
That brings us to Google Weave: a common library of terms for how devices will communicate. Its objective is to expose the developer API in a cross-platform way. It is based on JSON and REST from what I can tell. So it will be an agreed standard within REST and JSON. We already have great JSON and REST support, and there are 3rd party libraries that extend that as well. Combine the REST client library and the EMS server REST support and I suspect we will be in a good place to support Weave.
Weave is the protocol, but the channel will most likely be WiFi via HTTPS or Bluetooth LE. Also already covered great in XE8.
Naturally once Brillo and Weave are more than just vague product announcements we may have specific support for them that would make them easier to work with and unlock more features of those platforms beyond the stuff you already get with XE8. The moral of the story is to start developing your IoT solutions with XE8 today and make sure you have Update Subscription so you are ready for the future.
Brain Computer Interface Demo video
MVP Tweets of the Week – April 26, 2015
This is a collection of some Tweets by our MVPs over the last week. They are from all around the world and in various languages.
This first one was technically from the week before, but I was on the other side of the international dateline then so it all gets wibbly wobbly timey wimey.
Let's do some demographics of the Delphi developers – how old are you? http://t.co/COw6td1HMH
— Nick Hodges (@NickHodges) April 26, 2015
How long ago did you start using Delphi? http://t.co/wLDZkFbXTe
— Nick Hodges (@NickHodges) April 26, 2015
Notificaciones En Object Pascal RAD Studio XE8 – http://t.co/fUjNmtplZm
— Edgar Ramírez (@_edgar_ipn) April 30, 2015
HOSOKAWA Jun @pik retweeeted:
?????: [C++Builder]Delphi XE8/C++Builder XE8????????????????? http://t.co/xPKoop5lCe
— ??? (@gesource) April 27, 2015
Translation: Blog update: [C++ Builder, Delphi XE8/C Builder XE8-compliant components and tools
P2V of an existing XP machine to Hyper-V to have an emergency fallback when retiring old XP physical machines http://t.co/Djjo04op1G
— Jeroen Pluimers (@jpluimers) April 27, 2015
I'm at Embarcadero do Brasil – @embarcaderobr in São Paulo https://t.co/NozZZfU108
— Adriano Santos (@asrsantos) April 27, 2015
G+ Blog post "Using XE8 Settings Migration Tool" at http://t.co/hkmVIm02Ei… http://t.co/pYSg1wO1Xl
— Jeroen Pluimers (@jpluimers) April 27, 2015
Almost as if Cary is answering Nick here:
I hate it when impossible things happen.
— Nick Hodges (@NickHodges) April 27, 2015
In software development, the difference between never and almost never is as great as the difference between true and false
— Cary Jensen (@caryjensen) May 1, 2015
Anders Ohlsson @suited_aces retweeted:
We have positions open in San Francisco in Accounting, IT, Engineering and Marketing: https://t.co/I89etFe2c9 #sfjobs #jobs
— WideOrbit (@WideOrbit) April 27, 2015
Delphi developer opportunity in Curitiba-PR-Brazil at @ewavedobrasil pic.twitter.com/lWiuWLRErY
— Victory Fernandes (@victoryjorge) April 27, 2015
Incredible, Fantastic and Very nice. @JimMcKeeth: Check out the new Premium Styles pack for XE8, including my…
— Adriano Santos (@asrsantos) April 28, 2015
Delphi Training course in Denmark the 20th through 22nd of May. (Dates need adjusting on website) http://t.co/gORxFQltct
— Jens Fudge (@JensFudge) April 28, 2015
Andrea Magni @AndreaMagni82 retweeted:
Per scoprire #Delphi #XE8 (oltre ad ascoltare l'ultima puntata del podcast) domani non mancate a Delphi Porte Aperte! http://t.co/WA6SPDIiPn
— Delphi Podcast (@DelphiPodcastIT) April 28, 2015
Webinar de apresentação do RAD Studio XE8 em português hoje. (@ Embarcadero do Brasil – @embarcaderobr in São Paulo) https://t.co/hXvYAKrbC1
— Adriano Santos (@asrsantos) April 28, 2015
Windows and Beyond: See What's New in XE8 in tomorrow's live webinar. http://t.co/79gRRLvjzN
— Ricardo Boaro (@rboaro) April 28, 2015
Ten Tips For Migrating From C# And .NET To Multi Platform Object Pascal … – http://t.co/v9fohrHTlR pic.twitter.com/Df4DXzp5p0
— FMX Express (@FMXExpress) April 28, 2015
How-To use AdMob Interstitial Ads with #Delphi XE8 #Android #IOS http://t.co/mbVJLcbEhz
— FMX Express (@FMXExpress) April 28, 2015
G+ We are looking for a Delphi Software Engineer, near Strasbourg, France (no remote job possible, sorry… http://t.co/cpSYa5fpqn
— Jeroen Pluimers (@jpluimers) April 28, 2015
Firemonkey TImageList – Delphi XE8 – http://t.co/HKKiup7hWh
— Delphi.cz (@delphicz) April 28, 2015
Paolo Rossi apre il Delphi Porte Aperte 2015 #Padova #delphi @wintechitalia pic.twitter.com/l77qirqaeX
— Andrea Magni (@andreamagni82) April 29, 2015
Delphi Tour 2015 – Rio Claro – SP http://t.co/axMb4xg7yC
— Ricardo Boaro (@rboaro) April 29, 2015
RT @TheRegister: #Build2015 YES, Windows 10 will eat Android apps … and iOS apps, too http://t.co/VcrX3mBgU5 WOW!!
— Bruno Fierens (@BrunoFierens) April 29, 2015
Lançamento do Rad Studio XE8 http://t.co/sEzuFJvV0Y
— Régys Silveira (@regyssilveira) April 29, 2015
Also retweeted by Anders Ohlsson and discussed by others. An addage that has been around a while, but still relevant:
"An optimist sees a glass half full. A pessimist sees it half empty. An engineer sees it twice as large as it needs to be."
— Daniele Teti (@danieleteti) April 30, 2015
Notificaciones En Object Pascal RAD Studio XE8 – http://t.co/fUjNmtplZm
— Edgar Ramírez (@_edgar_ipn) April 30, 2015
The 10 Commandments of User Interface Design #Delphi #Android #IOS #Windows #Mac http://t.co/7sgARCUpW7 pic.twitter.com/r2xaZVawVV
— FMX Express (@FMXExpress) April 30, 2015
G+ Quake to Delphi Total Conversion – Valavanis Jim http://t.co/ehHpvDoMqv
— Jeroen Pluimers (@jpluimers) May 1, 2015
Windows Store, here come the Delphi apps! http://t.co/A1j6qeH7pw
— Bruno Fierens (@BrunoFierens) May 1, 2015
http://t.co/IYeCxBCAHZ 2015 Oslo is 7-8 May, Frankfurt is 11-12 May. @BrunoFierens is our guest speaker in Frankfurt. Register today
— Cary Jensen (@caryjensen) May 1, 2015
Ricardo Boaro rewteeted:
Starts next week – RAD Tech Partner Spotlights – new series. Details coming soon… See past replays here: http://t.co/7CKHn7pmGR
— RAD Studio (@RADtools) May 1, 2015
Alister Christie interviews Jim McKeeth and Damien Bootsma #delphi https://t.co/pQLgDpHVbU
— FMX Express (@FMXExpress) May 2, 2015
Welcome to the Internet of Things Nick. My Beacon’s emailed me too!
Is it bad that I'm a little creeped out that my car sends me emails?
— Nick Hodges (@NickHodges) May 2, 2015
G+ ADB For Chrome http://t.co/soC3rviA8e
— Jeroen Pluimers (@jpluimers) May 3, 2015
Full Source Charting Component Suite For #Delphi XE8 Firemonkey On #Android And #IOS – http://t.co/ugAiZ7mc4W pic.twitter.com/Vml9JMeC6x
— FMX Express (@FMXExpress) May 3, 2015
Code Snippet For Full Screen Interstitial Ads In #Delphi XE8 Firemonkey On #Android – http://t.co/WBZ4ehtwFk pic.twitter.com/eZXQFxHfUE
— FMX Express (@FMXExpress) May 3, 2015
PayPal, Chartboost, RevMob, AppFlood, AdMob, Iad SDKs For #Delphi XE8 Firemonkey On … – http://t.co/LYYGHTAOcL pic.twitter.com/IB8DljxgK8
— FMX Express (@FMXExpress) May 3, 2015
Easy To Use Mapping Components In #Delphi XE8 Firemonkey On #Android And #IOS – http://t.co/ySTH8olJuO pic.twitter.com/exwsQNIfYE
— FMX Express (@FMXExpress) May 3, 2015
Generate Matrix And 2D Barcodes In #Delphi XE8 Firemonkey On #Android And #IOS – http://t.co/XwEFWA11Rf pic.twitter.com/sQd8J4X9oc
— FMX Express (@FMXExpress) May 4, 2015
That is just some of the Tweets from our MVPs. You should really follow them to keep up to date. You can view their latest Tweets here:
Tweets from https://twitter.com/JimMcKeeth/lists/embarcadero-mvps
Not all of our MVPs are active on Twitter, check out the MVP directory for details on each of them. In the future I’ll highlight updates from different sources.
CORS on DataSnap REST Server
Cross-origin resource sharing (CORS) is a mechanism that enables resources to be shared across domains. Typically this isn’t allowed to prevent security issues. To enable on your DataSnap REST server you can use the following code per MVP Nirav Kaku from India.
All you need to do is add a custom header in the Response before dispatching the result on the DataSnap server…
procedure TWebModule1.WebModuleBeforeDispatch(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); begin //allows cross domain calls Response.SetCustomHeader('Access-Control-Allow-Origin','*'); if FServerFunctionInvokerAction <> nil then FServerFunctionInvokerAction.Enabled := AllowServerFunctionInvoker; end;
It is useful for DataSnap server developers who want
their REST calls to be supported via AJAX using JavaScript from a
different server.
Note: CORS is security feature of the browser so there could be some
dependency there. Tested with Firefox, Chrome and IE and it seems to
be working fine.
An Interview with Ray Konopka
In this episode we talked to Ray Konopka during Delphi Week. Topics include the upcoming Delphi Developer Days, some of his work for Disney, Raize Software, including his new Radiant Shapes, Windows 10 and HoloLense (even though I wish they would rename it).
Looking forward to seeing everyone at Delphi Developer Days in Chicago, but if you can’t meet me there, they have some other locations too.
[Download]
FireDAC: Local SQL
Here are the additional resources for the FireDAC: Local SQL Skill Sprint from this morning. The TFDLocalSQL provides a powerful engine allowing you to run local SQL queries against any TDataSet descendant.
Here is the video replay. It is about half Q&A and half presentation.
If you want to download my sample application: LocalSQL-demo
Slides:
http://www.slideshare.net/jimmckeeth/fire-dac-local-sql
The demo and full replay are coming soon.
DocWiki
Videos
- Dmitry Arefiev’s FireDAC Local SQL video
- Dmitry Arefiev’s FireDAC Tips, Tricks and News
- Jens Fudge’s Local SQL Skill Sprint
More information and resources on TFDMemTable from the FireDAC Skill Sprint.
If you missed the Skill Sprint, or want to review it, here is the video with the recording of the Q&A. The presentation is 15-20 minutes, and the other 30 minutes is from the Q&A.
Here are the slides for now, the replay will be available soon.
http://www.slideshare.net/jimmckeeth/skill-sprint-in-mem-dataset
Common code samples:
Delphi / Object Pascal
// Create Field Definitions FDMemTable1.FieldDefs.Add('ID', ftInteger, 0, False); FDMemTable1.FieldDefs.Add('Name', ftString, 20, False); FDMemTable1.CreateDataSet; // Append data FDMemTable1.Open; FDMemTable1.AppendRecord([1, 'Jim']); // Load from another DataSet FDMemTable1.CopyDataSet(DataSet1, [coStructure, coRestart, coAppend]);
C++
// Create Field Definitions FDMemTable1->FieldDefs->Add("ID", ftInteger, 0, False); FDMemTable1->FieldDefs->Add("Name", ftString, 20, False); FDMemTable1->CreateDataSet(); // Append Data FDMemTable1->Open(); FDMemTable1->Append(); FDMemTable1->FieldByName("ID")->AsInteger = 1; FDMemTable1->FieldByName("Name")->AsString = "Jim"; FDMemTable1->Post(); // Load from another DataSet FDMemTable1->CopyDataSet(DataSet1, TFDCopyDataSetOptions() << coStructure << coRestart << coAppend);
More information:
- Samples
- C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDMemTable
- C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDLocalSQL
- DocWiki
Cary Jensen’s CodeRage 9 Video: TFDMemTable & ClientDataSet Compared [Q&A Log]
Dmitry Arefiev’s CodeRage 9 FireDAC Tips, Tricks and News