Requirements:
*************

+ ADT Plugin 0.9.7 (or higher)
+ Android 2.2 (or higher); it might work with older SDKs, but we haven't tested it
+ HockeyKit 2 (or higher)


Setps to integrate Hockey into your Gradle/Android Studio project:
******************************************************************
1. Add the following to the settings.gradle file at the root of your project:

include ':hockeykit'
project(':hockeykit').projectDir = new File('/Users/joe/HockeyKit/client/Android/')

Make sure to replace the path with the path of your local HockeyKit copy.

2. Add the following dependency to the build.gradle file of your application:

dependencies {
    compile project(':hockeykit')
}


Steps to integrate Hockey into your Eclipse project:
****************************************************

1. Import the project in client/Android into Eclipse.

2. Open the properties for your project.

3. Select "Android" in the sidebar.

4. Click "Add.." in the section "Library".

5. Select "Hockey" and confirm with "OK".

6. Close the properties with "OK".

7. The folder "Hockey_src" should appear in your project; if not, restart Eclipse.


Steps to integrate Hockey into your Android app:
************************************************

1. Open your "AndroidManifest.xml" and add the following line:

  <activity android:name="net.hockeyapp.android.UpdateActivity" />
  
2. Make sure that your app has permissions for the internet and for writing onto the SD card:

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

3. Open your main activity and the following lines:

import net.hockeyapp.android.CheckUpdateTask;

public class MainActivity extends Activity {
  private CheckUpdateTask checkUpdateTask;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    // Some code to create view
    // ...
    
    // Set icon drawable
    UpdateActivity.iconDrawableId = R.drawable.icon;
    
    // Check for updates
    checkForUpdates();
  }

  private void checkForUpdates() {
    checkUpdateTask = (CheckUpdateTask)getLastNonConfigurationInstance();
    if (checkUpdateTask != null) {
      checkUpdateTask.attach(this);
    }
    else {
      checkUpdateTask = new CheckUpdateTask(this, "YOUR_URL");
      checkUpdateTask.execute();
    }
  }

  @Override
  public Object onRetainNonConfigurationInstance() {
    checkUpdateTask.detach();
    return checkUpdateTask;
  }
  
  // Probably more methods
}    

4. Replace YOUR_URL by your Hockey Server URL.

5. Build your project and create a signed apk.

6. Create a new file info.json with the following content:

{
  "title": "HockeyDemo",
  "versionCode": 23,
  "versionName":"1.0"
}

Replace the value for title with the title of your app and the values for versionCode and versionName with the latest values (maybe it's possible to automate this with Eclipse).

7. Upload both files to the server.

8. Done.

Bugs, Problems, Questions?
**************************

Send us a tweet to @ashtom or @therealkerni.
