From 9ed8a67c5c06d103977b6ed7c699df972f8f99f4 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 28 Apr 2018 00:36:03 +0100 Subject: [PATCH 1/2] standardised README.md. Created BUILD.md for full build instructions. --- BUILD.md | 61 ++++++++++++++++++++++++++++++++++++++++ README.md | 83 +++++++++++-------------------------------------------- 2 files changed, 77 insertions(+), 67 deletions(-) create mode 100644 BUILD.md diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 0000000..0c57ce5 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,61 @@ +## 64-bit Ubuntu 16.04 LTS build instructions +While these instructions are for Ubuntu 16.04, the same steps have also been confirmed to work on 14.04 (which is the Travis CI environment), 17.10 and 18.04. + +### Install Prerequisites + +#### Requirements +* JDK 1.8 +* Android SDK +* Android NDK +* Buildozer + +#### Apt Packages +Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html +``` +sudo dpkg --add-architecture i386 +sudo apt-get update +sudo apt-get install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 +``` +Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package. + +#### Install Cython +``` +sudo pip install --upgrade cython==0.25.2 +``` + +#### Install buildozer +A forked version of `buildozer` needs to be installed in order to copy the React Native UI source files into the corresponding directories. +``` +git clone https://github.com/akinwale/buildozer.git +cd buildozer +sudo python2.7 setup.py install +``` + +#### Create buildozer.spec +Assuming `lbry-android` as the current working folder: +* Copy `buildozer.spec.sample` to `buildozer.spec` in the `lbry-android` folder. Running `buildozer init` instead will create a new `buildozer.spec` file. +* Update `buildozer.spec` settings to match your environment. The basic recommended settings are outlined below. + + +| Setting | Description | +|:------------------- |:-----------------------------| +| title | application title | +| package.name | package name (eg. browser) | +| package.domain | package domain (eg. io.lbry) | +| source.dir | the location of the application main.py | +| version | application version | +| requirements | the Python module requirements for building the application | +| services | list of Android background services and their corresponding Python entry points | +| android.permissions | Android manifest permissions required by the application. This should be set to `INTERNET` at the very least to enable internet connectivity | +| android.api | Android API version (Should be at least 23 for Gradle build support) | +| android.sdk | Android SDK version (Should be at least 23 for Gradle build support) | +| android.ndk | Android NDK version (13b has been tested to result in a successful build) | +| android.ndk_path | Android NDK path. buildozer will automatically download this if not set | +| android.sdk_path | Android SDK path. buildozer will automatically download this if not set | +| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder | +| p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build | + +#### Build and deploy the APK +Run `./build.sh` in `lbry-android` to build the APK. The output can be found in the `bin` subdirectory. + +To build and deploy, you can run `./deploy.sh`. This requires a connected device or running Android emulator. \ No newline at end of file diff --git a/README.md b/README.md index 7dbd3f8..affbff1 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,24 @@ +# LBRY Android [![Build Status](https://travis-ci.org/lbryio/lbry-android.svg?branch=master)](https://travis-ci.org/lbryio/lbry-android) -## 64-bit Ubuntu 16.04 LTS build instructions +The LBRY Android app running the Python lbrynet-daemon as a background service and a UI layer built with React Native. The APK is built using buildozer and the Gradle build tool. -### Install Prerequisites +## Installation +The minimum supported Android version is 5.0 Lollipop. There are currently 2 options for obtaining the APK. The latest APK release can be downloaded from http://build.lbry.io/android/latest.apk. You will need to enable installation from third-party sources on your device in order to install from this source. The other option is to install from the Google Play Store. -#### Requirements -* JDK 1.8 -* Android SDK -* Android NDK -* Buildozer +## Usage +The app can be launched by opening **LBRY Browser** from the device's app drawer or a shortcut on the homescreen if that was created upon install. -#### Apt Packages -Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html -``` -sudo dpkg --add-architecture i386 -sudo apt-get update -sudo apt-get install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 -``` -Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package. +## Running from Source +The app can be built from source using `buildozer`. The first thing you will need to do after cloning the repository is create a `buildozer.spec` file. You can base your spec on the provided sample file `buildozer.spec.sample`. Please read [BUILD.md](BUILD.md) for detailed build instructions. -**Additional package for building libgmp** -``` -sudo apt-get install m4 -``` +## Contributing +Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing -**Additional package for the pycrypto recipe** +## License +This project is MIT licensed. For the full license, see [LICENSE](LICENSE). -This had to be installed due to an error regarding the `` include not found. -``` -sudo apt-get install libc6-dev-i386 -``` +## Security +We take security seriously. Please contact security@lbry.io regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it. - -#### Install Cython -``` -sudo pip install --upgrade cython==0.25.2 -``` - -#### Install buildozer -``` -git clone https://github.com/kivy/buildozer.git -cd buildozer -sudo python2.7 setup.py install -``` - -#### Create buildozer.spec -Assuming `lbrydroid` as the current working folder: -* Copy `buildozer.spec.sample` to `buildozer.spec` in the `lbry-android` folder. Running `buildozer init` instead will create a new `buildozer.spec` file. -* Update `buildozer.spec` settings to match your environment. Basic recommended settings are outlined below. - - -| Setting | Description | -|:------------------- |:-----------------------------| -| title | application title | -| package.name | package name (eg. lbrynet) | -| package.domain | package domain (eg. io.lbry) | -| source.dir | the location of the application main.py | -| version | application version | -| requirements | the module requirements for building the application | -| services | list of Android background services and their corresponding Python entry points | -| android.permissions | Android manifest permissions required by the application. This should be set to `INTERNET` at the very least to enable internet connectivity | -| android.api | Android API version (21 and 24 have been tested to result in a successful build) | -| android.sdk | Android SDK version (21 and 24 have been tested to result in a successful build) | -| android.ndk | Android NDK version (13b has been tested to result in a successful build) | -| android.ndk_path | Android NDK path. buildozer will automatically download this if not set | -| android.sdk_path | Android SDK path. buildozer will automatically download this if not set | -| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder | -| p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build | - -#### Build and deploy the APK -Run `buildozer android debug` to build a debug APK, or `buildozer android release` to build a release APK. - -To deploy and run the APK on a connected Android device, you can run `buildozer android debug deploy run`. - -Run `buildozer android clean` to clean the package if you intend to rebuild. +## Contact +The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.io) From 297b2e082671c26db69139463f509659e77dea96 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 29 Apr 2018 17:09:39 +0100 Subject: [PATCH 2/2] added npm instructions --- BUILD.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BUILD.md b/BUILD.md index 0c57ce5..b400d11 100644 --- a/BUILD.md +++ b/BUILD.md @@ -8,6 +8,8 @@ While these instructions are for Ubuntu 16.04, the same steps have also been con * Android SDK * Android NDK * Buildozer +* Node.js +* npm #### Apt Packages Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html @@ -56,6 +58,8 @@ Assuming `lbry-android` as the current working folder: | p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build | #### Build and deploy the APK +Run `npm i` in the `lbry-android/app` folder to install the necessary modules required by the React Native user interface. + Run `./build.sh` in `lbry-android` to build the APK. The output can be found in the `bin` subdirectory. To build and deploy, you can run `./deploy.sh`. This requires a connected device or running Android emulator. \ No newline at end of file