#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.
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.
- Connect-SDK-Android-Core submodule
- Connect-SDK-Android-Google-Cast submodule
- Requires GoogleCast.framework
- Java-WebSocket library
##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.4.+'
}
##Including Connect SDK in your app with Android Studio from sources
-
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
-
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'
-
Edit your project's build.gradle to add this in the "dependencies" section:
dependencies { //... compile project(':Connect-SDK-Android') }
-
Sync project with gradle files
-
Add permissions to your manifest
##Including Connect SDK in your app with Eclipse
- Clone repository (or download & unzip)
- Set up the submodules by running the following commands in Terminal
git submodule init
git submodule update
- Open Eclipse
- Click File > Import
- Select
Existing Android Code Into Workspace
and clickNext
- Browse to the
Connect-SDK-Android
project folder and clickOpen
- Check all projects and click
Finish
- Follow the setup instructions for each of the service submodules
- Right-click the
Connect-SDK-Android-Core
project and selectProperties
, in theLibrary
pane of theAndroid
tab add- Connect-SDK-Android
- Right-click the
Connect-SDK-Android-Google-Cast
project and selectProperties
, in theLibrary
pane of theAndroid
tab add following libraries
- Connect-SDK-Android-Core
- android-support-v7-appcompat
- android-support-v7-mediarouter
- google-play-services_lib
- IN YOUR PROJECT select
Properties
, in theLibrary
pane of theAndroid
tab add following libraries
- Connect-SDK-Android-Core
- Connect-SDK-Android-Google-Cast
- Set up your manifest file as per the instructions below
###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.** { * ; }
##Migrating from 1.3 to 1.4 release
- Open terminal and go to your local Connect-SDK-Android repo
- Pull the latest updates by running command
git pull
in Terminal - Set up the submodules by running the following commands in Terminal
git submodule init
git submodule update
- Open Eclipse
- Click
File > Import
- Select
Existing Android Code Into Workspace
and clickNext
- Browse to the
Connect-SDK-Android/core
folder and clickOpen
to import core submodule - Click
Finish
- Do the steps 5-8 for Connect-SDK-Android-Google-Cast which is located in
Connect-SDK-Android/modules/google_cast
folder - Right click on
Connect-SDK-Android
project and selectProperties
, in theLibrary
pane of theAndroid
tab
- remove all libraries references
- Right-click the
Connect-SDK-Android-Core
project and selectProperties
, in theLibrary
pane of theAndroid
tab add
- Connect-SDK-Android
- Right-click the
Connect-SDK-Android-Google-Cast
project and selectProperties
, in theLibrary
pane of theAndroid
tab add following libraries
- Connect-SDK-Android-Core
- android-support-v7-appcompat
- android-support-v7-mediarouter
- google-play-services_lib
- 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.
##Contact
- Twitter @ConnectSDK
- Ask a question with the "tv" tag on Stack Overflow
- General Inquiries [email protected]
- Developer Support [email protected]
- Partnerships [email protected]
##Credits Connect SDK for Android makes use of the following open-source projects.
- Java-WebSocket (MIT)
- JmDNS (Apache License, Version 2.0)
- Android-DLNA (Apache License, Version 2.0)
##License Copyright (c) 2013-2014 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
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.