Permalink
Browse files

Added demo project and README for Android.

  • Loading branch information...
1 parent b800645 commit 87d3334dd9b38e6579647fdfed4d34aa7c44a97b @ashtom ashtom committed Jan 27, 2011
Showing with 289 additions and 1 deletion.
  1. +2 −1 AUTHORS
  2. +88 −0 client/Android/README
  3. +8 −0 demo/Android/.classpath
  4. +40 −0 demo/Android/.project
  5. +31 −0 demo/Android/AndroidManifest.xml
  6. BIN demo/Android/bin/HockeyDemo.apk
  7. BIN demo/Android/bin/classes.dex
  8. BIN demo/Android/bin/net/hockeyapp/android/CheckUpdateTask$1.class
  9. BIN demo/Android/bin/net/hockeyapp/android/CheckUpdateTask$2.class
  10. BIN demo/Android/bin/net/hockeyapp/android/CheckUpdateTask.class
  11. BIN demo/Android/bin/net/hockeyapp/android/R$attr.class
  12. BIN demo/Android/bin/net/hockeyapp/android/R$drawable.class
  13. BIN demo/Android/bin/net/hockeyapp/android/R$layout.class
  14. BIN demo/Android/bin/net/hockeyapp/android/R$string.class
  15. BIN demo/Android/bin/net/hockeyapp/android/R.class
  16. BIN demo/Android/bin/net/hockeyapp/android/UpdateActivity$DownloadFileTask.class
  17. BIN demo/Android/bin/net/hockeyapp/android/UpdateActivity.class
  18. BIN demo/Android/bin/net/hockeyapp/android/UpdateInfoAdapter.class
  19. BIN demo/Android/bin/net/hockeyapp/android/demo/MainActivity.class
  20. BIN demo/Android/bin/net/hockeyapp/android/demo/R$attr.class
  21. BIN demo/Android/bin/net/hockeyapp/android/demo/R$drawable.class
  22. BIN demo/Android/bin/net/hockeyapp/android/demo/R$layout.class
  23. BIN demo/Android/bin/net/hockeyapp/android/demo/R$string.class
  24. BIN demo/Android/bin/net/hockeyapp/android/demo/R.class
  25. BIN demo/Android/bin/resources.ap_
  26. +12 −0 demo/Android/default.properties
  27. +24 −0 demo/Android/gen/net/hockeyapp/android/R.java
  28. +24 −0 demo/Android/gen/net/hockeyapp/android/demo/R.java
  29. +5 −0 demo/Android/info.json
  30. BIN demo/Android/res/drawable-hdpi/icon.png
  31. BIN demo/Android/res/drawable-ldpi/icon.png
  32. BIN demo/Android/res/drawable-mdpi/icon.png
  33. +16 −0 demo/Android/res/layout/main.xml
  34. +5 −0 demo/Android/res/values/strings.xml
  35. +34 −0 demo/Android/src/net/hockeyapp/android/demo/MainActivity.java
View
@@ -6,4 +6,5 @@ Fabian Kreiser <fabian@fabian-kreiser.com>
Tobias Höhmann
FutureTap
Kent Sutherland
-Peter Steinberger <me@petersteinberger.com>
+Peter Steinberger <me@petersteinberger.com>
+Thomas Dohmke <thomas@dohmke.de>
View
@@ -0,0 +1,88 @@
+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
+
+Steps to integrate Hockey into your Android app:
+************************************************
+
+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.
+
+8. Open your "AndroidManifest.xml" and add the following line:
+
+ <activity android:name="net.hockeyapp.android.UpdateActivity" />
+
+9. 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" />
+
+10. 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) {
+ // Your creation code...
+
+ checkUpdateTask();
+ }
+
+ private void checkForUpdates() {
+ checkUpdateTask = (CheckUpdateTask)getLastNonConfigurationInstance();
+ if (checkUpdateTask != null) {
+ checkUpdateTask.attach(this);
+ }
+ else {
+ checkUpdateTask = new CheckUpdateTask(this, "http://worldviewmobileapp.com/apps/demo/");
+ checkUpdateTask.execute();
+ }
+ }
+
+ @Override
+ public Object onRetainNonConfigurationInstance() {
+ checkUpdateTask.detach();
+ return checkUpdateTask;
+ }
+
+ // Probably more methods
+}
+
+11. Replace YOUR_URL by your Hockey Server URL.
+
+12. Build your project and create a signed apk.
+
+13. 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).
+
+14. Upload both files to the server.
+
+15. Done.
+
+Bugs, Problems, Questions?
+**************************
+
+Send us a tweet to @ashtom or @therealkerni.
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="src" path="Hockey_src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>HockeyDemo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>Hockey_src</name>
+ <type>2</type>
+ <locationURI>_android_Hockey_8127bcc3/src</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ package="net.hockeyapp.android.demo"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <application
+ android:icon="@drawable/icon"
+ android:label="@string/app_name">
+
+ <activity
+ android:name=".MainActivity"
+ android:label="@string/app_name">
+
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="net.hockeyapp.android.UpdateActivity" />
+
+ </application>
+
+ <uses-sdk android:minSdkVersion="8" />
+
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
+</manifest>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=Google Inc.:Google APIs:8
+android.library.reference.1=../../client/Android/
@@ -0,0 +1,24 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package net.hockeyapp.android;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int icon=0x7f020000;
+ }
+ public static final class layout {
+ public static final int main=0x7f030000;
+ public static final int update_view=0x7f030001;
+ }
+ public static final class string {
+ public static final int app_name=0x7f040001;
+ public static final int hello=0x7f040000;
+ }
+}
@@ -0,0 +1,24 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package net.hockeyapp.android.demo;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int icon=0x7f020000;
+ }
+ public static final class layout {
+ public static final int main=0x7f030000;
+ public static final int update_view=0x7f030001;
+ }
+ public static final class string {
+ public static final int app_name=0x7f040001;
+ public static final int hello=0x7f040000;
+ }
+}
View
@@ -0,0 +1,5 @@
+{
+ "title": "HockeyDemo",
+ "versionCode": 2,
+ "versionName": "1.0"
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+ <TextView
+ android:layout_centerInParent="true"
+ android:layout_height="wrap_content"
+ android:layout_margin="10dip"
+ android:layout_width="fill_parent"
+ android:text="@string/hello"
+ />
+
+</RelativeLayout>
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="hello">Hello, this is the demo of Hockey Android. If your device is connected to the internet, the app should bring up an update alert every time you start it.</string>
+ <string name="app_name">HockeyDemo</string>
+</resources>
@@ -0,0 +1,34 @@
+package net.hockeyapp.android.demo;
+
+import net.hockeyapp.android.CheckUpdateTask;
+import android.app.Activity;
+import android.os.Bundle;
+
+public class MainActivity extends Activity {
+ private CheckUpdateTask checkUpdateTask;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ checkForUpdates();
+ }
+
+ private void checkForUpdates() {
+ checkUpdateTask = (CheckUpdateTask)getLastNonConfigurationInstance();
+ if (checkUpdateTask != null) {
+ checkUpdateTask.attach(this);
+ }
+ else {
+ checkUpdateTask = new CheckUpdateTask(this, "http://worldviewmobileapp.com/apps/demo/");
+ checkUpdateTask.execute();
+ }
+ }
+
+ @Override
+ public Object onRetainNonConfigurationInstance() {
+ checkUpdateTask.detach();
+ return checkUpdateTask;
+ }
+}

0 comments on commit 87d3334

Please sign in to comment.