Giter VIP home page Giter VIP logo

tribler-android's Introduction

Tribler Android - Beta Port

Tribler Android is an application that runs the Tribler core on Android using Python for Android, with a native Android Java GUI. You can search for torrents using the decentralized Dispersy network, and stream media files over BitTorrent using the built-in VLC for Android player.

How to build

First clone this repository:

git clone https://github.com/Tribler/tribler-android.git

In order to build the application you will need to package the Python code including its libraries for Android. This can be done by first installing buildozer:

pip install buildozer  

Buildozer automates the build process which can be configured in the buildozer.spec file (but the one in this repository should already be fine). You can then run the build script in the tribler-prototype directory, which will call buildozer for you:

cd tribler-prototype  
./build.sh

After you've ran the build script, the Python code and its dependencies such as Tribler will have been compiled and packaged into private.mp3 located in the assets folder of the Java part of the application (tsap/app/src/main/assets).
From there you should be able to run the entire application using Android Studio, just as you would run any Android Studio application.

Solutions to common problems

You might need to use the following commands if you encounter any problems with buildozer:
If it complains about missing swig, then install it using:

sudo apt-get install swig  

In case you get a problem about ccache: invalid option -- 'l', then remove ccache:

sudo apt-get remove ccache  

If you get the following error: ImportError: No module named 'pip._vendor.requests', then just run the build script once more. If you get an error saying 'virtual-env not installed', then make sure you're using Python 2(.7) and not Python 3.

Optional

Install Android NDK, SDK, P4A and Ant in custom directories and set your .bashrc (located in /home/youruser/.bashrc) variables to these dirs. Below is an example of what to add to your .bashrc file:

export APP_ANDROID_ANT_PATH="/usr/bin/"
export APP_ANDROID_SDK_PATH="/home/youruser/Android/Sdk/"
export APP_ANDROID_NDK_PATH="/home/youruser/Android/android-ndk-r10d/"
export APP_ANDROID_P4A_DIR="/home/youruser/Android/python-for-android/"

Buildozer hack to keep your build directory

After every successful buildozer build, at least in version 0.28, buildozer will delete your build directory in python-for-android (P4A). This is not really a problem, except when you add or update Python dependencies, because that would require buildozer to rebuild from scratch again to include your changes. Since the build process takes quite a long time, if might be useful to prevent buildozer from throwing its build folder away after a successful build. Open the following file:

sudo vim /usr/local/lib/python2.7/dist-packages/buildozer-0.28dev-py2.7.egg/buildozer/targets/android.py

And then comment out the following line:

 #self.buildozer.rmdir(join(self.pa_dir, 'build'))

Project structure

/tribler-prototype/ -> contains the Python code and tests for this code. It acts as a wrapper around Tribler code.
/tsap/ -> contains the Android Studio format for an Android project in Java. /tsap-tests/ -> contains Java tests. /tsap-UItests/ -> contains Java tests for the user interface.

Java and Python communicate through a local webserver. The technique used for this is called XML-RPC.

Dependencies

This project uses the following components:

For testing purposes:

tribler-android's People

Contributors

d1rk123 avatar javto avatar nspruit avatar ontwikkelaar avatar wtud avatar

Watchers

 avatar

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.