Aug 12, 2018

Running Ionic 4 Application On Android Device

Hi Guys, hope you all followed my previous article about Getting Started With Ionic. Lets see how we can test this simple application in an Android Device.

First of all what you have to do is setup the environment. 

Step 1 : Install Java Development Kit. I have an bit old article about setting up the java environment.


Step 2 : We should install the Android SDK. You can simply download and install Android Studio.


Step 3 : In order to test and configure it on Android Device, you may need to configure Gradle Daemon. Without going into much details or over confusing you can simple achieve this by creating a sample android project in Android Studio and adding few target SDks.


Step 4 : Run the below command to add the android platform.


1
ionic cordova platform add android

This command will take few minutes depending on your internet connection. if everything goes correct you will get below output.



Step 5 : Lets build it for Android using below command.


1
ionic cordova build android

If everything goes correct you will get below output.






Step 6 : That's all you have to do. Copy the APK file to Mobile Device from the folder location shown in the output. 


Step 7 : Click on the APK file in the mobile device. You will get the below message, because we are trying install an APK which is not fully trusted APK with google agreements. For now we only need to run this on our device. In my case I'm trying it on my Samsung Galaxy S6.





Step 8 : Click Settings.





Step 9 : Then click on the Unknown Source Toggle button.





Step 10 : Then press OK




Step 11 : Then Press Install



If everything went well you will get the following message.


Step 12 : Then click open. You will see your application in mobile.



Hope you follow it up. Read my next article about Working With Ionic Modal Popup.

No comments:

JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...