From 038dd49a1e2af38ad234413b411398be12083faf Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Wed, 29 Apr 2015 14:02:14 -0700 Subject: [PATCH 01/10] Add a new task to gradle for uploading into maven repository --- build.gradle | 2 + gradle.properties | 27 +++++++++++ maven-push.gradle | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100755 gradle.properties create mode 100755 maven-push.gradle diff --git a/build.gradle b/build.gradle index 663759e5..01688bea 100644 --- a/build.gradle +++ b/build.gradle @@ -131,3 +131,5 @@ dependencies { androidTestCompile 'org.mockito:mockito-core:1.10.19' androidTestCompile 'org.powermock:powermock-mockito-release-full:1.6.2' } + +apply from: 'maven-push.gradle' diff --git a/gradle.properties b/gradle.properties new file mode 100755 index 00000000..ec64bc5c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,27 @@ +POM_NAME=Connect SDK Android + +POM_ARTIFACT_ID=connect-sdk-android + +POM_PACKAGING=aar +VERSION_NAME=1.4.4 +VERSION_CODE=10 +GROUP=com.connectsdk + +POM_DESCRIPTION=Connect SDK is an open source framework that connects your mobile apps with multiple TV platforms. Because most TV platforms support a variety of protocols, Connect SDK integrates and abstracts the discovery and connectivity between all supported protocols. + +POM_URL=https://github.com/ConnectSDK/Connect-SDK-Android +POM_SCM_URL=https://github.com/ConnectSDK/Connect-SDK-Android +POM_SCM_CONNECTION=scm:hg:https://github.com/ConnectSDK/Connect-SDK-Android +POM_SCM_DEV_CONNECTION=scm:hg:https://github.com/ConnectSDK/Connect-SDK-Android + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=change +POM_DEVELOPER_NAME=change + +SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots +RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2 + + diff --git a/maven-push.gradle b/maven-push.gradle new file mode 100755 index 00000000..7eb0e598 --- /dev/null +++ b/maven-push.gradle @@ -0,0 +1,112 @@ +/* + * Copyright 2013 Chris Banes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" +} + +def getRepositoryPassword() { + return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + //task androidJavadocs(type: Javadoc) { + //source = android.sourceSets.main.allJava + //} + + //task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + //classifier = 'javadoc' + //from androidJavadocs.destinationDir + //} + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.sourceFiles + } + + artifacts { + archives androidSourcesJar + } +} \ No newline at end of file From f3d0015166185fea2b63863032712377d6cf414f Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Thu, 14 May 2015 17:04:30 -0700 Subject: [PATCH 02/10] Update core submodule --- core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core b/core index 06155d3d..b65ae652 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 06155d3dddb28ea6daca8a5bece160ef59817d1a +Subproject commit b65ae652ee3709d0321efdbd7364347794284f81 From 92c728c41dc848c2a0a7485e9ab0677c2c343cdd Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Mon, 18 May 2015 12:43:50 -0700 Subject: [PATCH 03/10] Update build.gradle for Android gradle plugin 1.1.0 and higher --- build.gradle | 43 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index 01688bea..dd2873f7 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.0' - classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+' + classpath 'com.android.tools.build:gradle:1.1.0' + classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1' } } @@ -15,7 +15,7 @@ allprojects { } apply plugin: 'com.android.library' -apply plugin: 'robolectric' +apply plugin: 'org.robolectric' apply plugin: "jacoco" @@ -23,7 +23,7 @@ jacoco { toolVersion = "0.7.1.201405082137" } -task jacocoTestReport(type:JacocoReport, dependsOn: "testDebug") { +task jacocoTestReport(type:JacocoReport, dependsOn: "check") { group = "Reporting" description = "Generate Jacoco coverage reports" @@ -48,7 +48,7 @@ task jacocoTestReport(type:JacocoReport, dependsOn: "testDebug") { } -test.dependsOn jacocoTestReport +build.dependsOn jacocoTestReport android { compileSdkVersion 21 @@ -75,7 +75,7 @@ android { res.srcDirs = ['res'] assets.srcDirs = ['assets'] } - androidTest { + test { java.srcDirs = [ 'core/test/src', 'modules/google_cast/test/src' @@ -92,7 +92,7 @@ android { } } -robolectric { +android.testOptions.unitTests.all { include '**/*Test.class' } @@ -106,30 +106,11 @@ dependencies { compile 'com.google.android.gms:play-services-cast:7.3.0' - androidTestCompile 'org.apache.maven:maven-ant-tasks:2.1.3' - androidTestCompile('junit:junit:4.+') - androidTestCompile('org.robolectric:robolectric:2.4') { - exclude module: 'classworlds' - exclude module: 'maven-artifact' - exclude module: 'maven-artifact-manager' - exclude module: 'maven-error-diagnostics' - exclude module: 'maven-model' - exclude module: 'maven-plugin-registry' - exclude module: 'maven-profile' - exclude module: 'maven-project' - exclude module: 'maven-settings' - exclude module: 'nekohtml' - exclude module: 'plexus-container-default' - exclude module: 'plexus-interpolation' - exclude module: 'plexus-utils' - exclude module: 'wagon-file' - exclude module: 'wagon-http-lightweight' - exclude module: 'wagon-http-shared' - exclude module: 'wagon-provider-api' - exclude group: 'com.android.support', module: 'support-v4' - } - androidTestCompile 'org.mockito:mockito-core:1.10.19' - androidTestCompile 'org.powermock:powermock-mockito-release-full:1.6.2' + testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' + testCompile 'junit:junit:4.12' + testCompile 'org.robolectric:robolectric:2.4' + testCompile 'org.mockito:mockito-all:1.10.19' + testCompile 'org.powermock:powermock-api-mockito:1.6.2' } apply from: 'maven-push.gradle' From 58d89920be8fd4e280f94a78bbd927cf602b55e3 Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Mon, 18 May 2015 13:06:54 -0700 Subject: [PATCH 04/10] Fix build.gradle for jenkins --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index dd2873f7..60f5df8d 100644 --- a/build.gradle +++ b/build.gradle @@ -92,7 +92,7 @@ android { } } -android.testOptions.unitTests.all { +robolectric { include '**/*Test.class' } From 39d25225362b87f27a6ce32e152832cbfbc19920 Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Mon, 18 May 2015 18:01:24 -0700 Subject: [PATCH 05/10] Update robolectric-gradle-plugin to version 1.1.0 --- build.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 60f5df8d..dbc2a37b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.1.0' - classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1' + classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0' } } @@ -67,7 +67,7 @@ android { java.srcDirs = [ 'src', 'core/src', - 'modules/google_cast/src' + 'modules/google_cast/src', ] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] @@ -78,7 +78,7 @@ android { test { java.srcDirs = [ 'core/test/src', - 'modules/google_cast/test/src' + 'modules/google_cast/test/src', ] } } @@ -92,9 +92,9 @@ android { } } -robolectric { - include '**/*Test.class' -} +android.testOptions.unitTests.all { + include '**/*Test.class' + } dependencies { compile files('core/libs/java-websocket-patch.jar') From 9a888d480ca2d662a7e546368f5a128ee9bf4900 Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Tue, 2 Jun 2015 16:37:44 -0700 Subject: [PATCH 06/10] Update submodules --- core | 2 +- modules/google_cast | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core b/core index b65ae652..0e44319a 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b65ae652ee3709d0321efdbd7364347794284f81 +Subproject commit 0e44319a2408b68d72d23f08531b496da8e9558c diff --git a/modules/google_cast b/modules/google_cast index 76032277..43bf0d78 160000 --- a/modules/google_cast +++ b/modules/google_cast @@ -1 +1 @@ -Subproject commit 760322775e1ae273bb4d44d6338cd0fd13c3fd60 +Subproject commit 43bf0d7880f244fc8630770e75d14de4c7ad9136 From 4738790bafe3d30678bb354a4a21e91b115a435d Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Wed, 10 Jun 2015 16:47:39 -0700 Subject: [PATCH 07/10] Update core submodule --- core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core b/core index 0e44319a..a8966099 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 0e44319a2408b68d72d23f08531b496da8e9558c +Subproject commit a89660990f3331351d4cb57805f90c22d80c3a4e From 99c6afe200294ca6591c381159203bee59a6caac Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Thu, 18 Jun 2015 13:01:27 -0700 Subject: [PATCH 08/10] Update submodules --- core | 2 +- modules/google_cast | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core b/core index a8966099..2f22e98a 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit a89660990f3331351d4cb57805f90c22d80c3a4e +Subproject commit 2f22e98af0b092f9e1a5b2c8bdf2203d26b7a00d diff --git a/modules/google_cast b/modules/google_cast index 43bf0d78..883648b8 160000 --- a/modules/google_cast +++ b/modules/google_cast @@ -1 +1 @@ -Subproject commit 43bf0d7880f244fc8630770e75d14de4c7ad9136 +Subproject commit 883648b85810f2a40d577dde4b103fdaabd08784 From c2c9a5eab2718ca597288c83aefee0cbf4649b25 Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Tue, 23 Jun 2015 14:44:37 -0700 Subject: [PATCH 09/10] Update submodules --- core | 2 +- modules/google_cast | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core b/core index 2f22e98a..cab478e1 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 2f22e98af0b092f9e1a5b2c8bdf2203d26b7a00d +Subproject commit cab478e198f1d0709e0576726ba7d4f0117088ce diff --git a/modules/google_cast b/modules/google_cast index 883648b8..1a2180c3 160000 --- a/modules/google_cast +++ b/modules/google_cast @@ -1 +1 @@ -Subproject commit 883648b85810f2a40d577dde4b103fdaabd08784 +Subproject commit 1a2180c328038ff6f5e293dc451adc3339952d23 From 65da646c5eba2a056780f594392176644c63ddbc Mon Sep 17 00:00:00 2001 From: Oleksii Frolov Date: Thu, 9 Jul 2015 15:45:23 -0700 Subject: [PATCH 10/10] Add Fire TV submodule --- .gitmodules | 4 + AUTHORS.md | 18 ++++ AndroidManifest.xml | 6 +- CHANGELOG.md | 19 +++- CONTRIBUTING.md | 22 ++--- LICENSE | 2 +- README.md | 111 ++++++++++-------------- build.gradle | 20 +++-- core | 2 +- gradle.properties | 4 +- modules/firetv | 1 + modules/google_cast | 2 +- project.properties | 2 +- src/com/connectsdk/DefaultPlatform.java | 2 +- 14 files changed, 117 insertions(+), 98 deletions(-) create mode 160000 modules/firetv diff --git a/.gitmodules b/.gitmodules index 9d2c1173..1a6931b3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,7 @@ path = core url = https://github.com/ConnectSDK/Connect-SDK-Android-Core.git branch = dev +[submodule "modules/firetv"] + path = modules/firetv + url = https://github.com/ConnectSDK/Connect-SDK-Android-FireTV.git + branch = dev diff --git a/AUTHORS.md b/AUTHORS.md index 5f3c4314..4be9b3ba 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,3 +1,21 @@ +Ibrahim Adnan -- [GitHub](https://github.com/iadnan) | [Twitter](https://twitter.com/ibrahimadnan) + +iOS SDK, iOS sample apps, documentation + +--- + +Eugene Nikolskyi -- [GitHub](https://github.com/eunikolsky) + +iOS SDK, iOS sample apps, documentation + +--- + +Oleksii Frolov -- [GitHub](https://github.com/frolov-alexey) + +Android SDK, Android sample apps, documentation + +--- + Henry Levak -- [GitHub](https://github.com/henrylevak) | [Twitter](http://www.twitter.com/HenryLevak) Product Manager, Provider of Bubble Teas diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 816f7f09..bc346516 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,11 +1,11 @@ + android:versionCode="11" + android:versionName="1.5.0" > + android:targetSdkVersion="22" /> diff --git a/CHANGELOG.md b/CHANGELOG.md index 216a6d48..f1968501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Connect SDK Android Changelog +## 1.5.0 -- 09 Jul 2015 + +- Added Amazon Fling SDK support to play and control media on Fire TV devices +- Added playlist support for WebOS TVs +- Added media player loop capability for WebOS TVs +- Added feature to pin web apps on WebOS TVs +- Extended play state subscription to handle media playback errors on WebOS TVs +- Fixed launching input picker for new versions of WebOS TVs +- Fixed discovery for Chromecast +- Deprecated old media player methods +- Miscellaneous bug fixes +- [See commits between 1.4.4 and 1.5.0](https://github.com/ConnectSDK/Connect-SDK-Android/compare/1.4.4...1.5.0) + +[View files at version 1.5.0](https://github.com/ConnectSDK/Connect-SDK-Android/tree/1.5.0) + ## 1.4.4 -- 29 Apr 2015 - Added LG Music Flow speaker support (Google Cast for Audio and DLNA) @@ -7,7 +22,7 @@ - Added pairing type for DeviceService - Replaced DefaultHttpClient with HttpURLConnection - Added a new exception class - NotSupportedServiceCommandError -- Fixed DLNA subscribtion methods +- Fixed DLNA subscription methods - Fixed lint warnings - Miscellaneous bug fixes - [See commits between 1.4.3 and 1.4.4](https://github.com/ConnectSDK/Connect-SDK-Android/compare/1.4.3...1.4.4) @@ -19,7 +34,7 @@ - Reverted Roku 6.1 fix for playing video as Roku has fixed its media player - Added proper encoding of special characters for metadata in DLNAService - Added getPlayState implementation into AirPlayService -- Implemeted sending number key for NetcastTV +- Implemented sending number key for NetcastTV - Miscellaneous bug fixes - [See commits between 1.4.2 and 1.4.3](https://github.com/ConnectSDK/Connect-SDK-Android/compare/1.4.2...1.4.3) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5c68407..574bfdd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Please do not use GitHub issues for general questions about the SDK. Instead, use any of the following services to reach out to the development team. - [@ConnectSDK](https://twitter.com/ConnectSDK) -- [Stack Overflow TV Tag](http://www.stackoverflow.com/tags/tv) +- Stack Overflow: [Connect-SDK tag](https://stackoverflow.com/tags/connect-sdk) (or [TV tag](https://stackoverflow.com/tags/tv)) - [support@connectsdk.com](mailto:support@connectsdk.com) ##Versioning @@ -14,17 +14,7 @@ We use [semantic versioning](http://semver.org/) in our tagged releases. ##Branching Strategy -- master - + latest stable, QA'd, tagged release of the SDK - + assume that this is safe for production use -- sdk_MAJOR.MINOR - + stable branch working towards the next major/minor/patch release - + safe for checking out new features, but do not use in any production apps -- sdk_MAJOR.MINOR-dev - + unstable development branch working towards the next major/minor/patch release - + may not compile/run without errors - + for development only - + submit pull requests against this branch +We use the [successful git branching model](http://nvie.com/posts/a-successful-git-branching-model/), except without release branches, and the `develop` branch is named `dev`. ##Bug Reports & Feature Requests @@ -36,11 +26,15 @@ If you experience a crash, please attach your symbolicated crash log or stack tr ##Pull Requests -If you would like to submit code, please fork the repository on GitHub and develop on the latest sdk-X.Y-dev branch. We do not accept pull requests on the master branch, as we only merge QA'd & tagged code into the master branch. See the description of our branching strategy above. +If you would like to submit code, please fork the repository on GitHub and develop in a feature branch, created from the latest `dev` commit. We do not accept pull requests on the `master` branch, as we only merge QA'd and tagged code into the `master` branch. + +###Tests + +Please include unit tests for the new/changed functionality with your pull request. It will help to verify the code is working as designed and make sure there are no regressions in future releases. ###Use of third party libraries -Connect SDK does include some third party libraries, but we try to avoid using them. If you'd like to integrate a library with a pull request, make sure that library has an open source license (MIT, Apache 2.0, etc). +Connect SDK includes some third party libraries. If you'd like to integrate a library with a pull request, make sure that library has an open source license (MIT, Apache 2.0, etc). ###Licensing diff --git a/LICENSE b/LICENSE index 52b14da3..61f6e5e0 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2013-2014 LG Electronics. + Copyright (c) 2013-2015 LG Electronics. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index a243f4fb..321deb80 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ #Connect SDK Android Connect SDK is an open source framework that connects your mobile apps with multiple TV platforms. Because most TV platforms support a variety of protocols, Connect SDK integrates and abstracts the discovery and connectivity between all supported protocols. +This project can be built in Android Studio or directly with Gradle. Eclipse IDE is not supported since 1.5.0 version. For more information, visit our [website](http://www.connectsdk.com/). @@ -12,25 +13,32 @@ This project has the following dependencies, some of which require manual setup. This project has the following dependencies. * [Connect-SDK-Android-Core](https://github.com/ConnectSDK/Connect-SDK-Android-Core) submodule + - Requires [Java-WebSocket library](https://github.com/TooTallNate/Java-WebSocket) + - Requires [jmDNS library](https://github.com/openhab/jmdns) * [Connect-SDK-Android-Google-Cast](https://github.com/ConnectSDK/Connect-SDK-Android-Google-Cast) submodule - Requires [GoogleCast.framework](https://developers.google.com/cast/docs/downloads) -* [Java-WebSocket library](https://github.com/TooTallNate/Java-WebSocket) +* [Connect-SDK-Android-FireTV](https://github.com/ConnectSDK/Connect-SDK-Android-FireTV) submodule + - Requires [AmazonFling.framework](https://developer.amazon.com/public/apis/experience/fling/docs/amazon-fling-sdk-download) ##Including Connect SDK in your app with Android Studio Edit your project's build.gradle to add this in the "dependencies" section ```groovy dependencies { //... - compile 'com.connectsdk:connect-sdk-android:1.4.+' + compile 'com.connectsdk:connect-sdk-android:1.5.0' } ``` +This prebuilt library doesn't have Amazon Fling SDK support, because it’s not available on maven. You need to set the project up from sources +if you want to have Amazon Fling SDK support. + ##Including Connect SDK in your app with Android Studio from sources 1. Open your terminal and execute these commands - - cd your_project_folder - - git clone https://github.com/ConnectSDK/Connect-SDK-Android.git - - cd Connect-SDK-Android - - git submodule init - - git submodule update + ``` + cd your_project_folder + git clone https://github.com/ConnectSDK/Connect-SDK-Android.git + cd Connect-SDK-Android + git submodule update --init + ``` 2. On the root of your project directory create/modify the settings.gradle file. It should contain something like the following: ```groovy @@ -45,33 +53,9 @@ dependencies { } ``` -4. Sync project with gradle files -5. Add permissions to your manifest - -##Including Connect SDK in your app with Eclipse - -1. Clone repository (or download & unzip) -2. Set up the submodules by running the following commands in Terminal - - `git submodule init` - - `git submodule update` -3. Open Eclipse -4. Click File > Import -5. Select `Existing Android Code Into Workspace` and click `Next` -6. Browse to the `Connect-SDK-Android` project folder and click `Open` -7. Check all projects and click `Finish` -8. Follow the setup instructions for each of the service submodules - - [Connect-SDK-Android-Google-Cast](https://github.com/ConnectSDK/Connect-SDK-Android-Google-Cast) -9. Right-click the `Connect-SDK-Android-Core` project and select `Properties`, in the `Library` pane of the `Android` tab add - - Connect-SDK-Android -10. Right-click the `Connect-SDK-Android-Google-Cast` project and select `Properties`, in the `Library` pane of the `Android` tab add following libraries - - Connect-SDK-Android-Core - - android-support-v7-appcompat - - android-support-v7-mediarouter - - google-play-services_lib -11. **IN YOUR PROJECT** select `Properties`, in the `Library` pane of the `Android` tab add following libraries - - Connect-SDK-Android-Core - - Connect-SDK-Android-Google-Cast -12. Set up your manifest file as per the instructions below +4. Setup [FireTV submodule](https://github.com/ConnectSDK/Connect-SDK-Android-FireTV) +5. Sync project with gradle files +6. Add permissions to your manifest ###Permissions to include in manifest * Required for SSDP & Chromecast/Zeroconf discovery @@ -97,11 +81,11 @@ This metadata tag is necessary to enable Chromecast support. ```xml ... - + - + ``` @@ -112,49 +96,44 @@ Add the following line to your proguard configuration file (otherwise `Discovery -keep class com.connectsdk.** { * ; } ``` -##Migrating from 1.3 to 1.4 release - -1. Open terminal and go to your local Connect-SDK-Android repo -2. Pull the latest updates by running command `git pull` in Terminal -3. Set up the submodules by running the following commands in Terminal - - `git submodule init` - - `git submodule update` -4. Open Eclipse -5. Click `File > Import` -6. Select `Existing Android Code Into Workspace` and click `Next` -7. Browse to the `Connect-SDK-Android/core` folder and click `Open` to import core submodule -8. Click `Finish` -9. Do the steps 5-8 for Connect-SDK-Android-Google-Cast which is located in `Connect-SDK-Android/modules/google_cast` folder -10. Right click on `Connect-SDK-Android` project and select `Properties`, in the `Library` pane of the `Android` tab - - remove all libraries references -11. Right-click the `Connect-SDK-Android-Core` project and select `Properties`, in the `Library` pane of the `Android` tab add - - Connect-SDK-Android -12. Right-click the `Connect-SDK-Android-Google-Cast` project and select `Properties`, in the `Library` pane of the `Android` tab add following libraries - - Connect-SDK-Android-Core - - android-support-v7-appcompat - - android-support-v7-mediarouter - - google-play-services_lib -13. **IN YOUR PROJECT** select `Properties`, in the Library pane of the Android tab - - remove Connect-SDK-Android - - add Connect-SDK-Android-Core - - add Connect-SDK-Android-Google-Cast. +###Tests +Connect SDK has unit tests for some parts of the code, and we are continuing to increase the test coverage. +These tests are based on third party libraries such as Robolectric, Mockito and PowerMock. You can easily run these tests with Gradle: +``` +gradle test +``` +Also the project has a target for generating test coverage report with Jacoco. Use this command for generating it. +``` +gradle jacocoTestReport +``` +The test coverage report will be in this folder `Connect-SDK-Android/build/reports/jacoco/jacocoTestReport/html`. ##Contact * Twitter [@ConnectSDK](https://www.twitter.com/ConnectSDK) -* Ask a question with the "tv" tag on [Stack Overflow](http://stackoverflow.com/tags/tv) +* Ask a question on Stack Overflow with the [Connect-SDK tag](https://stackoverflow.com/tags/connect-sdk) (or [TV tag](https://stackoverflow.com/tags/tv)) * General Inquiries info@connectsdk.com * Developer Support support@connectsdk.com * Partnerships partners@connectsdk.com ##Credits -Connect SDK for Android makes use of the following open-source projects. +Connect SDK for Android makes use of the following projects, some of which are open-source. +* [Amazon Fling SDK](https://developer.amazon.com/fling) + - [Amazon Fling SDK Terms of Service](https://developer.amazon.com/public/support/pml.html) +* [Android-DLNA](https://code.google.com/p/android-dlna/) (Apache License, Version 2.0) +* [Google Cast SDK](https://developers.google.com/cast/) + - [Google Cast SDK Additional Developer Terms of Service](https://developers.google.com/cast/docs/terms) + - [Google APIs Terms of Service](https://developers.google.com/terms/) * [Java-WebSocket](https://github.com/TooTallNate/Java-WebSocket) (MIT) * [JmDNS](http://jmdns.sourceforge.net) (Apache License, Version 2.0) -* [Android-DLNA](https://code.google.com/p/android-dlna/) (Apache License, Version 2.0) + +These projects are used in tests: +* [Mockito](http://mockito.org/) (MIT) +* [Robolectric](http://robolectric.org) (MIT) +* [PowerMock](https://github.com/jayway/powermock) (Apache License, Version 2.0) ##License -Copyright (c) 2013-2014 LG Electronics. +Copyright (c) 2013-2015 LG Electronics. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/build.gradle b/build.gradle index dbc2a37b..f9c0027d 100644 --- a/build.gradle +++ b/build.gradle @@ -51,8 +51,8 @@ task jacocoTestReport(type:JacocoReport, dependsOn: "check") { build.dependsOn jacocoTestReport android { - compileSdkVersion 21 - buildToolsVersion '21.1.2' + compileSdkVersion 22 + buildToolsVersion '22.0.1' packagingOptions { exclude 'LICENSE.txt' @@ -68,6 +68,7 @@ android { 'src', 'core/src', 'modules/google_cast/src', + 'modules/firetv/src', ] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] @@ -79,6 +80,7 @@ android { java.srcDirs = [ 'core/test/src', 'modules/google_cast/test/src', + 'modules/firetv/test/src', ] } } @@ -90,6 +92,11 @@ android { minifyEnabled false } } + android { + lintOptions { + abortOnError false + } + } } android.testOptions.unitTests.all { @@ -100,11 +107,12 @@ dependencies { compile files('core/libs/java-websocket-patch.jar') compile files('core/libs/javax.jmdns_3.4.1-patch2.jar') - compile 'com.android.support:support-v4:22.1.1' - compile 'com.android.support:appcompat-v7:22.1.1' - compile 'com.android.support:mediarouter-v7:21.0.0' - compile 'com.google.android.gms:play-services-cast:7.3.0' + compile fileTree(dir: 'modules/firetv/libs', include: '*.jar') + compile 'com.android.support:support-v4:22.2.0' + compile 'com.android.support:appcompat-v7:22.2.0' + compile 'com.android.support:mediarouter-v7:21.0.0' + compile 'com.google.android.gms:play-services-cast:7.5.0' testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' testCompile 'junit:junit:4.12' diff --git a/core b/core index cab478e1..238d5e70 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit cab478e198f1d0709e0576726ba7d4f0117088ce +Subproject commit 238d5e701e162b4433945581f1a17dc101620163 diff --git a/gradle.properties b/gradle.properties index ec64bc5c..0b9d5c3e 100755 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ POM_NAME=Connect SDK Android POM_ARTIFACT_ID=connect-sdk-android POM_PACKAGING=aar -VERSION_NAME=1.4.4 -VERSION_CODE=10 +VERSION_NAME=1.5.0 +VERSION_CODE=11 GROUP=com.connectsdk POM_DESCRIPTION=Connect SDK is an open source framework that connects your mobile apps with multiple TV platforms. Because most TV platforms support a variety of protocols, Connect SDK integrates and abstracts the discovery and connectivity between all supported protocols. diff --git a/modules/firetv b/modules/firetv new file mode 160000 index 00000000..de203e34 --- /dev/null +++ b/modules/firetv @@ -0,0 +1 @@ +Subproject commit de203e34719e465588bf6c2c3bb1b6c97cc6c725 diff --git a/modules/google_cast b/modules/google_cast index 1a2180c3..64795d73 160000 --- a/modules/google_cast +++ b/modules/google_cast @@ -1 +1 @@ -Subproject commit 1a2180c328038ff6f5e293dc451adc3339952d23 +Subproject commit 64795d7363767dbf0220327f0469460388ea9ed7 diff --git a/project.properties b/project.properties index 484dab07..362a0a30 100644 --- a/project.properties +++ b/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-17 +target=android-22 android.library=true diff --git a/src/com/connectsdk/DefaultPlatform.java b/src/com/connectsdk/DefaultPlatform.java index b4ac80f2..c2250b72 100644 --- a/src/com/connectsdk/DefaultPlatform.java +++ b/src/com/connectsdk/DefaultPlatform.java @@ -2,7 +2,6 @@ import java.util.HashMap; - public class DefaultPlatform { @@ -19,6 +18,7 @@ public static HashMap getDeviceServiceMap() { devicesList.put("com.connectsdk.service.RokuService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider"); devicesList.put("com.connectsdk.service.CastService", "com.connectsdk.discovery.provider.CastDiscoveryProvider"); devicesList.put("com.connectsdk.service.AirPlayService", "com.connectsdk.discovery.provider.ZeroconfDiscoveryProvider"); + devicesList.put("com.connectsdk.service.FireTVService", "com.connectsdk.discovery.provider.FireTVDiscoveryProvider"); return devicesList; }