Skip to content

Development Environment Setup

billmeek edited this page Nov 1, 2014 · 21 revisions

What's this for?

Some users may want to build MythTV-Android-Frontend from source. This enables them to get the latest version of the code, use enhanced debugging tools and even make local changes to suit their needs.

In the following, there are references to ADT and Eclipse, which are:

  • Android Developer Tools
  • Eclipse IDE for Java Developers

Here's how to get started.

Download the Android Software Development Kit (SDK) Bundle

  1. Go to the Android SDK page
  2. Click on Download and select the proper Package for the host's Platform
  3. Agree to the terms and conditions
  4. In this Wiki the download directory will be ~/source
  5. Note that these instructions were written using *buntu platforms

ADT Bundle Configuration

  1. cd ~/source
  2. unzip adt-bundle-<os_platform>.zip
  3. Optional: For convenience, rename the directory just created:
  • mv adt-bundle-<os_platform> adt
  1. 64 bit Mythbuntu users may need to install 32 bit libraries:
  • sudo apt-get install ia32-libs
  1. Users may need to install their distribution's Java package:
  • sudo apt-get install java-common
  1. Edit the ~/source/adt/eclipse/eclipse.ini file, see: Recommended Additions to eclipse.ini below
  2. Adjust the SDK user's $PATH variable, see: Suggested $PATH Configuration below
  3. For additional detail, refer to Setting Up the ADT Bundle

Eclipse Development Environment Configuration

  1. From the command line, type eclipse
  2. Click on the X in the upper-left to dismiss the splash screen
  3. Install the Maven, Eclipse Git and Simple Logging Facade for Java plugins
  • From the Help menu, select Install New Software...,
  • In the Work with: box, select --All Available Sites--,
  • In the filter box under the above, enter maven
  • Wait until the Name box populates
  • Click on the Select All, Next Next and Finish buttons
  • When asked to restart click Yes
  1. Repeat the previous bullet points replacing maven with egit and slf4j
  • N.B.: When installing SLF4J, choose only the Maven Integration for Eclipse version
  1. Upload a copy of Mythtv Android Frontend from GitHub
  • Select the Open Perspective (small box on the left side of the tab in the upper right of the screen),
  • Select Git Repository Exploring.
  • In the Left-hand pane, click on Clone a Git Repository
  • In the popup, select GitHub, click on Next
  • In the Search box, enter MythTV-Android-Frontend and click on Search
  • Select the entry that says: MythTV-Clients/MythTV-Android-Frontend
  • Click on Next and on the next page: Select All, Next on the next page: Finish
  • In the upper-right, select the Java Perspective
  • From the menu, select File, Import...
  • On the popup, expand Maven and choose Existing Maven Projects
  • On the next popup, search for the directory used above (probably ~/workspace/MythTV-Android-Frontend
  • Click on Next and then Finish
  • In the next popup, Select All and Finish
  • Expect to see a Security Warning
  • When asked if you want to restart, click on Yes
  • An automatic build will start, give it some time and errors will go away.

Build Work Flow

Not all of the steps listed below are required for any given change, however, they are listed here for convenience.

  1. Connect an Android device to a host USB port
  2. Switch to the Git Repository Exploring Perspective
  • On the left-hand window, right click on MythT-Android-Frontend and select Pull to get the latest commit(s)
  1. Switch to the Java Perspective
  • From the menu bar, select Project then Clean...,
  • Right click on mythtv-android-frontend and select Maven, Update Project... and OK
  • If desired, select file(s) under MythTV-Android-Frontend src and edit,
  • Right click on MythTV-Android-Frontend and select Run As then Android Application
  • Select the device to use (there will likely be only one)
  • For installation errors, see the Console window and follow its instructions
  • The first time the above is done, answer Yes to Automatically Monitor LogCat
  • To observe program flow, maximize the LogCat window (lower right)
  1. There is a README file included with the source. It has additional items of interest to developers.

Comments About Maven

As part of this Open Source project, most of underlying methods used to access the MythTV Services API have been placed in a separate repository and are available to any developer/project via the Maven plugin, and its source is also on GitHub.

This means that the source code for that portion of the project was not downloaded in the above instructions. Rather, it is read in at build time.

If the project changes the Maven release and references it in the source, builds can fail until the Maven libraries have been synced. To see their status, visit: The Central Repository

Recommended Additions to eclipse.ini

Note: Delete any existing properties that match the following:

-XX:-UseParallelGC
-XX:-UseConcMarkSweepGC
-XX:+UseFastAccessorMethods
-DMAVEN_OPTS="-Xms64m –Xmx128m"
-Xmn128m
-Xss1m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-Xms768m   -----> These 2 probably will already exist, choose 1 size
-Xmx1024m  ----->

The above should be adjusted based on the user's system memory size.

Suggested $PATH Configuration (to be included in a .bashrc file for example)

export ANDROID_HOME=~/source/adt/sdk

type -P eclipse > /dev/null
if [ $? -ne 0 ]; then
   PATH=~/source/adt/eclipse:$PATH
fi

type -P android > /dev/null
if [ $? -ne 0 ]; then
   PATH=$ANDROID_HOME/tools:$PATH
fi

type -P adb > /dev/null
if [ $? -ne 0 ]; then
   PATH=$ANDROID_HOME/platform-tools:$PATH
fi

End of Life Notice:

Thanks for everyone that tested the MythTV Android Frontend project!

There will be no more development on it and a new MythTV Player For Android is now in development.

And for those that may think the new project will support Live TV, as of MythTV 0.28-pre, there is still no Services API interface for Live TV, so it still isn't possible.

MythTV Player for Android is going to focus solely on playing the media you have on your backend, forgoing all the rest of the frontend features that you would find on a traditional frontend.

Here is a short list of the goals for the project:

Recording Playback with no dependencies on external players
Video Playback with no dependencies on external players
Chromecast Support
Leanback interface for Android TV

You can follow the progress of the code here: https://github.com/MythTV-Clients/MythtvPlayerForAndroid

We are currently working out some minor layout issues and finalizing playback scenarios in the app and are hoping to release this for beta very soon.

Clone this wiki locally