- 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.
- ClickHouse性能之巔:從架構設計解讀性能之謎
- 密碼學原理與Java實現
- Learn Programming in Python with Cody Jackson
- Kotlin Standard Library Cookbook
- SAS數據統計分析與編程實踐
- Functional Kotlin
- Java程序設計
- HTML5與CSS3基礎教程(第8版)
- OpenCV 4計算機視覺項目實戰(原書第2版)
- Multithreading in C# 5.0 Cookbook
- HTML5+CSS3+jQuery Mobile APP與移動網站設計從入門到精通
- Python高性能編程(第2版)
- 信息學奧林匹克競賽初賽精講精練
- 測試工程師Python開發實戰
- Office VBA開發經典:中級進階卷