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