Look at the platform-independent, web-based app tool called PhoneGap.
- [Instructor] PhoneGap is a distribution of the Apache Cordova project, which has an additional set of tools to enable mobile apps for iOS, Android, or Windows mobile devices, to be developed using Web development techniques. To start, you'll need to download the desktop application from the PhoneGap site to your PC, and download the mobile agent from the Google Play Store to your mobile phone. It's called PhoneGap Developer. The agent runs in the mobile device, and allows preview of the app on the mobile device.
PhoneGap starts up either with a blank screen, if no app has been running, or showing the last run app with its server running on port 3000. In my case, I don't have an app open, so we have a blank screen. The screen has a menu at the top, and key action icons on the left. A plus sign to create a new project, and a settings symbol. The settings symbol allows us to change the server port, however, I'll leave it as default on 3000. The menu at the top provides details about PhoneGap, allows a project to be created, opened, and closed, provides for selecting and copying, and has help functions.
Let's create a new project by pressing the Plus key. Here we get presented with a variety of application templates we can start with, including a blank project, and a Hello World. Let's select the Hello World project, and press Next. Okay, I'll select Seko on PhoneGap, as my path, and Hello as the project name.
And I'll use "com.malcolmshore.hello" as the ID. I can now create the project. Okay, now we see the project is loaded, and at the bottom we have a server running on an internal IP address, 192.168.56.1, port 3000. On my system I also have alternate site addresses. These are just different ways to access the website, and we'll look at my LAN address shortly.
Let's browse to the website to preview the app. We can see that we have a site with Hello World on the tab, and it's displaying the PhoneGap icon, and a message that PhoneGap is ready. I can also use the mobile PhoneGap Developer app to check the website. When I run the app, it shows an address box with 127.0.0.1 3000 loaded. I can change this to 192.168.1.113 3000, my local network address path to the site, and press Connect.
PhoneGap Developer says connecting, downloading, and then extracting, and displays the same PhoneGap image, and the device is ready message. Now, I haven't actually deployed this application to my mobile, it's just been rendered by the PhoneGap Developer app. Let's have a look at how the app is being created. I can see the app structure, with 4 folders and some files. One of the folders, www, holds the website that provides the source of the eventual app, in this case the Hello World website, which is being created.
Let's navigate into the www folder, and I'll open the index.html file with WordPad. I'll change the text PhoneGap to, "A big hello," and save the file. The mobile device changes immediately, and when I go back to my browser, that's also changed. Of course, I can now replace the index.html with a complete website, that I've already built, which I would typically do by starting with a blank project.
PhoneGap can be used to create a mobile app based on web development techniques. However, it also has another big advantage, which is to enable the offline deployment of a website. For instance, if you hold your technical documentation on a website, you can deploy an offline version of your documentation via a mobile app. Now we've seen the website and we're happy with it, let's deploy this as an app. To do this, we need to use either the command line tool or, as I'll do, the PhoneGap build Cloud service.
There's a bit of preparation to do to set up the service, but once done, you don't need to repeat it. Firstly, you'll need to create an Adobe ID if you don't already have one, and you can do that from this screen. I've already got an account set up, so I'll sign in. Secondly, you'll need to create a key to sign your apps. We do this using the standard Java tools, so you'll need to have Java installed. The certificate file is created at the command line by using the key tool, which comes with Java.
I'll create a sign in certificate called "my key," with a 2048 bit RSA key, valid for 10,000 days. I'll provide a password for the key store, and some certificate details regarding my name and organization. These are used to populate the X509 certificate. Okay, we've now created a file called "mykey.keystore." Okay, back at the PhoneGap website, I'll click on the pulldown at the top right, next to the head icon, and select Edit Account.
Here you can see your account details. The second tab is Sign In Keys, and you can select keys to add for each of the supported platforms. To set a new key up, I'll click on the Add key under Android, and I'll call it "my key." That's all done. I'm now ready to get back to building my app. Back in my build screen, the upload screen is displayed. I can either provide a git repository, or a zip file.
We'll create a zip file. At a minimum, PhoneGap needs a config.xml file, and an index.html file. For the Hello World app, I'll create a zip file containing the full www folder, as well as the config.xml file from the main folder.
Okay, let's upload this using the upload a zip file button. Okay, the app's now loaded, and we're ready to build. Let's click that action. Okay, I'll now click on the app icon to open the details page, and we can see the 3 builds with no key selected. Let's select our key for the Android build, and click on the Key Lock icon, and then to the certificate and key store passwords to unlock the key file.
I'll then rebuild the Android app. Okay, that's done. We can click on the download APK button at the right, and download our app. Note we can also use the QR code on the screen, and scan it to install the app on our mobile phone. Okay, we'll leave PhoneGap there for now, but we'll come back to our app as we start testing.
- 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