Main /
How to create iOS and Android Apps(Note: Applies to EJS Version 6.0 and beyond, and IONIC version 2.) This short guide explains how to create an iOS or Android App from your current EJS simulation (i.e. the process to follow to correctly use the Create Single App option of EJS menu.) The steps to follow are: 1. Install the software platform called IONIC in your computer that allows you to create APPS from a given project structure. IONIC provides tools to create JavaScript+HTML programs that run on mobile devices as if they were native apps.
2. Create a basic IONIC project.
3. Use EJS to overwrite the IONIC basic project with the simulation files. That is, EJS helps you modify the contents of the basic project to create an APP that displays your simulation.
4. Test your modified IONIC project.
5. Fine-tune and deploy your App.
Step 1: Install IONIC in your computer (if you haven't done so before)The tasks in this step need to be done only once, no matter how many IONIC Apps you create. (Note: You need Internet connection for this.)
sudo npm install -g cordova
sudo npm install -g ionic
sudo npm install angular-ui-router
sudo npm install angular-sanitize
Step 2: Create a basic IONIC project for your appWe now exemplify the creation of an IONIC project called, say MyModelApp. In what follows, replace the word MyModelApp with the name you chose for your new app. The tasks below need to be done once per model App you create. (Note: You need Internet connection for this.)
cd MyAppsFolder
ionic start MyModelApp blank This takes a few seconds... and creates a new directory (called MyModelApp) in your hard disk. (When asked: Would you like to integrate your new app with Cordova to target native iOS and Android? (y/N) , you can answer no: n) (When asked: Install the free Ionic Pro SDK and connect your app? (Y/n) , you can answer no: n)
cd MyModelApp
ionic cordova platform add ios (Actually, this 'add' is not needed on Mac OSX.) ionic cordova platform add android (You may need to edit the /android/project.properties file, to set the correct Android target version for your device.)
npm install @ionic-native/keyboard --save
npm install @ionic-native/splash-screen --save
npm install @ionic-native/screen-orientation --save
Step 3: Use EJS to overwrite the basic project filesLoad your favourite simulation in EJS and Select the Create Single App option in EJS menu. When prompted to select a directory, choose your newly created IONIC project folder (in our example, MyModelApp). This is all there is. Your IONIC project now has all the simulations files in place to make your simulation run as an App. Step 4: Test the appYou are now ready to test the app.
This will show the app as a new page in your favourite browser in your computer. If you have the Ionic DevApp (available for free in your favourite App Store), you can also use test the app in your Device.
Step 5: Fine tune and deploy the appThere are a few final steps required to deploy your App to your mobile device.
|