How to Make an Android App From a WordPress Website
In this article, you will learn how to turn your WordPress website into an Android application. You will use the Google Material Design Lite (MDL) theme and the Android Studio plugin to create a professional-looking application. You will learn how to handle basic tasks like displaying posts, searching for posts, and adding and editing content.
What Is an Android App?
An Android application is a smartphone application that can be downloaded from the Google Play Store or Apple’s App Store. An Android app is designed to run on any Android device, from low-end devices such as smartphones to tablets to ultra-books. Android apps are built with the Material Design language (MDL) or Material Widget toolkits such as the Android Studio plugin, which provides the tools to build and test an app without needing to write a line of code.
Why Android?
With over 1.8 billion downloads on the Google Play Store, you’d think that Android would be a hard choice to avoid. But there are many reasons why you might want to develop an app for iOS rather than Android. For starters, Apple takes a more “closed source” approach to its proprietary software. That is, rather than allowing outside developers to write code and make modifications to core functionality as is the case with Android, the majority of the functionality in an iOS app is written by Apple employees. This limits what can be done with the apps on an iOS device. In addition, not all Android devices are created equal. Not all have the same amount of Ram (random-access memory), storage space, and/or processing power. Developing an app for Android, therefore, can result in a better overall user experience on your end.
Another important distinction to make is that an Android app can only be updated by the manufacturer or via factory-serviced reset buttons (like on a Samsung). This means that if you want your app to work on later versions of Android, you will have to either update it yourself or convince the manufacturer to do it for you. And last but not least, Android is open source, which means you have the ability (if you know how) to “customize” the operating system and its apps to your liking. This is not the case with iOS. The operating system and apps are designed to closely match Apple’s vision and cannot be changed without risking potential disasters.
Ok, so what is MDL and Android Studio?
Google Material Design Language (MDL)
Google created the MDL (Material Design Language) to bring a more unified look and feel to apps on various platforms. The MDL is designed to replace the Action Bar, which is the navigation bar at the top of the screen that features all of the app’s functions, with a Navigation Drawer. The Google Material Design Language (MDL) is more convenient than the Action Bar because it’s located at the very top-center of the screen. This means that it’s always visible regardless of how you navigate through a MDL-enabled app. And since the Navigation Drawer is always visible, it means that users can access and utilize all of the app’s functions from the get-go.
The Google Material Design Language (MDL) can be used to build any type of app, from travel to fitness, food to finance. More importantly, though, you will learn how to use it to build a fully fledged WordPress app in this tutorial.
Android Studio
Android Studio is the official development environment from Google for building Android apps. It is designed to make developing Android apps easy and fun. The best thing about Android Studio is that it provides a visual interface for app developers to construct applications quickly and easily. The interface is similar to that of a WordPress dashboard, which is why we are using it in this tutorial.
To get started, download and install the Android Studio plugin on your WordPress site. Then, navigate to Tools > Android > Studio in your WordPress admin area.
Once inside Android Studio, you will see a variety of tools at your disposal. The tools in Android Studio range from easy to use (like the Emulator that lets you test out your app before publishing it to the store) to the more advanced (like the Genymotion Emulator, which lets you test out your app on different versions of Android).
As we mentioned above, developing an Android app with Android Studio is easy. All you have to do is create a new Android Studio project, choose a name for the app, and select Google Service (GMS) as the targeted platform. Then, you can start populating your app with content. The good thing about this approach is that you don’t need to have any previous experience in software development to get started. You will, however, need to know a bit of the Android operating system in order to properly populate your app with content.
Step 1: Create a New Android Studio Project
As mentioned above, you will start by creating a new Android Studio project. On the left side of the Android Studio window, you will see a navigation area, which leads to a variety of projects and templates. To create a new Android studio project, click the + button at the top right of the window.
A modal window will pop up, asking you to choose the directory in which your new project will be stored. Navigate to your WordPress website’s public_html folder and click the Select button to choose this location.
After a few moments, the folder containing your new project will appear in the navigation area.
Step 2: Add the Google Sign-in Plugin
The next step is to add the Google Sign-in plugin to your new project. This will allow your users to sign in to your app using their Google accounts. To add the Google Sign-in plugin, click the File > New > Google > Sign-in > Import plugin from WordPress.
Next, click the + button to add the Google Sign-in plugin to your project.
A modal window will pop up, asking you to enter a namespace for the plugin. Then, you will need to select the Google Sign-in plugin from the list of available plugins.
Step 3: Create an Interface for the User to Login
After adding the Google Sign-in plugin to your project, you will see a Login screen, which will greet users once they have signed in. Let’s create an interface for the user to login to your app. To do this, head over to Design > Layout > Create > Interface. Then, click the + button to add a new page.
When you are in the Create Interface screen, you will need to provide the Login screen’s fields with a label and a placeholder. For the label of the Login screen’s email field, you can use the username that is registered with your Google account. For the password field, you can use the same password that you use for your Google account.
Then, in the Create > Interface screen, you will see the Login screen. Hit Finish to create your Login page.
Repeat the above steps to add more Login pages, this time choosing Facebook as the login option. You will also need to create an interface for the sign-in with Facebook.
Step 4: Create a Navigation Drawer
The Google Material Design Language (MDL) supports a Navigation Drawer at the top of the screen, which is why we are making one in our app.
While we’re in Design > Layout > Create, click the + button to add a new layout.