Look at the Embarcadero RAD Studio Delphi approach to creating Android apps.
- [Instructor] It's not unusual to want to have a common base of code and deliver an app in multiple forms. And we saw that development approach with PhoneGap. Another powerful development environment for multiple platforms is RAD Studio, with its common languages of either Delphi or C++. This is a commercial development environment for high-end application work. We'll have a brief look at how Delphi in RAD Studio works when developing Android apps, and later in the course we'll see how these apps look when we test them.
RAD Studio is provided by Embarcadero and can be obtained as a free starter edition or as professional, architect, and enterprise editions. It's used either as a Delphi environment or a C++ environment with licensing for Windows and Mac platforms. The mobile platforms require an additional license to enable the mobile add-on pack to be used. I'm at the main RAD Studio screen where I can set up a new project or open an existing one. I'll open my secure SMS sender application called SMS.
This is a small demo app to create an encrypted text message and send it as an SMS. I'm using a pseudo one-time keypad with a simple passphrase protection, a trivial approach, but useful to demonstrate RAD Studio. Let's start by looking at the screen. We can display this in master form, as it is now, or in Android 5-inch form. By using a master form, we can create an app using a generic form factor and then customize its layout for a number of different form factors.
This app allows us to generate a random keypad to use to encrypt our message and a synchronization function to send that protected by a master phrase to the recipient. We can then send messages which use the generated random keypad. If we look at the code, we can see a send SMS routine which makes a call to the SMS manager with a destination number and a message. Below that is the encrypt message routine which masks each byte of the message with a byte of the key and stores that in displayable hex form.
We could alternatively have coded it in something like Base64. There's a routine to generate a keypad from random numbers, then there's a routine to synchronize the message keypad with the message recipient, firstly masking it with a repeated synchronization phrase. This is sent as four text messages due to its size, each with a sync lead-in. Finally we have the send message routine, which will send the message in however many fragment texts are needed. I've got my mobile phone connected via USB and USB debugging set so I can run the app.
This starts by compiling it and deploying it into its target form, packaging it and installing it via USB. I can now run it on my mobile and send arbitrary length messages in streams of encyphered text using a pseudo one-time keypad. In a complete system, these would of course need to be decoded at the receiving point. Here we can see the APK that has been generated. We'll come back to this app shortly in the testing section, but for now, that's a very brief introduction to the use of RAD Studio for mobile development.
It's a completely different approach to developing Android apps, but one which is definitely worth considering for multi-platform situations.
- Understanding Android OS, app, and hardware security components
- Using the Trusted Execution Environment
- Developing Android apps with security in mind
- Analyzing existing applications
- Understanding Android vulnerabilities
- Securing Android apps
- Developing secure enterprise apps