Ionic (a) build your first Android apk

Source: Internet
Author: User

1. Ionic Start myApp tabs >> Create an app

2. CD MyApp >> enter MyApp file

3, Ionic platform add Android >> app for Android platform

4. Ionic build Android >> Pack app Cheer APK installation package

Note: Throughout the process, your PC will need to install JDK, Ant, Android SDK, node. js, Ionic. When installing, be careful when configuring the environment, because the environment variable is the most problematic place in the final packaging.

You can make the following adjustments to your app:

1. Change app icon and start Page SplashScreen

Install Splashscreen:cordova plugin add Org.apache.cordova.splashscreen to the project

Modify the CONFIG. edit file

<preference name= "SplashScreen" value= "screen"/><!--file name without suffix png, default is screen-->
<preference name= "Splashscreendelay" value= "" "/><!--Splash display time, default is 3000ms--
<feature name= "SplashScreen" >
<param name= "Android-package" value= "Org.apache.cordova.splashscreen.SplashScreen"/>
</feature>

<platform name= "Android" >    <icon src= "resources/android/icon/1.png" density= "xxxhdpi"/>      < Splash src= "Resources/android/icon/1.png" density= "port-xxxhdpi"/> </platform>

2, ionic in the default after the installation of navigation in the bottom of the solution in iOS, tabs has been at the bottom. Ionic tabs is always on top of Android. If required, we can configure $ionicconfigprovider to implement

. config (function($stateProvider, $urlRouterProvider,$ionicConfigProvider) {
$ionicConfigProvider. Platform.android.tabs.style (' Standard '); $ionicConfigProvider. Platform.android.tabs.position ( ' Standard ');

  $stateProvider
//Wizard page. State (' tutorial ', {URL:‘/‘, Templateurl:' Templates/tutorial.html ', Controller:' Tutorialctrl ' }) //Setup an abstract state for the tabs Directive. State (' tab ', {URL:"/tab", Abstract:true, Templateurl:"Templates/tabs.html" }) //Each tab has a own NAV history stack:. State (' Tab.dash ', {URL:'/dash ', Views: {' Tab-dash ': {templateurl:' Templates/tab-dash.html ', Controller:' Dashctrl '}} ). State (' Tab.chats ', {URL:'/chats ', Views: {' Tab-chats ': {templateurl:' Templates/tab-chats.html ', Controller:' Chatsctrl '}} ). State (' Tab.chat-detail ', {URL:'/chats/:chatid ', Views: {' Tab-chats ': {templateurl:' Templates/chat-detail.html ', Controller:' Chatdetailctrl '}} ). State (' Tab.account ', {URL:'/account ', Views: {' Tab-account ': {templateurl:' Templates/tab-account.html ', Controller:' Accountctrl ' } } }); //If none of the above states is matched, use this as the fallback$urlRouterProvider. Otherwise ('/');});

Ionic (a) build your first Android apk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.