Skip to content

Building Everything Overview

Bob Evans edited this page Apr 1, 2016 · 5 revisions

This page is replaced mostly by the Paco Dev on Mac

How to Build the Pieces of Paco

Introduction

This is the quicky quicky overview

Paco currently consists of an Android app that communicates with an AppEngine Java server. it can all be built form the commandline with ant (installed separately). Eclipse with the Google Plugin and the Android Developer Tool plugin will most likely make life a lot happier when you are developing.

Get the Source

To build the Android app or the Appengine app, first check out the code from the Source page. NOTE: Use the 'develop' branch. That is where the action is. master is used for periodic releases.

Configure Your Environment

The Android piece of Paco depends on there being an android-sdk on your path. So be sure you have the android sdk installed. You will need to install the actual Android versions as well. Paco is backward compatible to to Android 2.2 so be sure to download the Android 2.2 sdk in the Android manager.

Next, ant needs a file, local.properties, that points to that sdk. Create one of those in the Paco and PacoAndroidLib, and PacoTest directories and everything should be able to build.

Example: sdk.dir=/Users/bobevans/android-sdks

Build from the Root Directory

From the root directory, paco, run ant build

This will builld the Shared directory, the android app and the server.

After you have done this you can just build individual pieces unless you update something in the Shared directory. Most likely you will be building in Eclipse, so this is probably not a problem.

To build individual pieces keep reading.

Build the Android app

To build the Android app, as it currently is (not one you will want to ship), go to the Paco directory in the source and run ant debug That will build a debug release of the apk file that you can side-load.

Side loading involves setting your phone to allow Unknown Applications. This is in the Settings app.

Install the app

To install it on your phone (connect to the computer with a usb cable, or use an emulator), run ant install

Note: To configure your phone for development, please follow the instructions here: http://developer.android.com/tools/device.html

Be sure you have an email account linked to the Play Store on your device, or you will not be able to log in to Paco.

Build the Server

To build the AppEngine Java server, (also most likely not what you want to ship), go to the Paco-Server directory in the source, and run ant -f antbuild.xml This will build a server that you can run locally.

Run a local dev server

To run the server locally, run ant -f antbuild.xml runserver

Deploy the server

To deploy the server to appengine, you will of course need to edit the war/WEB-INF/appengine-web.xml file to point it at your AppEngine application id. Then run ant -f antbuild.xml update

Using the Android Emulator

You can just sideload the app on your phone, or, if you would like to test against an emulated phone, you can use the Android tools to create an emulator image for the version of Android that you want to test against. Be sure to create the googleapis version of an image because Paco uses the google apis for account management to handle login to the server.

Connecting an Emulated Android App to an AppEngine Server

  • Start the Paco app on the phone
  • Click the Menu button
  • Choose 'Server Address'
  • Enter the ip address or hostname (if it is publicly resolvable) of your server
  • If this is a local test server enter 10.0.2.2: as the server address.
  • is 8888 if building from Eclipse, and 8080 if building from the command line.
  • Press save
  • Test this by pressing 'Find Experiments' and clicking the 'Refresh Experiments' button. You should get an empty list, but if you create an experiment on the server, then Refresh again, it should show up. (Check logcat for errors)

Getting Help on Commands

Android App In the Paco source directory, run,


    ant -p

AppEngine Server App In the Paco-Server source directory, run,


    ant -f antbuild.xml -p
Clone this wiki locally