Last night I “controlled” my Parrot AR.Drone Quadcopter with my thoughts through my Emotiv EPOC Brain Computer Interface via an app written in Delphi XE5. I qualify “controlled” in that my flight pattern was a little irregular and short before I crashed it. It was a “look mom, no hands” moment though as the drone was clearly responding to my thoughts for the few seconds before it crashed. I’ve got a lot of work to do in improving the process, so I will be posting code and videos soon. If you want to get a start on it though, it is based on my work from the Devices and Gadgets webinar.
You’ve probably seen Éric Fleming Bonilha videos showing off his Digifort mobile applications developed with Delphi XE5. The videos don’t mention it, but the back end server and client applications are all written in Delphi too. Just in case you haven’t see the videos, here they are again:
Earlier version, but on a lot of different devices:
Embarcadero just completed a case study with him too, which is really informative. I spoke with him down in Brazil and he said they previously developed mobile clients with both Java and Objective-C, and found Delphi let them develop their projects much faster, and they get both Android and iOS from one project. Also, and perhaps more importantly he said the performance of the Delphi client was just as good, plus they found it more flexible for building a user interface that looks great and is easy to use.
Digifort may be based in Brazil, but their clients are all over the world and are a mix of government agencies and business of various sizes. Eric arranged a trip to meet me in Scotts Valley this last week. He showed me some pictures of some of the walls of monitors his clients have, all powered by Digifort. Some really impressive installations.
A big part of his trip was to pick up a his very own Google Glass to start developing a Digifort mobile app for Google Glass. In just a couple short sessions he was capturing images from the built in camera, connecting to his remote server, and streaming live video from Brazil to the glass display. The use case for security personal to view cameras while on patrol, while sharing what they see with everyone else is a great one.
Eric also had a chance to visit with some people from R&D and product management and share his experiences working with Delphi XE5 and FireMonkey. Here are some best practices he found for making a really smooth user interface.
FireMonkey handles PNG images really well. He makes a lot of use of transparent and semitransparent PNG images in TImage components. Layering, animating and zooming those images is what he uses to create some of those really great effects, like the joystick control for camera control.
The TFloatAnimation and other animation effects are really powerful. He uses those extensively for smooth animations.
He created the drawer interface using TFrames (he uses a lot of frames). The main (center screen) has a Pan Interactive Gesture on it. He looks at the gesture to see if it is horizontal (comparing the gesture start to a later gestsure event) and has traveled at least 10 pixels in that direction. Once that happens then he moves the edge of it with the current finger position from the gesture. He also tracks the speed of the movement, so if you let go then he uses another TFloatAnimation to smoothly finish the movement at the same speed.
When the drawer starts to open he pauses all the video and other animations. This really increases the performance of the drawer animation.
Anything that is not currently shown on the screen has its visibility set to false. So if the drawer is closed, then everything in the drawer is invisible (since it is in a frame he just sets the frame to invisible). This keeps it from rendering and gives what is visible all the processing power. This is a common suggested optimization with many mobile development tools.
It is important to think about a mobile app’s interface as a mobile app. Don’t try to squeeze a desktop app onto a mobile device. That will only frustrate you and your users.
In his lists of cameras he uses a TVertScrollBox and fills it with a custom component that contains TImages and TLabels. That gives him maximum flexibility for the drag to reorder (again a Pan Interactive Gesture). He did find that the TLabel has better performance than drawing the text manually inside his custom control.
There were a lot of things he shared where he spent a little extra time to get things just right, and that is what makes the difference for a really smooth user interface. When asked about the learning curve to move from Desktop VCL to FireMonkey Mobile he said there was just a little learning curve, but now he really likes FireMonkey better than VCL. There was talk about having him collaborate for a user interface webinar, which I’m sure will be very informative.
You can catch Eric’s appearance in our Devices and Gadgets webinar on the webinar replay (posting any day now). And download his sample code (along with the rest of the code from the webinar).
What are some tips and best practices you’ve found in your FireMonkey mobile development?
Google’s new Glass platform is a very revolutionary Android device, but the question I really wanted to know is if I could develop for it with Delphi XE5. Turns out the answer is Yes.
There are actually two different options for developing Glassware: Mirror API and GDK.
The first is the Google Mirror API, which allows you to build services, called Glassware, that interact with Google Glass. It provides this functionality over a cloud-based API and does not require running code on Glass. This is accomplished through a REST and JSON based API. Thanks to the new TRESTClient components in Delphi XE5 this should be easy enough to do.
The GDK on the other hand is the avenue where you build an actual APK that runs on the Google Glass device itself. This gives you the most access to the device, its sensors and features. Turns out this is also easy enough to do with Delphi XE5.
The actual GDK builds on top of the Android SDK. You can develop apps to run on Glass with either the Android SDK or GDK, but the GDK is necessary to take advantage of some of the Glass specific features.
If you run SysCheck on Glass (which takes some effort) you discover it has an ARMv7 PRocessor rev 3 (v71) with Android OS Version 4.0.4 and NEON support. Those meet the main requirements for Delphi XE5 development. So I created a simple Hello World app and ran it.
This first screenshot shows Glass appearing in the Project Manager as a valid target (once the required USB drivers were installed, which was tricky for glass).
Here is a screenshot of the app running on Glass
I didn’t hide the status bar, which most Glassware does, and it does nothing other than serve the purpose of showing a Delphi XE5 app running on Google Glass. There were no special settings (other than the dark theme, which is a matter of taste) to make the app run on Glass. It just works.
And lastly a quick selfie of me and Glass, taken through glass.
I was hoping it would look more red than orange, but should have known Tangerine would be orange.
Rest assured, there will be more coverage of Delphi and Glass. We are just getting warmed up. This app was not using the GDK (which is still in Beta) but it is an actual Delphi app running on Glass. What an exciting day!
With the release of Delphi XE5 I’ve made the source of the Mobile REST Client Demo available. This is a really super simple demo of the Mobile REST Client in XE5. It is designed to show up how you can consume a JSON REST Service and adapt it into a DataSet and then bind that to the UI. If you change the data source you will probably need to change the live binding.
I’ve changed the demo from the one I used in the video to consume an OData data source. OData is a new standard backed by Microsoft for sharing data over the web. You can think of it as SQL for the web. It is a combination of other technologies, including REST, AtomPub, and JSON. Sybase supports OData on all of their databases now, as does Microsoft and others.
The change was simply a matter of pointing it to the Northwind OData endpoint provided on Odata.org. The binding is setup to show the company name in the listview. I added the ability to specify a Root Element, but that isn’t necessary for the demo.
This new technology works in both desktop and mobile, FireMonkey and VCL. It should also work in C++ Builder.
People have asked for a copy of the utility I wrote to view the attached Android device on the screen. It uses the built in screencap functionality of Android and the ADB (Android Debug Bridge) to grab and display a series of screenshots. It requires the Android SDK installed and does not require a rooted device.
The speed of update has to do with the screen resolution and image complexity. Simple screens (text and controls) update about twice a second. More complex screens (pictures, graphics, etc.) are slower than that.
For best results, turn on “Show Touches” under debug options.
There are a few pending features that I just haven’t gotten to. If you’d like to contribute let me know. Thanks to Stephen Ball for all his contributions already!
Welcome to Episode 27 of the Podcast at Delphi.org for Monday the 20th of April, 2009.
This episode was recorded with Nick Hodges on Thursday, the 17th of April, 2009. Nick discusses his new role as an R&D manager and some of the other changes going on at CodeGear. Also discuss the upcoming release of Delphi, the DelphiLive! conference, and some of the suggestions on Delphi.UserVoice.com.
Be sure to leave your feedback on the Delphi UserVoice page. There are four forums, so if you don’t see the feature request you are looking for, it may be in a different forum. Nick said Embarcadero is looking at all their user feedback, including User Voice. We marked a bunch of the suggestions with updated status.
Wanna see what is next in Delphi? Sign up for the Delphi Weaver and Delphi Prism betas. Nick suggested that pretty much everyone who signs up will get accepted but are some pretty tough questions that you need to answer.
Another great way to see what is coming up in the world of Delphi is to attend DelphiLive! of course we have a few podcasts about it too.
You may be surprised how much more you can get for a little more money with Embarcadero’s All Access, which we also have a podcast about it too. They are working on the Delphi instant-on still though. It may be a platform for a component iTunes, which would be really cool.
In this episode I talk with Jamie Ingilby, Steven Kamradt and marc hoffman. We introduce the Delphi Projects series which focuses on simple useful projects written in Delphi. Our first project is a Twitter client written in Delphi Win32.
This episode is the start of a series of podcasts. I thought it would be more interesting if there was something more to this podcast then just interviewing people and discussing Delphi news. So what we have done is started a series of Delphi projects that a small group of volunteers will work on and then discuss how the project goes via the podcast. Our first projects is a Twitter client written in Delphi.
Leave suggestions for names for the client in the comments. Allen Bauer is already using the Delphitter name. I am kind of leaning towards something that combines both Delphi and Twitter, but it needs to not contain the whole word “Twitter,” but you can be creative too. I’ll set up a poll with all the suggestions so everyone can vote. I have a name in mind already, but I am not attached to it.
If you are excited about this then please spread the word!