Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/3.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaswenz committed Jan 13, 2016
2 parents 651219f + 4697bd1 commit 430a8c6
Show file tree
Hide file tree
Showing 80 changed files with 8,555 additions and 8,072 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
@@ -1,3 +0,0 @@
[submodule "app-sample"]
path = app-sample
url = git@github.com:bitstadium/HockeySDK-AndroidDemo.git
49 changes: 40 additions & 9 deletions README.md
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/bitstadium/HockeySDK-Android.svg?branch=develop)](https://travis-ci.org/bitstadium/HockeySDK-Android)

## Version 3.7.0-beta.2
## Version 3.7.0

## Introduction

Expand Down Expand Up @@ -63,7 +63,7 @@ Please see the "[How to create a new app](http://support.hockeyapp.net/kb/about-
Add the SDK to your app module's dependencies in Android Studio by adding the following line to your `dependencies { ... }` configuration:

```groovy
compile 'net.hockeyapp.android:HockeySDK:3.7.0-beta.2'
compile 'net.hockeyapp.android:HockeySDK:3.7.0'
```
also make sure your repository configuration contains

Expand Down Expand Up @@ -138,7 +138,7 @@ When the activity is resumed, the crash manager is triggered and checks if a new
This will add the in-app update mechanism to your app. For more configuration options of the update manager module see [Advanced Setup](#advancedsetup).

1. Open the activity where you want to inform the user about eventual updates. We'll assume you want to do this on startup of your main activity.
2. Add the following lines and make sure to always make sure to balance `register(...)` calls to SDK managers with `unregister()` calls in the corresponding lifecycle callbacks:
2. Add the following lines and make sure to always balance `register(...)` calls to SDK managers with `unregister()` calls in the corresponding lifecycle callbacks:

```java
import net.hockeyapp.android.UpdateManager;
Expand Down Expand Up @@ -262,14 +262,40 @@ You can access the full changelog in our [releases-section](https://github.com/b

<a id="manualdependency"></a>
### 4.1 Manual Library Dependency
If you don't want to use Android Studio, Gradle, or Maven you can also download and add the library manually.
If you don't want to use Gradle or Maven dependency management you can also download and add the library manually. The easiest way to do this is using Android Studio.

1. Download the latest release from [here](http://hockeyapp.net/releases/#android).
2. Unzip the file.
3. Copy the file libs/HockeySDK-$version.aar to the libs folder of your Android project. (`$version` is the version of the downloaded SDK)
4. Configure your development tools to use the aar-file in the libs folder.
2. Unzip the release distribution.
3. Copy the file libs/HockeySDK-$version.aar to the `libs` folder of your Android project. (`$version` is the version of the downloaded SDK, if the version is < 3.7.0 it will be a .jar file instead)
4. Configure your development tools to use the .aar/.jar file.
5. In Android Studio, create a new module via `File > New > New Module`
6. Select **Import .JAR/.AAR Package** and click **Next**.
7. In the next menu select the .aar/.jar file you just copied to the libs folder. You can rename the module to whatever you want, but we in general recommend leaving it as is. If you don't rename the module, it will match the name of the .aar/.jar file, in this case **HockeySDK-3.7.0**. This way you'll quickly know which version of the SDK you are using in the future.
8. Make sure Android Studio added the necessary code to integrate the HockeySDK:

Then proceed with [the SDK integration](#setup-modifycode).
Head over to your app's `build.gradle` to verify the dependency was added correctly. It should look like this:

```groovy
dependencies {
//your other dependencies
//...
compile project(':HockeySDK-3.7.0')
}
```
Next, make sure your `settings.gradle` contains the new module:

```groovy
include ':app', ':HockeySDK-3.7.0'
```

Finally, check the `build.gradle` of the newly added module:
```groovy
configurations.maybeCreate("default")
artifacts.add("default", file('HockeySDK-3.7.0.aar'))
```

Once you have verified that everything necessary has been added, proceed with [SDK integration](#integrate-sdk).

<a id="crashreporting-advanced"></a>
### 4.2 Crash Reporting
Expand Down Expand Up @@ -342,7 +368,7 @@ You can configure a notification to show to the user. When they select the notif
<a id="documentation"></a>
## 5. Documentation

Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/android/3.7.0-beta.2/index.html).
Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/android/3.7.0/index.html).

<a id="troubleshooting"></a>
## 6.Troubleshooting
Expand All @@ -360,6 +386,11 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/andr

We're looking forward to your contributions via pull requests.

**Coding style**

* Please follow our [coding styleguide](https://github.com/bitstadium/android-guidelines)
* Every check in should build and lint without errors

**Development environment**

* Mac/Linux/Windows machine running the latest version of [Android Studio and the Android SDK](https://developer.android.com/sdk/index.html)
Expand Down
1 change: 0 additions & 1 deletion app-sample
Submodule app-sample deleted from 2d45f2
15 changes: 11 additions & 4 deletions build.gradle
Expand Up @@ -5,11 +5,18 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.novoda:bintray-release:0.3.4'
}
}

allprojects {
repositories {
jcenter()
}
}



//The bintray-release plugin doesn't write the following attributes to the artifact's pom.xml:
//Project name, project description,Project URL, License information,SCM URL and Developer information
Expand All @@ -20,12 +27,12 @@ buildscript {
//The Hook
//...will generate a new pom.xml after the generatePomFileForMavenPublication-task and BEFORE the
// bintrayUpload-task. We can than sync from bintray to maven central using the bintray web-UI.
//as described in https://github.com/novoda/bintray-release/issues/19
//This is part of the readme at https://github.com/novoda/bintray-release

ext {
ARTIFACT_ID = 'HockeySDK'
VERSION_NAME = '3.7.0-beta.2'
VERSION_CODE = 3
VERSION_NAME = '3.7.0'
VERSION_CODE = 5
SITE_URL = 'https://github.com/bitstadium/hockeysdk-android'
GIT_URL = 'https://github.com/bitstadium/HockeySDK-Android.git'
BINTRAY_USER = HOCKEYAPP_BINTRAY_USER
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Expand Up @@ -16,5 +16,9 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

# Make sure that we build using the gradle daemon when building from command line
org.gradle.daemon=true

HOCKEYAPP_BINTRAY_USER=
HOCKEYAPP_BINTRAY_KEY=
25 changes: 21 additions & 4 deletions hockeysdk/build.gradle
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library)

def hockeySdkVersion = "3.7.0-beta.2"
def supportLibVersion = "23.1.1"

android {
compileSdkVersion 23
Expand All @@ -10,8 +10,9 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 3
versionName hockeySdkVersion
versionCode 4
versionName VERSION_NAME
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -26,7 +27,7 @@ publish {
userOrg = 'hockeyapp'
groupId = 'net.hockeyapp.android'
artifactId = 'HockeySDK'
publishVersion = hockeySdkVersion
publishVersion = VERSION_NAME
desc = 'HockeySDK-Android implements support for using HockeyApp in your Android application. The following features are currently supported:\n' +
'\n' +
'Collect crash reports: If your app crashes, a crash log is written to the device\'s storage. If the user starts the app again, he is asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to Google Play or other app stores! I\n' +
Expand All @@ -43,4 +44,20 @@ publish {
dryRun = false
}

dependencies {
//Mocking
androidTestCompile 'org.mockito:mockito-core:2.0.31-beta'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestCompile 'org.hamcrest:hamcrest-core:1.3'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'

//Integration testing
androidTestCompile "com.android.support:support-annotations:$supportLibVersion"
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'

testCompile 'junit:junit:4.12'
}


This file was deleted.

@@ -0,0 +1,73 @@
package net.hockeyapp.android;

import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.test.ActivityInstrumentationTestCase2;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.io.File;
import java.io.FilenameFilter;

@RunWith(AndroidJUnit4.class)
public class ExceptionHandlerTest extends ActivityInstrumentationTestCase2<UpdateActivity> {

private File filesDirectory;

public ExceptionHandlerTest() {
super(UpdateActivity.class);
}

@Before
public void setUp() throws Exception {
super.setUp();

injectInstrumentation(InstrumentationRegistry.getInstrumentation());

if (Constants.FILES_PATH == null) {
Constants.loadFromContext(getActivity());
}

filesDirectory = new File(Constants.FILES_PATH);
File[] stacktraceFiles = filesDirectory.listFiles(new StacktraceFilenameFilter());
for (File f : stacktraceFiles) {
f.delete();
}
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void saveExceptionTest() {

Throwable tr = new RuntimeException("Just a test exception");

ExceptionHandler.saveException(tr, null, null);

File[] files = filesDirectory.listFiles(new StacktraceFilenameFilter());
assertEquals(1, files.length);
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void saveExceptionCustomListenerTest() {

Throwable tr = new RuntimeException("Just a test exception");

ExceptionHandler.saveException(tr, null, new CrashManagerListener() {
});

File[] files = filesDirectory.listFiles(new StacktraceFilenameFilter());
assertEquals(1, files.length);
}

static class StacktraceFilenameFilter implements FilenameFilter {

@Override
public boolean accept(File dir, String filename) {
return filename.endsWith(".stacktrace");
}
}

}

0 comments on commit 430a8c6

Please sign in to comment.