Giter Site home page Giter Site logo

jrp-team-1-app-android's Introduction

JRP Team 1 (Consumption) Study Android App

This tutorial will describe how you can run and test the app on your own computer (Mac only, sorry ๐Ÿ˜ƒ)

Table of Contents:

(1) Prerequisites

In order to emulate the app, you will need to install all of the following on your Mac:

  1. Xcode - Apple's integrated development environment for Mac

  2. homebrew - an excellent package manager for Mac OS, will be used to install npm

  3. npm - node package manager - will be used for the installation of other components

  4. Apache Cordova - a platform with a command line tool for building HTML/JS/CSS apps for mobile devices

  5. git - a source control system that allows you to collaborate on this project

    (1.1) Installing Xcode

    Keep in mind that Xcode takes ~5GB of your hard drive's space. Go to Apple's app store and install Xcode (use this link).

    After the installation is completed, open the Xcode app to simply accept the license agreement.

    After accepting the license agreement, there's only one step you need to take:

    1. Open your terminal (CMD + T and type terminal)
    2. Paste the following command and hit ENTER:
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

    Type in your password when prompted to, and that's it.

    (1.2) Installing homebrew

    Open your terminal (CMD + T and type terminal).

    First let's check if you already have homebrew installed on your Mac:

    Within the terminal, paste the following command:

    brew ls -l

    If the output is something along the lines of command not found: brew, then you should carry on as mentioned below.

    Within the terminal, paste the following command and follow the instructions.

    You might be prompted to insert your password (it's the same password you use to log into your Mac).

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    Hit enter and follow the instructions.

    (1.3) Installing npm

    Open your terminal (CMD + T and type terminal + ENTER), then just type the following command and press ENTER.

    brew update

    Then run the following command and press ENTER.

    You might be prompted to insert your password (it's the same password you use to log into your Mac).

    brew install node

    (1.4) Installing Apache Cordova

    Open your terminal (CMD + T and type terminal + ENTER), then just type the following command and press ENTER:

    You will be prompted to insert your password (it's the same password you use to log into your Mac).

    sudo npm install -g cordova

    (1.5) Installing git

    Open your terminal (CMD + T and type terminal + ENTER), then just type the following command and press ENTER:

    brew install git

(2) Cloning the app code

Now that you have installed all of the required package managers and the required software, you can clone the app.

Open your terminal and browse to a folder where you would like to download the app. For instance, if you would like to create a folder for projects workspace named workspace, use the mkdir command to create a folder and cd command to change the folder you are currently in:

# here we are creating a new folder under the home folder:

mkdir ~/workspace

# now we are switching the working directory to it:
cd ~/workspace

Next, let's use the newly installed git tool to clone the app from this repository:

git clone https://github.com/yuvalherziger/jrp-team-1-app.git

After the numbers finish crunching, you will have a new folder named jrp-team-1-app in place. Let's go ahead and change the working directory to the root app directory:

cd jrp-team-1-app

(3) Emulating the app on iOS

Now for the fun part ๐ŸŽ‰

While in the jrp-team-1-app working directory, type the following command:

cordova platforms add ios
cordova build ios

This command just built an ios app that's ready to be emulated. Lastly, let's run the app on the emulator:

cordova emulate ios

(4) Emulating the app on Android

Since emulating an Android device...

  1. requires a long setup that entails the installation of Android Studio and an AVD (Android Virtual Device);
  2. tends to be slow;

...I would strongly advise you to enable USB debugging on an Android device (provided that you posses one) and test the app on it. Under this link you can discover how to enable USB debugging on your Android device.

Next, you will need to make sure that

After enabling USB debugging on your Android device and connecting it to your computer with a USB cable, you can simply run the following command to build the app:

cordova platforms add android
cordova build android

Afterwards you should be able to run the app on your device by running the following command:

cordova run android

Cordova should automatically detect your connected device and target the app to it.

It just might be that you don't have an Android device, and in this case you can visit this link to find out how to create an Android Emulator.

Do mind the fact that you already have git and homebrew installed on your Mac from the previous steps of this guide.

If you have gone down the path of installing an Android emulator, the command to emulate it is the following one:

cordova emulate android

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.