Skip to content

How to get Android 4.4.x style for your XE7 dialog boxes

Over the holidays, Hebron posted a question using the Embarcadero Community 3.0 Answers section. He asked "Why all the dialogs are using the "old" Android 2.x style? And how to force my Android app to use the 4.4.x style in all the dialogs like date picker and MessageDlg? Using StyleBook and modying the AndroidManifest.xml doesn’t work. I am currently using XE7. Thanks in advance." I did some testing at my home office and confirmed that there was an issue. I sent an email to our FireMonkey R&D team members and they confirmed the issue and provided the answer.

The fix is very simple : In the FMX.Helpers.Android.pas unit, you need to modify the GetNativeTheme function. Here is the modified code:

function GetNativeTheme: Integer;
var
  LStyleDescriptor: TStyleDescription;
begin
  Result := 0;
  if not IsGingerbreadDevice and (Screen <> nil) and (Screen.ActiveForm <> nil) and
    (Screen.ActiveForm.StyleBook <> nil) then
  begin
     LStyleDescriptor := TStyleManager.FindStyleDescriptor(Screen.ActiveForm.StyleBook.Style);
    // the original code -->GetThemeFromDescriptor(LStyleDescriptor);
    // the next line has the modified code to set the result
    Result := GetThemeFromDescriptor(LStyleDescriptor);
  end;
end;

You will find the original source code unit in the "C:\Program Files (x86)\Embarcadero\Studio\15.0\source\fmx" folder.  Copy the "FMX.Helpers.Android.pas" source file to your project and modify the line to set the return Result.

Add the source file to your project in the IDE.

Capture

Build your app and see the modern dialog boxes on your Android KitKat devices.

Screenshot 2014-12-29-11-57-48

Thanks for pointing out the issue, Hebron, and for using the new Community 3.0 Answers section.

 

David I’s "The Developer Twelve Days of Christmas 2014"

Back in 2010, I wrote a blog post with a simple Delphi VCL program "The Developer’s 12 Days of Christmas" which displayed the traditional lyrics and my attempt at some updated technology based lyrics. For 2014, I’ve created a FireMonkey version of the same application. Similar to the original sample, this multi-device FMX version has two TButtons and a TMemo. I have added a TToolBar component and also made sure that the buttons are half of the TToolBar’s width and resize based on the target device’s client width (connecting to the OnCreate and OnResize events for the form).

Have a very Merry Christmas and a Happy New Year!

You can download the source code projects for the VCL and FMX Delphi projects at http://www.davidi.com/TwelveDays/DeveloperTwelveDaysOfChristmas2014.zip

CodeRage 9 Delphi/Object Pascal Track Sessions to Watch

You can watch the replays of the CodeRage 9 Delphi/Object Pascal track sessions on YouTube. These sessions will help you modernize your VCL applications, learn more about multi-device and mobile development using FireMonkey, connect with SQL databases using FireDAC, build enterprise class mobile applications with Enterprise Mobility Services, add speed to your VCL and FireMonkey applications using the new Parallel Programming Library, become a better Object Pascal programmer by learning from some of the industry’s top experts, start developing for devices, gadgets, wearables and the Internet of Things (IoT), and more.

Below you will find a categorized list of sessions so that you can zoom in on specific topics to help you immediately solve programming problems and quickly learn the tips and techniques that will supercharge your projects.

You can also find the complete list of sessions using the Embarcadero YouTube channel playlist at https://www.youtube.com/playlist?list=PLwUPJvR9mZHhgQYWWgF6BCkgDwIpP78ZV

 

Object Pascal Programming

 

FireMonkey – FireUI

 

Modernizing your VCL apps

 

FireDAC, DataBase and InterBase

 

Parallel Programming Library

 

Enterprise Mobility Services (EMS)

 

Devices, Gadgets, Wearables and the Internet of Things (IoT)

 

Additional Sessions to expand your skills

 

Do you need even more skills, tips, tricks and techniques? Check out the Developer Skill Sprint replays at http://www.embarcadero.com/landing-pages/skill-sprints

 

Are you ready to get started with Delphi XE7?

Don’t have Delphi or RAD Studio XE7? [DownloadButton Product="Delphi" Caption="Try the Free Download"]

[BuyButton Product="Delphi" Caption="Buy/Upgrade Now (before December 31, 2014) and get all of the bonus offers including eBooks, premium styles, Castalia for Delphi, FastCube VCL and more"]

RAD Studio Tour Live Online - Thursday, December 18 - 9am and 12noon Pacific Time

Did you miss the recent RAD Studio XE7 tour stops? Join David I as he gives a live online version of the event. RAD Studio XE7 is the single biggest jump forward for 32-bit and 64-bit VCL and FireMonkey applications! Get tips for modernizing your VCL applications and extending them to mobile and the Internet of Things.

Come join other members of the Embarcadero community for this last live online webinar of the year focused on RAD Studio, Delphi and C++Builder XE7. I will be live demoing a wide range of XE7 capabilities and also taking your questions and requests. To register for one of two sessions, use the following registration links.

First Session - 9am Pacific Time, Noon Eastern Time, 5pm UTC

Register at https://www3.gotomeeting.com/register/777892070

Second Session - 12noon Pacific Time, 3pm Eastern Time, 8pm UTC

Register at https://www3.gotomeeting.com/register/811962254

 

If you want me to cover any specific XE7 features, send me an email to davidi@embarcadero.com.

Embarcadero Delphi involvement with the ESA Rosetta Comet 67P spacecraft project

Lee Clark in our Maidenhead England office reminded several of us about a 10 year old blog post, "Delphi begins its 10-year to the origins of the solar system", by Anders Ohlsson. In the post Anders displayed a Delphi newsgroup message by Kristofer Skaug, SSBV Aerospace & Technology Group, where he talks about his use of Delphi to create ground test equipment and interface simulator software for the ESA Rosetta mission. 

Here is the original Delphi newsgroup post by Kristofer on March 2, 2004:

"I would like to thank the Borland Delphi team for giving me the ideal tool to create ground test equipment software in support of the Rosetta comet-chaser mission, which launched successfully today. I can only guess that without Delphi, the years of work I put into that project would’ve been considerably less fun!"

Marco Cantu and I reached out Kristofer this past week after the successful Rosetta project’s touchdown of the Philae lander.We heard back from Kristofer who is still involved with the same company in the Netherlands.

Here is information that we received in two emails from Kristofer:

"Hello Marco and DavidI,"
"Nice to hear from you both, and quite remarkable that you recall this old message. Indeed I am still with the same company (although we have slightly streamlined our name) and we still use Delphi, recently upgraded to XE6."
"Here’s a movie (sorry about the stone age video quality) I made back in 2002 on the occasion of visiting the Rosetta spacecraft in the integration cleanroom at ESA. We built a lot of test equipment for Rosetta, in this video you see the TM/TC check-out equipment (with all the flashing LEDs etc), allowing the master Test system to communicate with the spacecraft via special bypass lines directly into the on-board computer. And that’s our Delphi-based Telemetry/Telecommand processing software you see in occasional screenshots. Around the 3-minute mark there’s even a glimpse of an honest-to-god Borland Delphi 6 IDE :-)"

D6 Rosis Screenshot

"We also built a series of Rosetta Spacecraft Interface Simulators ("ROSIS") which were used by all the science instrument teams for testing. The controller of this simulator was developed in Delphi 5. We went on tour around Europe and even to the U.S. (Southwest Research Institute in San Antonio, where the "Alice" instrument on the Rosetta orbiter was being built and of course JPL in Pasadena, for the MIRO instrument) to conduct standardized tests with these systems, meeting all the Rosetta science teams… it was a great experience."
"Today, the Rosetta TM/TC SCOE test equipment (shown in the above video) is installed in a special facility at the European Space Operations Centre (ESOC) in Darmstadt, Germany, where it is used to talk to the Rosetta "Engineering Model" - the first mock-up version of the spacecraft, fully functional but with cheaper (non-space-qualified) materials. This is used as a simulator to try out command sequences and software patches for the real spacecraft. So that old Delphi-based software is still in use for the Rosetta mission, more than 16 years after its initial release!"
"Since the Rosetta launch in 2004, we have had no significant involvement anymore in the project. But we are still reaping the benefits: Just like the comets are speculated to have had a seminal role in formation of living planets, the work we did for Rosetta was the starting point of a very successful product line. In particular the Delphi code base (which started out in Delphi 2) gave birth to our first truly re-usable code library, supported by a strong set of DUnit tests which we have been maintaining and using intensively up to this date (now in Delphi XE6, some of the code still bears visible traces to the Rosetta project!)."
"The proven staying power of Delphi, the robustness and stability of the RTL/VCL, the long-term maintainability across multiple compiler versions, next to the unequalled ease of use and productivity: These combine to an unbeatable argument in Delphi’s favor when faced with the standard industry pressure to use more mainstream tools and languages. Holding its ground against C++ and Java for 20 years! Keep it up!"

Thank you, Kristofer, for using Delphi to help the Rosetta project and for continuing to update your code base to later versions of Delphi.

Delphi’s involvement with the ESA Rosetta Comet spacecraft project


New version of FastCube FMX for FireMonkey has been released

xxx

RAD Studio, Delphi and C++Builder US Tour - 10 cities during December 2-4 - learn how to modernize your apps

Live RAD Studio events around the US with David I, Jim McKeeth, Sarina DuPont and more! Join us for lunch and learn what’s new in RAD Studio, Delphi, and C++Builder XE7. It’s all happening December 2-4 in Orlando, Raleigh, Denver, San Jose, Houston, Chicago, Irvine, Detroit, Pasadena and Dallas. Register in advance to save a seat for lunch. I will be visiting the California stops this December.

Details for each city:

Orlando - December 2
11:30am - 2:00pm
8986 International Drive
Orlando , FL 32819
Denver - December 2
11:30am - 2:00pm
2000 S. Colorado Blvd.
Denver, CO 80222
San Jose - December 2
11:30am - 2:00pm
940 Great Mall Drive
Milpitas, CA 95035
Raleigh - December 3
11:30am - 2:00pm
1105 Walnut Street, Suite E101
Cary , NC 27511
Houston - December 3
11:30am - 2:00pm
7620 Katy Fwy #100
Marq*E Entertainment Center
Houston, TX 77024
Irvine - December 3
11:30am - 2:00pm
71 Fortune Drive #960
Irvine, CA 92618
Detroit - December 4
11:30am - 2:00pm
45511 Park Avenue, Suite D
Utica , MI 48315
Chicago - December 4
11:30am - 2:00pm
1030 N. Clark Street
Chicago , IL 60610
Dallas - December 4
11:30am - 2:00pm
9450 North Central Expressway
Dallas , TX 75231
Pasadena - December 4
11:30am - 2:00pm
400 S. Baldwin Ave., Suite 930-U
Arcadia, CA 91007

If you are near one of these cities or will be in the area the first week of December 2014, join us in person for the full experience. You’ll get the latest info on RAD Studio, Delphi and C++Builder XE7, learn how to modernize your VCL applications, tether mobile/desktop apps, work with devices/gadgets, eat some food, ask questions, network with other developers and have a chance to win prizes.

 

CodeRage 9 replay videos are now on YouTube

The CodeRage 9 session videos are now viewable on the Embarcadero YouTube channel. Video replays of the sessions and live Q&A are posted for the C++ and Object Pascal tracks. You can access the videos using the following YouTube playlist URLs:

C++ Track:

https://www.youtube.com/playlist?list=PLwUPJvR9mZHgQ8WRCJkk8LKA0_ucuDOt1

 

Object Pascal Track:

https://www.youtube.com/playlist?list=PLwUPJvR9mZHhgQYWWgF6BCkgDwIpP78ZV

Bjarne Stroustrup "Make Simple Tasks Simple!" at CodeRage 9 - Wednesday, Oct. 29: 9-11am PDT

It is again my pleasure, once again, to announce that Bjarne Stroustrup will take part in the upcoming CodeRage 9 free online virtual developer conference next week. Bjarne last took part our CodeRage 7 C++ conference, "A Conversation with the C++ language designer and original implementer, Bjarne Stroustrup" back in November 2012.

This time we will be doing things a little bit differently. We will watch a replay of Bjarne’s wonderful CppCon 2014 Keynote, "Make Simple Tasks Simple!", and then have a live Q&A with Bjarne to complete the 2 hour session.

Bjarne’s session, "Make Simple Things Simple!" will take place on Wednesday, October 29 from 9am to 11am Pacific Time (12noon to 2pm Eastern Time) on the C++ track live stream.

Description from the CppCon 2014 site: "C++ faces two challenges: Helping programmers address the most demanding tasks in terms of performance, scale, and dependability. It must also help programmers be productive writing ordinary maintainable code. There is much more "ordinary code" than there is performance-critical code. Thus, C++ must make simple tasks simple while not getting in the way of tuning software for the last byte and last cycle where that’s necessary. This talk focuses on what C++11 and C++14 offers to simplify programming: auto, range-for loops, move semantics, futures, concepts, and more. However, the focus is not primarily on language features: the key is programming: how can we write better, more readable, efficient, and more maintainable code? If you think that the essence of C++ is clever pointer manipulation and huge class hierarchies you may be in for a few surprises."

Register for CodeRage 9 at http://forms.embarcadero.com/CodeRage9Registration.

You can submit questions live during the session or you can email questions in advance by sending them to davidi at embarcadero dot com using the subject line "Ask Bjarne during CodeRage 9".

REGISTER NOW FOR CODERAGE 9

Bad Behavior has blocked 4 access attempts in the last 7 days.

Close