• Stars
    star
    302
  • Rank 138,030 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android source project for Connect SDK

Connect SDK Android

Build Status Code Coverage Maven Central Apache License, 2.0 Twitter

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.

Dependencies

This project has the following dependencies, some of which require manual setup. If you would like to use a version of the SDK which has no manual setup, consider using the lite version of the SDK.

This project has the following dependencies.

Including Connect SDK in your app with Android Studio

Edit your project's build.gradle to add this in the "dependencies" section

dependencies {
    //...
    compile 'com.connectsdk:connect-sdk-android:1.6.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 update --init
    
  2. On the root of your project directory create/modify the settings.gradle file. It should contain something like the following:

    include ':app', ':Connect-SDK-Android'
  3. Edit your project's build.gradle to add this in the "dependencies" section:

    dependencies {
        //...
        compile project(':Connect-SDK-Android')
    }
  4. Setup FireTV submodule

  5. Sync project with gradle files

  6. Add permissions to your manifest

Permissions to include in manifest

  • Required for SSDP & Chromecast/Zeroconf discovery
  • android.permission.INTERNET
  • android.permission.CHANGE_WIFI_MULTICAST_STATE
  • Required for interacting with devices
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.ACCESS_WIFI_STATE
  • Required for storing device pairing information
  • android.permission.WRITE_EXTERNAL_STORAGE
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Metadata for application tag

This metadata tag is necessary to enable Chromecast support.

<application ... >
    ...

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

</application>

Proguard configuration

Add the following line to your proguard configuration file (otherwise DiscoveryManager won't be able to set any DiscoveryProvider).

-keep class com.connectsdk.**       { * ; }

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.

Limitations/Caveats

Subtitles

  • DLNA service support SRT format only. Since there is no official specification for them, subtitles may not work on all DLNA-compatible devices. This feature has been tested and works on LG WebOS and Netcast TVs.
  • FireTV service supports WebVTT format only. Subtitles on Fire TV are hidden by default. To display them, the user should manually pick one in the media player (click the "Options" button on the remote). The Fling SDK doesn't provide any way to make them appear remotely.
  • Google Cast service supports WebVTT format only. Servers providing subtitles and media files should support CORS headers, otherwise they are not displayed. The simplest change is to send this HTTP response header for your subtitles: Access-Control-Allow-Origin: *. More information is here: https://developers.google.com/cast/docs/android_sender#cors-requirements.
  • Netcast service support SRT format only. It uses DLNA and has the same restrictions as DLNA service.
  • WebOS service supports WebVTT format only. The server providing subtitles should support CORS headers, similarly to Cast service's requirements.

Contact

Credits

Connect SDK for Android makes use of the following projects, some of which are open-source.

These projects are used in tests:

License

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. 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.

More Repositories

1

Connect-SDK-iOS

iOS source project for Connect SDK
Ruby
172
star
2

Connect-SDK-Android-Core

Core source code for the Android Connect SDK project
Java
109
star
3

Connect-SDK-Cordova-Plugin

Cordova/PhoneGap plugin for Connect SDK
JavaScript
67
star
4

Connect-SDK-iOS-Core

Core source code for the iOS Connect SDK project, contains no project files
Objective-C
46
star
5

Connect-SDK-JavaScript-Bridge

JavaScript Bridge to support Connect SDK integration with web apps
JavaScript
27
star
6

Connect-SDK-Android-API-Sampler

Java
19
star
7

Connect-SDK-Android-Lite

Light version of the Connect SDK project with no external dependencies
Java
19
star
8

Connect-SDK-Windows

C#
12
star
9

Connect-SDK-Android-FireTV

Amazon Fire TV Android module for Connect SDK
Java
11
star
10

Connect-SDK-iOS-Lite

Light version of the Connect SDK project with no external dependencies
Ruby
9
star
11

connectsdk.com

Documentation of Connect SDK
8
star
12

Connect-SDK-iOS-FireTV

Amazon FireTV iOS module for Connect SDK
Objective-C
6
star
13

SmartHomeSamplerAndroid

Sample Smart home application using Connect SDK
Java
5
star
14

Connect-SDK-Cordova-API-Sampler

Cordova API Sampler
JavaScript
5
star
15

Connect-SDK-iOS-API-Sampler

iOS API Sampler
Objective-C
5
star
16

Connect-SDK-Android-Google-Cast

Google Cast SDK Android module for Connect SDK
Java
4
star
17

Connect-SDK-Windows-Sampler

C#
4
star
18

Web-App-Sampler-Android

Simple sample app to send an arbitrary string for display in a web app. See Connect SDK JavaScript Bridge repository for web app source code.
Java
4
star
19

Connect-SDK-iOS-Google-Cast

Google Cast SDK iOS module for Connect SDK
Objective-C
4
star
20

AirPlay-Direct-POC

A Connect SDK POC with custom, direct integration with Apple AirPlay, AirTunes
Objective-C
4
star
21

Web-App-Sampler-Cordova

Simple sample app to send an arbitrary string for display in a web app. See Connect SDK JavaScript Bridge repository for web app source code.
JavaScript
4
star
22

Connect-SDK-Android-Samsung-MultiScreen

Samsung MultiScreen SDK Android module for Connect SDK
Java
2
star
23

Simple-Photo-Share-Android

Java
2
star
24

Simple-Photo-Share-Cordova

2
star
25

LGCast-iOS-API-Sampler

Objective-C
2
star
26

Simple-Photo-Share-iOS

Objective-C
2
star
27

SmartHomeSampleriOS

Sample Smart home application using Connect SDK
Objective-C
2
star
28

connectsdk-react-native

Java
1
star
29

Connect-SDK-iOS-Samsung-MultiScreen

Samsung MultiScreen SDK iOS module for Connect SDK
Objective-C
1
star
30

Web-App-Sampler-iOS

Simple sample app to send an arbitrary string for display in a web app. See Connect SDK JavaScript Bridge repository for web app source code.
Objective-C
1
star
31

LGCast-Android-API-Sampler

Java
1
star