HOW TO CREATE A HYBRID APP WITH ANDROID STUDIO?

There has been an exponential rise in the purchase of android devices. With this growth of android devices, the demand for the apps is constantly increasing.

What are hybrid apps?

Just like websites on the Internet, Hybrid apps are designed and developed using the web technologies like HTML, CSS and JavaScript. Hybrid apps are similar to any other app on the phone. You can install and download them from the app store. The key difference is that hybrid apps are hosted inside a native application that uses mobile platform’s web view. This helps it to access all the capabilities like camera, accelerometer, sensors, contacts etc.

Android Studio is an easy to use Integrated Development Environment (IDE) that is used to develop android and hybrid apps. One can develop hybrid apps by following these simple steps:-

Design your Application

The first baby step towards building hybrid apps is designing your project. Before you start the development process, it is advisable to make sure that you have all the pre-requisites of the development process.

It is essential to have access to the features available in the browser if you are creating a pure HTML5 application. Make sure that you have all the pre-requisites in place. For example make Cordova CLI and the android SDK tools ready before going into the development phase. You will have to install Node.js before installing Cordova CLI.

Now, to install Cordova CLI, run the following commands

sudo npm install -g cordova

The next step is to download the Android SDK tools which you can download by clicking the following link…

http://developer.android.com/sdk/installing/index.html

 

HTML5 Mobile Framework Application

HTML5 Framework is the building block for creating an HTML 5 application. Another major tool JavaScript enables you to add animations, show/hide things on a website. Now in the next step, you can edit the index page of your website

Testing Application through Browser

HTML5 comes with an advantage that you can test the application through your local server browser. You can easily access your application by going through the following URL replacing MyHybridApp with the name of your app

http://localhost/MyHybridApp

If you are a chrome user, then you have added advantages. For example you can use Chrome DevTools to debug your application. You can even check the responsiveness of the app by clicking of the mobile icon on the top left side of the debugging page.

You can debug your application by inspecting the elements and using features like console, Network, source, application etc.

Packaging the application

To package the application, you will have to use third party applications like Xamarin and PhoneGap. Now, what these third party applications do is – they package the application in a native wrapper which acts as a bridge between the native API and your app. The application is loaded into the web view by the third party applications like PhoneGap. And this web view displays the application to the users.

Now, after the packaging of the application is done, we can generate a release version of the APK

Cordova build –release

When we have generated a release version, you can find your apk in the following location platforms/android/ant-build/MyHybridApp-release-unsigned.apk

To submit the apk in the app store, simply sign in and submit it.

The Testing Process

We know that we can test and debug our application using the chrome DevTools like console, Network, sources, application etc. But do you know that you can debug the application without using chrome development tools? We will have to run the application on actual device to test the hybrid app using native API.

One of the options on phone to debug app is GapDebug. By using this Gap Debug you can install .ipa files for IOS or .apk for android. It provides a debugging interface in which any kind of change in the interface will reflect the change in the application.

Distribution Process

Before you can launch the application on the play store, you will need to sign your application on app store. The pre-requisite for signing your application on the play store is to generate a keystore.

To create a keystore, one can use Java Keytool utility. This utility already comes with the standard JDK distribution and can be located at %JAVA_HOME%\bin. In windows, this can be found at C:\Program Files\Java\jre7\bin.

Final Process

After creating a keystore, you can easily sign in and users can install the uploaded app on the play store.

 

3 Replies to “HOW TO CREATE A HYBRID APP WITH ANDROID STUDIO?”

Leave a Reply

Your email address will not be published. Required fields are marked *