- Ionic:Hybrid Mobile App Development
- Rahat Khanna Sani Yusuf Hoc Phan
- 358字
- 2021-07-09 19:00:32
Building a dummy app
After successfully setting up the environment correctly, you must be excited to build your first app. In this section of the chapter, we will use the commands to learn how to create a sample Ionic-based Hybrid App and build it to run on an actual device or emulator:
- We will create the initial project using the Ionic
start
command and name our projectMyFirstApp
. The output will be as illustrated in the following screenshot: - After the successful creation of your project with the default Ionic template, go to your project folder using the command
$ cd MyFirstApp
.Now, as we are in an Ionic
project
folder, we can run Ionic project-specific CLI commands. Any platform can be added to the project to build the specific app:$ ionic platform add android
We will add an Android platform as it will work on all machines, such as Windows, Linux, or Mac. Ionic will download Android-specific default resources such as icons and splash screens, and also add some important plugins by default. A customized keyboard plugin is bundled with the Ionic app.
- In order to test the app and view it in your browser, use the Ionic
serve
command:$ ionic serve
This will open the Ionic app in your default browser.
The latest Chrome version provides a way to emulate various mobile device screen sizes. Open Developer Tools (F12), select Console from the top-right corner, and select Emulation. You can alternatively select the mobile icon from the top-left corner of the window. Please see the following screenshot:
- Now, we can build the Android App and run it on an actual device or emulator:
$ ionic run android
This will fire up the emulator if there is no connected device, then start the build process. It will generate the
.apk
file and then deploy it to the emulator or the connected device that is available.This would be a Eureka moment, seeing your first actual app on the device and playing with it. In the next section we discuss some of the common issues you may have faced during the process and provide solutions for them.
- JBoss Weld CDI for Java Platform
- 解構產品經理:互聯網產品策劃入門寶典
- Learning RxJava
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Visual C++實例精通
- The Computer Vision Workshop
- Bootstrap Essentials
- Lua程序設計(第4版)
- Python程序設計案例教程
- Java程序設計
- Clean Code in C#
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)
- PHP與MySQL權威指南
- 奔跑吧 Linux內核
- Python Machine Learning Cookbook