Skip to content

Commit

Permalink
Merge pull request #22 from rheinfabrik/feature/sample-app
Browse files Browse the repository at this point in the history
Feature/sample app
  • Loading branch information
Giulio Petek committed Jun 16, 2015
2 parents cef39fc + 9d877ec commit 86145c7
Show file tree
Hide file tree
Showing 60 changed files with 1,164 additions and 63 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ proguard/

#Log Files
*.log

sample/src/main/java/de/rheinfabrik/heimdalldroid/network/TraktTvAPIConfiguration.java
Empty file modified LICENSE.txt
100644 → 100755
Empty file.
9 changes: 9 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Heimdall is an [OAuth 2.0](https://tools.ietf.org/html/rfc6749) client specifica

This library makes use of [RxAndroid](https://github.com/ReactiveX/RxAndroid). Therefore you should be familar with [Observables](https://github.com/ReactiveX/RxJava/wiki/Observable).

If you are an iOS Developer then please take a look at the [Swift version of Heimdall](https://github.com/rheinfabrik/Heimdall.swift).

## Installation

Heimdall is ready to be used via [jitpack.io](https://jitpack.io/#rheinfabrik/Heimdall.droid).
Expand Down Expand Up @@ -132,6 +134,13 @@ grant.grantNewAccessToken()

```

## Sample Application

Please also check out our sample application which performs an authorization against [trakt.tv](https://trakt.tv/) and displays a simple list of the user's watchlists.

**Note:** In order to build the sample by yourself you have to [create a new application on trakt.tv](https://trakt.tv/oauth/applications/new) and add the credentials wherever `TraktTvAPIConfiguration.java` is used.


## About

Heimdall was built by [Rheinfabrik](http://www.rheinfabrik.de) :factory:
Expand Down
67 changes: 6 additions & 61 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,74 +1,19 @@
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'groovyx.grooid.groovy-android'
apply plugin: 'com.github.dcendents.android-maven'
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'me.tatarka:gradle-retrolambda:2.5.0'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'
}
}

group = 'com.github.rheinfabrik'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'LICENSE'
exclude 'LICENSE.txt'
exclude 'META-INF/services/org.codehaus.groovy.transform.ASTTransformation'
}

defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 101
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

repositories {
mavenCentral()
jcenter()
}

dependencies {

// Rx
compile 'io.reactivex:rxandroid-framework:0.24.0'

// GSON
compile 'com.google.code.gson:gson:2.3.1'

// Spock
androidTestCompile 'org.codehaus.groovy:groovy:2.4.2:grooid'
androidTestCompile "com.andrewreitz:spock-android:1.2.0"
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
androidTestCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude group: 'org.codehaus.groovy'
exclude group: 'junit'
allprojects {
repositories {
jcenter()
}
androidTestCompile "com.google.dexmaker:dexmaker:1.2"
}
18 changes: 18 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# 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
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Mon Jun 15 17:18:44 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
Empty file modified gradlew
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
74 changes: 74 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'groovyx.grooid.groovy-android'
apply plugin: 'com.github.dcendents.android-maven'

buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'me.tatarka:gradle-retrolambda:2.5.0'
classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
}
}

group = 'com.github.rheinfabrik'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'LICENSE'
exclude 'LICENSE.txt'
exclude 'META-INF/services/org.codehaus.groovy.transform.ASTTransformation'
}

defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 101
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
}
}
}

repositories {
mavenCentral()
jcenter()
}

dependencies {

// Rx
compile 'io.reactivex:rxandroid-framework:0.24.0'

// GSON
compile 'com.google.code.gson:gson:2.3.1'

// Spock
androidTestCompile 'org.codehaus.groovy:groovy:2.4.2:grooid'
androidTestCompile "com.andrewreitz:spock-android:1.2.0"
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
androidTestCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude group: 'org.codehaus.groovy'
exclude group: 'junit'
}
androidTestCompile "com.google.dexmaker:dexmaker:1.2"
}
17 changes: 17 additions & 0 deletions library/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/gilo/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
File renamed without changes.
Binary file removed libs/dexmaker-1.1.jar
Binary file not shown.
Binary file removed libs/dexmaker-mockito-1.1.jar
Binary file not shown.
53 changes: 53 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'me.tatarka:gradle-retrolambda:2.5.0'
}
}

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "de.rheinfabrik.heimdall"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}

// https://github.com/evant/gradle-retrolambda#android-studio-setup
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

// Android
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.3'

// Heimdall
compile project(':library')

// Serialization
compile 'com.google.code.gson:gson:2.3'
compile 'org.parceler:parceler-api:0.2.16'

// Network
compile files('libs/Heimdall.jar')
compile 'com.squareup.retrofit:retrofit:1.9.0'

// Butterknife
compile 'com.jakewharton:butterknife:6.1.0'
}
17 changes: 17 additions & 0 deletions sample/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/gilo/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
31 changes: 31 additions & 0 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<manifest package="de.rheinfabrik.heimdalldroid"
xmlns:android="http://schemas.android.com/apk/res/android">

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

<!-- Application -->
<application android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppThemeNoActionBar">

<!-- Main Activity -->
<activity android:name="de.rheinfabrik.heimdalldroid.actvities.MainActivity"
android:screenOrientation="portrait">

<!--Intent filter -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

</activity>

<!-- Login Activity -->
<activity android:name="de.rheinfabrik.heimdalldroid.actvities.LoginActivity"
android:screenOrientation="portrait"/>

</application>

</manifest>
Loading

0 comments on commit 86145c7

Please sign in to comment.