Skip to content

Delphi XE5 Android app running on Google Glass with a BlueTooth keyboard

Jim McKeeth was the first of us to get Google Glass and to build the first Delphi XE5 app to run on glass.  I now also have Google Glass and built my first Delphi XE5 app for it. I paired my Samsung BlueTooth wireless keyboard to my Glass so that I can do data entry into a Delphi FM form.  The program code is the standard TEdit, TLabel and TButton app. Here is the form and the code:

    type
      TForm4 = class(TForm)
        Edit1: TEdit;
        Button1: TButton;
        Label1: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    var
      Form4: TForm4;
    
    implementation
    {$R *.fmx}
    procedure TForm4.Button1Click(Sender: TObject);
    begin
      Label1.Text := Edit1.Text
    end;

Here is the Project Manager window in the IDE showing my project’s target platforms including Win32, Android (Google Glass, Samsung Galaxy S4 and Android Emulator), iOS (iPhone and iPad both running iOS 7), and iOS Simulator:

With the keyboard I can use the Tab key to move around the form and type into the edit box. After compiling and deploying my "Project4" application to Glass, you can see the FM icons for each of my apps on my Glass desktop:

Here is the screen grab after I type some text into the edit box and hit the button.

The same app above can be compiled for Windows, OSX, iOS and Android using the same source code and project. Get started building Android apps using Delphi XE5 and those apps will also work on your Glass (when you get one). Of course there is always more to do including added support for Glass specific APIs.  More about this in a future blog post.

{ 1 } Trackback

  1. [...] Nos cuenta David Intersimone en su blog como ha conseguido facilmente hacer una app con Delphi XE5 que conecta un teclado Bluetooth con sus Google Glass (Android). Y por supuesto, la misma app funciona en Windows, en OSX y en iOs. Solo es un ejemplillo, pero muestra el potencial que tiene Delphi como herramienta de desarrollo multiplataforma. Tags: No tags Categories: Uncategorized You can leave a response, or [...]

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

Close