Physics is Beautiful mobile app.
This is the mobile app for Physics is Beautiful. Most of the app’s features are in the main repository, so please go there if you would like to contribute.
Install ionic.
npm install -g ionic cordova
Clone this repo and enter it.
git clone http://github.com/neilc314/physics-is-beautiful-mobile.git
Install dependencies.
npm install
First, start the physics-is-beautiful server, and make sure it listens on all IP addresses.
python ./manage.py runserver 0.0.0.0:8000
You can test a web-based version of the app by running the following. However, some plugins may not function properly in this mode.
ionic serve -c
If you use this, you can install Ionic DevApp to test the app on devices in your local network. This is NOT the recommended way to test the app; it is just a lightweight way of demonstrating some of the functionality
To test a real, native app you will need to do some additional work.
If you already have Android Studio or the command-line tools installed, you can skip this step.
Otherwise, it is recommended that you install the command-line tools from source through this page. You can use the included sdkmanager
script to install the necessary scripts. See the Android Developer link for more information, and for ease, add the scripts to your PATH.
You will need to use sdkmanager to install:
platform-tools
build-tools
You will also need to install Gradle. The best way to do this is through your system’s package manager.
Add Android as a platform.
ionic cordova platform add android
Then, connect your device and run the following. Note that USB debugging must be enabled on your Android device. To enable this, go to Settings > About phone and repeatedly press the “Build Number” button. Then go to Settings > Developer options > Debugging and enable USB debugging.
ionic cordova run android
If a physical device is not detected, cordova will attempt to run in an emulator.
If you get an error saying that Ionic can’t connect to a server, modify the rootUrl in src/providers/global-settings/global-settings.ts
. You’ll want to use an intranet IP such as 192.168.0.33:8000
.
To get your computer’s IP, run ip addr show | grep "inet "
and look for the non-internal IP (i.e. not 127.0.0.1
).
For example, if you see that the IP is 172.20.102.131/22
, you’ll want to set rootUrl = 172.20.102.131:8000
.