<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Android &#8211; Bitmovin</title>
	<atom:link href="https://bitmovin.com/tag/android/feed" rel="self" type="application/rss+xml" />
	<link>https://bitmovin.com</link>
	<description>Bitmovin provides adaptive streaming infrastructure for video publishers and integrators. Fastest cloud encoding and HTML5 Player. Play Video Anywhere.</description>
	<lastBuildDate>Wed, 11 Oct 2023 21:29:36 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://bitmovin.com/wp-content/uploads/2023/11/bitmovin_favicon.svg</url>
	<title>Android &#8211; Bitmovin</title>
	<link>https://bitmovin.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Creating a Live Streaming Setup with Android Devices and Bitmovin</title>
		<link>https://bitmovin.com/creating-live-stream-android-bitmovin%ef%bf%bc</link>
		
		<dc:creator><![CDATA[Marco Sussitz]]></dc:creator>
		<pubDate>Tue, 20 Dec 2022 11:27:55 +0000</pubDate>
				<category><![CDATA[Developers]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[live streaming]]></category>
		<guid isPermaLink="false">https://bitmovin.com/?p=247692</guid>

					<description><![CDATA[<p>It is that time of the quarter again at Bitmovin, Hackathon time. Our Hackathon includes two days of hacking solutions together before presenting the results to the wider business. Every programmer loves it and even more when your team is winning.&#160; During this Hackathon, we decided to step out of our backend-comfort zone and tinker...</p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/creating-live-stream-android-bitmovin%ef%bf%bc">Creating a Live Streaming Setup with Android Devices and Bitmovin</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>It is that time of the quarter again at Bitmovin, Hackathon time. Our Hackathon includes two days of hacking solutions together before presenting the results to the wider business. Every programmer loves it and even more when your team is winning.&nbsp; During this Hackathon, we decided to step out of our backend-comfort zone and tinker a bit with UI.</p>



<p>To be more specific, we tried to write an android app that would serve as an <a href="https://bitmovin.com/docs/encoding/tutorials/create-a-live-encoding-from-an-rtmp-stream" target="_blank" rel="noreferrer noopener">RTMP input source for a live stream</a>.</p>



<p>Setting up an RTMP input can be lengthy, especially when there is no computer with FFmpeg at hand. And syndetic input can be boring at times. So why not use a live feed from your mobile device for this? My go-to tool to create an RTMP stream is FFmpeg so let&#8217;s try to use this in android. We quickly realized that that was a futile endeavor, especially in two days. So we did what any software developer would do and looked for a library that had been written by somebody smarter than us. We tried a few libraries like the Larix Broadcaster SDK or some small GitHub repositories like the<a href="https://github.com/ant-media/LiveVideoBroadcaster" target="_blank" rel="noreferrer noopener nofollow"> LiveVideoBroadcaster</a> but weren’t able to get any of these to work in the limited time we had. Finally, a bit more searching revealed the grail we had been looking for; we unearthed <a href="https://github.com/pedroSG94/rtmp-rtsp-stream-client-java" target="_blank" rel="noreferrer noopener nofollow">this library</a> and managed to get something running.</p>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">How to use it</h2>



<p>The library creates a very handy OpenGLView that lets you show the camera in your activity. If you&#8217;d like to follow along with the steps we took, then to start, simply add it to your XML config like this:</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="xml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;com.pedro.rtplibrary.view.OpenGlView
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:id="@+id/surfaceView"
    app:keepAspectRatio="true"
    app:aspectRatioMode="fill"
    app:AAEnabled="false"
    app:numFilters="2"
    app:isFlipHorizontal="false"
    app:isFlipVertical="false"
    /></pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>The corresponding code will need an OpenGlView object as well as a RtmpCamera object. Let&#8217;s go ahead and create those:</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">private RtmpCamera2 rtmpCamera;
private OpenGlView openGlView;</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Those elements also need some values assigned, and we used the onCreate method for that:</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">this.openGlView = findViewById(R.id.surfaceView);
this.rtmpCamera = new RtmpCamera2(openGlView, this);
this.openGlView.getHolder().addCallback(this);</pre>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Starting an RTMP stream</h2>



<p>As all of the necessary configurations were complete, we just have to start the RTMP stream. To do that, the only thing we need to add to the code below (how to obtain that will be shown later).</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">@Override
public void startStreaming() {
   runOnUiThread(() -> {
       if (!rtmpCamera.isStreaming()) {
           if (rtmpCamera.isRecording()
                   || rtmpCamera.prepareAudio() &amp;&amp;                      rtmpCamera.prepareVideo()) {
               rtmpCamera.startStream("URL to you live stream");
               setStateStreamIsRunning();
           } else {
               this.toastError( "Error preparing stream, This device cant do it");
           }
       } else {
           rtmpCamera.stopStream();
       }
   });
}</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>We used a separate thread and a callback for that. That is why there is a runOnUiThread, but if you start the RTMP stream from your activity, you will not need that.</p>



<p>The RTMP URL can be set here <code data-enlighter-language="java" class="EnlighterJSRAW">rtmpCamera.startStream("URL to you live stream");</code></p>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Setting up the live stream encoder</h2>



<p>For our encoder, we used the simple API<a href="https://bitmovin.com/docs/encoding/articles/simple-encoding-api-live" target="_blank" rel="noreferrer noopener"> https://bitmovin.com/docs/encoding/articles/simple-encoding-api-live</a>, so we needed minimal configuration to get the live stream up and running. We used the CDN <a href="https://bitmovin.com/docs/encoding/articles/bitmovin-cdn-output" target="_blank" rel="noreferrer noopener">https://bitmovin.com/docs/encoding/articles/bitmovin-cdn-output</a> output as well because it would work out of the box.</p>



<p></p>



<p>To get this going, the first thing to set up is the input:</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">private SimpleEncodingLiveJobResponse setUpLiveStream() {
   SimpleEncodingLiveJobInput input = new SimpleEncodingLiveJobInput();
   input.setInputType(SimpleEncodingLiveJobInputType.RTMP);
   SimpleEncodingLiveJobRequest job = new SimpleEncodingLiveJobRequest();
   SimpleEncodingLiveJobCdnOutput outputUrl = givenCdnOutputWithFullHDResolution();</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Next is the output. In the spirit of the hackathon, we used a CND because of the minimal configuration, which you can set up like this:</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">private SimpleEncodingLiveJobCdnOutput givenCdnOutputWithFullHDResolution() {
   SimpleEncodingLiveJobCdnOutput output = new SimpleEncodingLiveJobCdnOutput();
   output.setMaxResolution(SimpleEncodingLiveMaxResolution.FULL_HD);
   return output;
}</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Now only some minor configurations are left.</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">   job.setInput(input);
   job.addOutputsItem(outputUrl);
   job.setCloudRegion(SimpleEncodingLiveCloudRegion.EUROPE);
   job.setName("Android app live stream");
   return bitmovinApi.encoding.simple.jobs.live.create(job);
}</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p></p>



<h2 class="wp-block-heading">Finishing touches</h2>



<p>A live stream takes a bit of time to be ready. in the essence of time, we swiftly did a very ugly “busy waiting” loop to wait until the live stream was done with the setup. To improve this, we have left it as an exercise for the reader.</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">public boolean setupLiveStreamAndWaitForRunningState(Callback cb) {
   this.stopped = false;
   this.encodingId = null;
   SimpleEncodingLiveJobResponse jobResponse = setUpLiveStream();
   try {
       while (!readyForIngestOrFailed(jobResponse) &amp;&amp; !stopped) {

           Thread.sleep(300);
           jobResponse = bitmovinApi.encoding.simple.jobs.live.get(jobResponse.getId());
           if (jobResponse.getEncodingId() != null &amp;&amp; this.encodingId == null) {
               this.encodingId = jobResponse.getEncodingId();
           }
           cb.reportStatus(jobResponse.getStatus().toString());
       }
   } catch (Exception e) {
       cb.toastError(e.getMessage());
   }
   if (this.stopped || this.encodingId == null || this.encodingId.isEmpty())
   {
       return false;
   }
   cb.startStreaming();
   this.rtmpUrl = String.format("rtmp://%s/live/%s", jobResponse.getEncoderIp(), jobResponse.getStreamKey());
   return true;
}</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>To retrieve the RTMP URL that needs to be inserted into the code, get it by using:</p>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">this.rtmpUrl = 
String.format("rtmp://%s/live/%s", jobResponse.getEncoderIp(), 
jobResponse.getStreamKey());</pre>



<div style="height:5px" aria-hidden="true" class="wp-block-spacer"></div>



<p>We had to run this in a separate thread because you cannot have HTTP requests in the UI thread in android, and it would not be a good user experience anyway.</p>



<p>Once the hard part was done, we spent the second day of the hackathon refining the app and making the UI better and even got some much-appreciated help from one of the Bitmovin UX designers.</p>



<p></p>



<p></p>



<h2 class="wp-block-heading">Wrapping up</h2>



<p>As the hackathon drew to a close, the competition was fierce, with great projects submitted by other teams. However, in the end, all of the efforts paid off, as our team won first place!&nbsp;</p>



<p>Here are a couple of images of how the live stream worked on an Android phone:</p>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img fetchpriority="high" decoding="async" width="230" height="512" src="https://bitmovin.com/wp-content/uploads/2022/12/Hackathon-Android-Application-Image-to-Start-Live-Stream.png" alt="- Bitmovin" class="wp-image-247706" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2022/12/Hackathon-Android-Application-Image-to-Start-Live-Stream-135x300.png?lossy=2&amp;strip=1&amp;webp=1 135w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2022/12/Hackathon-Android-Application-Image-to-Start-Live-Stream.png?lossy=2&amp;strip=1&amp;webp=1 230w" sizes="(max-width: 230px) 100vw, 230px" /></figure>



<p class="has-text-align-center">Visual of stream interface pre-live</p>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="230" height="512" src="https://bitmovin.com/wp-content/uploads/2022/12/Hackathon-Android-Application-Image-Live-Stream-Started.png" alt="- Bitmovin" class="wp-image-247707" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2022/12/Hackathon-Android-Application-Image-Live-Stream-Started-135x300.png?lossy=2&amp;strip=1&amp;webp=1 135w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2022/12/Hackathon-Android-Application-Image-Live-Stream-Started.png?lossy=2&amp;strip=1&amp;webp=1 230w" sizes="(max-width: 230px) 100vw, 230px" /></figure>



<p class="has-text-align-center">Visual of active live stream</p>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Additionally, if this project was interesting to you and you’re currently looking to test your streaming application across Android, iOS, or any other platform/device, check out our <a href="https://bitmovin.com/dashboard/signup" target="_blank" rel="noreferrer noopener">30-day free trial</a> where you can test the Bitmovin Live and VOD Encoder, Player or any of our other SaaS solutions completely free with no commitment.</p>



<p></p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/creating-live-stream-android-bitmovin%ef%bf%bc">Creating a Live Streaming Setup with Android Devices and Bitmovin</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Control and Customize Offline Playback for Mobile SDKs</title>
		<link>https://bitmovin.com/offline-playback-mobile-sdks</link>
		
		<dc:creator><![CDATA[Shilpa Murthy]]></dc:creator>
		<pubDate>Wed, 13 Mar 2019 23:32:03 +0000</pubDate>
				<category><![CDATA[Developers]]></category>
		<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">https://bitmovin.com/?p=28932</guid>

					<description><![CDATA[<p>We are noticing that more and more services are following Neflix&#8217;s lead in terms of implementing download and offline playback within their mobile applications. This is a feature that Bitmovin has supported for a while now. We have also added many more features to our Android and iOS SDKs as we worked with our customers to...</p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/offline-playback-mobile-sdks">Control and Customize Offline Playback for Mobile SDKs</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="aligncenter wp-image-24120 size-full" src="https://bitmovin.com/wp-content/uploads/2018/08/Main-Images-DemoAppUI-1.jpg" alt="Mobile Offline Playback" width="800" height="400" /><br />
We are noticing that more and more services are following Neflix&#8217;s lead in terms of implementing download and offline playback within their mobile applications. This is a <a href="https://bitmovin.com/introducing-bitmovins-android-ios-sdks/">feature that Bitmovin has supported for a while now</a>. We have also added many more features to our Android and iOS SDKs as we worked with our customers to implement download and offline playback for their mobile applications.</p>
<p style="text-align: center;"><span style="text-decoration: underline;"><strong>Supported Platforms:</strong></span><br />
iOS SDKs (iOS 9+)<br />
Android SDKs (Android 4.4+)</p>
<hr style="clear: both; visibility: hidden;" />
<h1>The Bitmovin Advantage with Offline Playback</h1>
<p><a href="https://bitmovin.com/bitmovin-mobile-sdk-datasheet/">Bitmovin Mobile SDKs</a> provides a class called <em><strong>OfflineManager</strong></em> that encapsulates all content download operations like starting content downloads, pausing and resuming downloads, canceling downloads and deleting already downloaded content.<br />
The <em><strong>OfflineManager</strong></em> seamlessly maintains and returns the correct download states regardless of whether the application is in foreground mode, background mode or application gets force closed by user or crashes unexpectedly.<br />
Here are the top reasons why Bitmovin can provide the best experience if you&#8217;re considering implementing download or offline playback for your mobile application(s):</p>
<ul>
<li><strong>Quick to implement</strong>: Developers can follow our tutorials or jumpstart POCs through our readily available Github projects.</li>
<li><strong>Easy to Use</strong>: Our Mobile Player SDKs and Player APIs simplifies and abstracts the download workflow so developers can implement their custom business rules and focus on end user experience.</li>
<li><strong>Simplified DRM implementation</strong>: Our Mobile Player SDKs supports download and offline playback of DRM and non-DRM content. We support easy-to-use offline DRM APIs that works with both Apple and Android devices. Benefits include:
<ul>
<li style="font-size: 1em;">Easy configurations to decorate or modify DRM requests as needed for offline and custom content workflows</li>
<li style="font-size: 1em;">Flexible DRM APIs that work with any major DRM provider (Ex: Irdeto, Verimatrix, BuyDRM and more)</li>
</ul>
</li>
<li><strong>Enables Customizations</strong>: Download Manager and APIs can be easily extended to support custom download use cases like:
<ul>
<li style="font-size: 1em;">Implementing custom DRM, License requests</li>
<li style="font-size: 1em;">Storing and Managing content on External storage</li>
<li style="font-size: 1em;">Customizing Device Notifications for better user experience</li>
<li style="font-size: 1em;">Customizing Content License rules (Ex: Enable background license refresh every 2 weeks etc)</li>
</ul>
</li>
<li><strong>Road Tested</strong>: Bitmovin delivers a very advanced and feature-packed Download Module that’s been production tested across major Broadcaster and Media customer deployments. We have evolved the feature set over the past year and addressed edge cases through first-hand experience.</li>
<li><strong>Excellent Support</strong>: Unlike Open Source Players (OSP), we provide APIs for all the major Download use cases that’s easier and more convenient to use. We also enable customizations to support unique workflows. We also provide expert staff to support implementation needs and answer questions through the integration process.</li>
</ul>
<h1>Control the Offline Playback Download Lifecycle:</h1>
<p>The Bitmovin Download feature is supported for both clear and DRM protected content. Bitmovin provides Player APIs and Events to track the download lifecycle:</p>
<div style="width: 50%; padding: 0 5px 0 0; float: left;">
<ul>
<li>Start Download</li>
<li>Suspend Download</li>
<li>Resume Suspended Download</li>
<li>Cancel Download</li>
<li>Delete Download</li>
<li>Track Download States
<ul>
<li style="font-size: 1em;">Downloaded</li>
<li style="font-size: 1em;">Downloading</li>
<li style="font-size: 1em;">Download Completed</li>
</ul>
</li>
</ul>
</div>
<div style="width: 50%; padding: 0 5px 0 0; float: right;">
<ul>
<li>Download Progress</li>
<li>Select one or more Audio, Caption files for Download</li>
<li>Select Video Quality for Download</li>
<li>Select preview thumbnails for download</li>
<li>Handle Download License states
<ul>
<li style="font-size: 1em;">Renewal</li>
<li style="font-size: 1em;">Refresh</li>
<li style="font-size: 1em;">Expiration</li>
</ul>
</li>
</ul>
</div>
<hr style="clear: both; visibility: hidden;" />
<h1>Customize Download Experience Based on your Business Rules:</h1>
<p>Bitmovin also provides a few utility features to help developers customize the download behavior and experience depending on device capabilities:</p>
<ul>
<li>Check Device Storage</li>
<li>Check External Storage</li>
<li>Check Internet Connectivity to determine offline or online playback</li>
<li>Provide Device Notifications for download events</li>
<li>Enables parallel downloads for multiple downloads</li>
<li>Configuration for background downloads</li>
<li>Extensive Download Error Reporting</li>
</ul>
<h1>Documentation</h1>
<p>Ready to get started? Check out our <a href="https://bitmovin.com/docs/player/tutorials" target="_blank" rel="noopener noreferrer">Bitmovin Player Tutorials</a> for getting started with Download on Mobile SDKs. We also provide code samples in our Github repos to help jumpstart development and POCs.</p>
<h2>Tutorials:</h2>
<ul>
<li><a href="https://bitmovin.com/docs/player/tutorials/offline-playback-with-the-bitmovin-ios-tvos-sdk" target="_blank" rel="noopener noreferrer">Getting Started with iOS Downloads</a></li>
<li><a href="https://bitmovin.com/docs/player/tutorials/offline-playback-with-the-bitmovin-android-sdk" target="_blank" rel="noopener noreferrer">Getting Started with Android Downloads</a>: The Bitmovin Android SDK minimizes offline content management and playback to a few API calls, and allows fast integration of offline capabilities.</li>
<li><a href="https://bitmovin.com/docs/player/faqs/how-does-offline-drm-work-on-bitmovin" target="_blank" rel="noopener noreferrer">How does offline DRM work on Bitmovin?</a>: Offline playback allows target devices to persist DRM licenses locally so that downloaded DRM protected assets can be played without requiring any connectivity.</li>
</ul>
<h2>Github Code Samples:</h2>
<ul>
<li><a href="https://github.com/bitmovin/bitmovin-player-ios-samples/tree/master/BasicOfflinePlayback" target="_blank" rel="noopener noreferrer nofollow">iOS Download Project</a></li>
<li><a href="https://github.com/bitmovin/bitmovin-player-android-samples/tree/master/OfflinePlayback" target="_blank" rel="noopener noreferrer nofollow">Android Download Project</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://bitmovin.com/offline-playback-mobile-sdks">Control and Customize Offline Playback for Mobile SDKs</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A Beginner’s Guide to Bitmovin’s Android SDK on Android TV Platforms</title>
		<link>https://bitmovin.com/beginners-guide-bitmovins-android-sdk-android-tv-platforms</link>
		
		<dc:creator><![CDATA[Michael Riha]]></dc:creator>
		<pubDate>Thu, 10 Jan 2019 05:09:21 +0000</pubDate>
				<category><![CDATA[Developers]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[video player]]></category>
		<guid isPermaLink="false">https://bitmovin.com/?p=24961</guid>

					<description><![CDATA[<p>The post <a rel="nofollow" href="https://bitmovin.com/beginners-guide-bitmovins-android-sdk-android-tv-platforms">A Beginner’s Guide to Bitmovin’s Android SDK on Android TV Platforms</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="lazyblock-section-with-container-2qeLKr wp-block-lazyblock-section-with-container">
<section 
    class="relative flex flex-col justify-center items-center py-24
     "
    >
    <div class="absolute inset-0 w-full h-full z-[-1] "
            >
            </div>
    <div class="container mx-auto">
        

<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>I’m Michael Riha, a Solutions Architect with Bitmovin. I wrote this guide to make it easy and save you time implementing Android TV apps using the Bitmovin Player SDK.</p>
</blockquote>



<p>A couple of months ago I had to build a prototype to showcase our capabilities on an old Android TV device with a rather old version of the Android operating system, v6 Marshmallow.<br>I hadn’t done any Android development since 2011, so I used this as an opportunity to write this guide to help anyone with even basic Android development experience get started. This took me a few hours to implement on my own, so hopefully my guide below combined with our code samples can get you started much faster! (And if you’ve made an existing Android app for video playback it will probably be even easier, after all Google claims that you can <a href="https://www.youtube.com/watch?v=qv-e1sV3gos&amp;t=620" rel="nofollow noopener" target="_blank">“bring your Android app to Android TV in minutes!”</a>)</p>



<h2 class="wp-block-heading">What are we building?</h2>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://bitmovin.com/wp-content/uploads/2019/01/AndroidStudio_emulator.2019-01-09-19_10_35-1.gif" alt="- Bitmovin" class="wp-image-25004" style="object-fit:cover"></figure>



<p><br>We’re making a simple Android TV proof of concept app. You’ll need some source video assets, basic experience using Android Studio installed on your preferred development machine, and an <a href="https://bitmovin.com/dashboard/signup">active or trial license of the Bitmovin player to complete the full guide</a>.</p>



<h2 class="wp-block-heading">Why Android TV?</h2>



<p>We’ve seen a recent trend of <a href="https://en.wikipedia.org/wiki/List_of_smart_TV_platforms_and_middleware_software" target="_blank" rel="noopener noreferrer nofollow">TV manufacturers and operators</a> like Sony, Mi-Box and AT&amp;T adopting Android as their base operating system for Smart TVs and set top boxes. Features such as access to the Google Play Store and rich video playback capabilities with 4K and HDR have helped Android <a href="https://technology.ihs.com/604804/smart-tv-share-jumps-to-70-percent-of-tv-shipments-in-2018-from-less-than-50-percent-in-2015-ihs-markit-says" target="_blank" rel="noopener noreferrer nofollow">dominate</a> the global Smart TV operating system, with market share over 40% per a recent report from IHS.<br>Unlike other popular Smart TV OS providers, Google has greatly simplified development for TVs by simply extending their existing mobile operating system for television sets and adapting the user interface for a remote input thereby consolidating towards a single development platform that can target various mobile and television screens regardless of touch or remote inputs.<br>Given the broad reach of the platform and the relative ease of development, this presents a perfect opportunity for developers and content owners to quickly re-purpose their Android <a href="https://bitmovin.com/bitmovin-mobile-sdk-datasheet/">Mobile player SDKs</a> and apps for Android TV development, allowing them to reach more target devices and acquire audiences across new screens with little to no additional effort.</p>



<h2 class="wp-block-heading">Bitmovin Support for Android and Android TV</h2>



<p>Bitmovin has provided an <a href="https://bitmovin.com/android-streaming-media-player/" target="_blank" rel="noopener noreferrer">Android Player SDK</a> for a few years now. Since its debut in 2017 with basic MPEG-DASH and HLS playback capabilities, we have come a long way to add more premium out-of-the-box features like advertising, analytics integrations, DRM support, <a href="https://bitmovin.com/bitmovin-player-chromecast/">Chromecast</a> support, VR playback, `CustomUI` and much more to stay ahead of modern streaming needs.<br>More importantly, we are obsessed with performance and know how important it is for our customers and end users to have a really good playback experience. For this reason, we provide advanced video playback optimization features such as fully customizable ABR logic, multi-codec streaming, offline playback and much more all included in the robust player SDKs and unified Player APIs so developers can quickly and easily deploy media apps for any and all Android OS supported platforms.<br><strong>Our full list of sample code and quick start guides can be found here:</strong><br><a href="https://github.com/bitmovin/bitmovin-player-android-samples" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-android-samples</a><br>Unlike many of our competitors, we support a complete native player implementation and do not use an HTML5 player with a WebView for video playback in our Android SDKs. However, we do support common JavaScript APIs for skin customizations and third party integrations to simplify development, optimize playback performance and leverage other benefits of the hardware media decoding capabilities through what we call a “hybrid approach” as detailed in our <a href="https://bitmovin.com/theres-app-html5-vs-native-app-video-playback/" target="_blank" rel="noopener noreferrer">post on HTML5 vs. hybrid vs. native Apps</a>.</p>



<h2 class="wp-block-heading">Getting Started with Android TV</h2>



<p>It has been a few years since I developed an Android TV application, so it was time for a refresher of the Android TV basics. I think these notes would have saved me a lot of time getting started, so I had to share! (Skip this section if you’re already familiar with Android TV and just want the quick player SDK implementation guide.)<br>If you are building an app that operates both on TV and other devices, you will need to first check what kind of device your app is running on and accordingly adjust the operation of your app.<br>The recommended way to determine if your app is running on a TV device is to use the <code><code></code></code><a href="https://developer.android.com/reference/android/app/UiModeManager.html#getCurrentModeType()" target="_blank" rel="noopener noreferrer nofollow">UiModeManager.getCurrentModeType()</a> method to check if the device is running in television mode.<br><script src="https://gist.github.com/michael-riha/dd8a90bbfda5c411f0b7ce81d148816e.js"></script><br><a href="https://developer.android.com/training/tv/start/hardware" target="_blank" rel="noopener noreferrer nofollow">https://developer.android.com/training/tv/start/hardware</a><br>Probably the hardest part about the video player for someone coming from a web or mobile background is handling user interactions via various controllers (remote or console) depending on what hardware the TV or set top box vendor may offer as there is no touchscreen like phones for Android TVs, at least for now.<br>Not to worry, Bitmovin already offers default user interfaces for phones, TVs and Chromecast which can be used as-is or easily modified to support a full range of customizations. The native Bitmovin Android Player SDK itself uses a WebView on top of the video player to offer maximum compatibility and convenience for developers to reuse CSS and JavaScript based interfaces with few quick tweaks.<br><strong>This means we can use one interface to rule all the devices!</strong><br>The Bitmovin Adaptive Streaming Player UI is open source and can be found here. <a href="https://github.com/bitmovin/bitmovin-player-ui" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-ui</a></p>



<h2 class="wp-block-heading">Meet the D-Pad</h2>



<figure class="wp-block-image alignleft is-resized"><img decoding="async" src="https://bitmovin.com/wp-content/uploads/2019/01/tv-android-tv-system-overview-navigation-button-select.jpg" alt="- Bitmovin" class="wp-image-24995" style="width:800px" width="800" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2019/01/tv-android-tv-system-overview-navigation-button-select-150x150.jpg?lossy=2&amp;strip=1&amp;webp=1 150w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2019/01/tv-android-tv-system-overview-navigation-button-select-300x300.jpg?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2019/01/tv-android-tv-system-overview-navigation-button-select.jpg?size=384x384&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2019/01/tv-android-tv-system-overview-navigation-button-select.jpg?lossy=2&amp;strip=1&amp;webp=1 720w" sizes="(max-width: 720px) 100vw, 720px" /></figure>



<figure class="wp-block-image aligncenter"><img loading="lazy" decoding="async" width="1604" height="858" src="https://bitmovin.com/wp-content/uploads/2019/01/Large-GIF-1604x858-1.gif" alt="Animated gif of D-pad input in Android Studio emulator" class="wp-image-25014" style="object-fit:cover"/></figure>



<p><br>While the graphical user interface is easy to show and use remember <strong>we do not have a touchscreen!</strong> Instead we have another input called the directional pad, or D-pad.<br>The <a href="https://designguidelines.withgoogle.com/android-tv/system-overview/navigation.html#navigation-controllers" target="_blank" rel="noopener noreferrer nofollow">primary navigation method on Android TV is the D-pad</a>, offering basic movement up, down, left, and right via directional hardware buttons. Next to the navigation buttons most remotes also have Select, Back and Home buttons.<br>In addition to the D-pad, the end user can also plug in gamepads or even standard keyboards to the device via USB, but I wanted to make my life easy at the beginning so I just supported D-pad inputs.<br><br>For my sample project we did end up supporting keyboards at a later stage, but let’s leave that for another day.</p>



<h2 class="wp-block-heading">Add a TV Activity</h2>



<p>Android system initiates code in an <a href="https://developer.android.com/reference/android/app/Activity.html" target="_blank" rel="noopener noreferrer nofollow">Activity</a> instance by invoking specific callback methods that correspond to specific stages of its lifecycle. Most basic interactions with the player i.e. Play, Pause and Seeking can be implemented directly in an Activity.<br>If you already have an Android app, you can add Android TV support quickly by reusing your existing app architecture. For this purpose, there are two main components you should use to create an app that runs on TV devices:</p>



<ul>
<li><strong>Activity for TV (Required)</strong> &#8211; In your application manifest, declare an activity that is intended to run on TV devices.</li>



<li><strong>TV Support Libraries (Optional)</strong> &#8211; There are several <a href="https://developer.android.com/training/tv/start/start#tv-libraries" target="_blank" rel="noopener noreferrer nofollow">support libraries</a> available for TV devices that provide widgets for building user interfaces.</li>
</ul>



<p><a href="https://developer.android.com/training/tv/start/start" target="_blank" rel="noopener noreferrer nofollow">https://developer.android.com/training/tv/start/start</a><br>The official documentation shows how two activities can run side by side and in this example, the TvActivity is the entry point for your AndroidTV app.<br><script src="https://gist.github.com/michael-riha/799ab88335398a6e99ff613104d5a2ec.js"></script></p>



<h2 class="wp-block-heading">Let’s Start Using the Player SDK</h2>



<p>If you are already familiar with the Android native player, the Bitmovin Android Player SDK works out of the box in just a few minutes.<br>If this your first time implementing video playback on Android, we have you covered! Take a look at BasicPlayback-Example or BasicPlaybackTV-Example from the Bitmovin Android Player SDK sample repository. Simply clone and select the appropriate example from here:<br><a href="https://github.com/bitmovin/bitmovin-player-android-samples/tree/master/BasicPlaybackTV" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-android-samples/tree/master/BasicPlaybackTV</a><br>You’ll need to add your Bitmovin Player license key inside the application tag in the manifest file as shown below. YOUR_LICENSE_KEY has to be replaced by your own license key, obtained through a paid or <a href="https://bitmovin.com/dashboard/signup" target="_blank" rel="noopener noreferrer">free trial account</a>.<br><code><code></code></code><strong>&lt;meta-data android:name=&#8221;BITMOVIN_PLAYER_LICENSE_KEY&#8221; android:value=&#8221;YOUR_LICENSE_KEY&#8221; /&gt;</strong><br>Next, log in to <a href="https://dashboard.bitmovin.com" target="_blank" rel="noopener noreferrer">https://dashboard.bitmovin.com</a> and add the following package names of the sample applications as allowed domains under Player -&gt; Licenses.<br>Optionally, if you want to just start from scratch without any blueprint, follow these eight simple steps from our repository on how to use the Bitmovin Android Player SDK:<br><a href="https://github.com/bitmovin/bitmovin-player-android-samples#using-the-bitmovin-player-android-sdk" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-android-samples#using-the-bitmovin-player-android-sdk</a></p>



<h2 class="wp-block-heading">How To: Android Layout &amp; User Interface</h2>



<p>Now that we have our Android TV application running in minutes, let’s dig into some details, tips and tricks that I can tell you from playing around with the Bitmovin Android Player SDK player.</p>



<h3 class="wp-block-heading">Show me the player</h3>



<p>First, let’s get the player up and running. There are some ways to get our Player displayed on an app similar to the basic building block for user interface components called a View.</p>



<ol>
<li>You can add your View to the Layout XML file as we do in our Sample Demo <a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/master/BasicPlaybackTV/src/main/res/layout/activity_main.xml#L2" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-android-samples/blob/master/BasicPlaybackTV/src/main/res/layout/activity_main.xml#L2</a>.</li>



<li>It is also possible to instantiate the View in your Activity, however, due to Android TV hardware limitations and legacy OS pitfalls, we recommend to add all views using the Layout XML file when possible.I noticed that it instantiating the View from your main Activity is not as stable on hardware with slower CPUs. So even if it is possible, I wouldn’t recommend it as it took me hours to debug it.</li>



<li>Another option is to use a Fragment, especially if you started building layouts and user interfaces referencing Google’s Android TV examples like browsing content on TV or showing details of a movie with the DetailFragment.Fragments are a modular section of an Activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running. You can think of it as a &#8220;subactivity&#8221; that you can reuse. The Bitmovin Android Player SDK also offers the Player as a Fragment and we do also have an example for that. <a href="https://github.com/bitmovin/bitmovin-player-android-samples/tree/2d992c76623ae7cd4546c115a3e88597f5fc4f5d/BasicPlayerFragment" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-android-samples/tree/2d992c76623ae7cd4546c115a3e88597f5fc4f5d/BasicPlayerFragment</a></li>
</ol>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://bitmovin.com/wp-content/uploads/2019/01/playerView_full_AndroidStudio-1-1024x559.png" alt="Android Studio showing a main activity XML layout" class="wp-image-25011" style="object-fit:cover"/></figure>



<p>To be honest, I had not used fragments before and started with #2 which cost me hours for some painful debugging. So, after learning about Android TV hardware limitations and legacy OS pitfalls, I highly recommend that you <strong>stick to #1</strong> and you will first hand, experience the full power of the Bitmovin Android Player SDK player in every case.<br></p>



<h3 class="wp-block-heading">Can’t touch this! Show the UI</h3>



<p>As I mentioned earlier, the UI might be tricky if you leave it to the default settings because it is optimized for touch screen devices and uses CSS and JavaScript with a WebView to reuse your custom interface.<br>I say <em>&#8220;might&#8221;</em> because in the end, this makes it quite easy and just takes seconds to use an interface that is suited for the TV use-case including our Chromecast player.<br>It takes just one line to include a local JavaScript file as the UI component on top of the Bitmovin Android Player SDK. This UI is optimized for being used on TV devices, where no touch screen is available.<br><code><code></code></code><strong>playerConfiguration.getStyleConfiguration().setPlayerUiJs(&#8220;file:///android_asset/bitmovinplayer-ui.js&#8221;);</strong><br><a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/5f0719f954e4ce8faee1bb290bed715a7ae1b935/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L64-L68" target="_blank" rel="noopener noreferrer nofollow">See this snippet directly in our demo code</a><br>The JavaScript file for this UI you can <a href="https://github.com/bitmovin/bitmovin-player-android-samples/tree/5f0719f954e4ce8faee1bb290bed715a7ae1b935/BasicPlaybackTV/src/main/assets" target="_blank" rel="noopener noreferrer nofollow">find in our Repository here</a>.<br>You can also create your own user interface from scratch like on our web player. Just take a look at this repository on Github and play around a bit with the web player to debug and if you are satisfied, put it in your Android TV application as shown above. As simple as that!<br><a href="https://github.com/bitmovin/bitmovin-player-ui" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-ui</a></p>



<h2 class="wp-block-heading">User Interaction and Controls</h2>



<p>This part needs some work as we cannot leverage the default GUI as TVs are not touch screen.<br>We can do a lot of customizations here i.e. build fancy new user interactions based on the D-pad controller, gamepads or even keyboards depending on what might get attached to the Android TV hardware.<br>But let’s keep it simple to start with.<br>In our BasicPlaybackTV sample, we listened to all dispatched events occurring when a key press starts inside the Activity.<br><script src="https://gist.github.com/michael-riha/b77f77505120aff4528c2995890d33a5.js"></script><br><a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/5f0719f954e4ce8faee1bb290bed715a7ae1b935/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L116-L130" target="_blank" rel="noopener noreferrer nofollow">See this snippet directly in our demo code</a><br>Now we just have to handle events that push a key down. This can be used for any button pushed down on a keyboard, D-Pad or gamepad. In the <code><code></code></code><em>handleUserInput</em> method, we pass the code of the key pushed.<br><script src="https://gist.github.com/michael-riha/78b1ccc91801136027dd77d2510fd55b.js"></script><br><a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/5f0719f954e4ce8faee1bb290bed715a7ae1b935/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L134-L167" target="_blank" rel="noopener noreferrer nofollow">See this snippet directly in our demo code</a><br>In the <code><code></code></code><em>handleUserInput</em> method inside the Activity we map the key-events to the related player API methods. For instance, if the D-pad center button is pressed, we want to toggle between play and pause.<br><script src="https://gist.github.com/michael-riha/32ff67d6493de14d6ca643a87a2e1d49.js"></script><br><a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/5f0719f954e4ce8faee1bb290bed715a7ae1b935/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L169-L197" target="_blank" rel="noopener noreferrer nofollow">See this snippet directly in our demo code</a></p>



<h2 class="wp-block-heading">ABR or better Adaptive bitrate streaming</h2>



<p>As I mentioned before, we are obsessed with playback performance. So, we’ve taken extra care when it comes to adaptive streaming. ABR works out of the box with full support for MPEG-DASH &amp; HLS streaming. Additionally, you can also customize or override the default ABR logic through <code><code></code></code><em>startupBitrate, maxSelectableVideoBitrate, allowRebuffering, videoAdaptation</em> callbacks to override bitrate selection decisions dynamically.<br>Example: By default, ABR logic is optimized for mobile devices and tries to start up with a lower bitrate for the first few segments but with one line of code(shown below), it can be easily tweaked to suit your TV streaming use-cases where you can choose medium to high starting bitrate.<br><code><code></code></code><em>PlayerConfiguration#setStartupBitrate()</em><br><script src="https://gist.github.com/michael-riha/6a291dee847a1417f5869e72fb8daf53.js"></script><br>This Snippet can be pasted around <a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/5f0719f954e4ce8faee1bb290bed715a7ae1b935/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L69" target="_blank" rel="noopener noreferrer nofollow">this lines in the Code</a>.</p>



<h2 class="wp-block-heading">Benchmark Using Bitmovin Analytics</h2>



<p>In addition to cross platform player SDKs and <a href="https://bitmovin.com/video-encoding-data-sheet/">cloud encoding</a>, Bitmovin also offers an Analytics product which can be used to monitor quality of playback in real time. Developers can also adjust player ABR logic for start up and peak limiting by monitoring actual bitrates consumed by end users to provide the best playback experience while balancing streaming costs.<br>By using this completely customizable solution, your team can not only set up an analytics interface that fits your business, but they can adapt it as your business develops.<br>Enabling Analytics in the Bitmovin Android Player SDK is quite easy &#8211; even I could do it! <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br>After including the Lib and getting the license from our dashboard, you include a couple of classes to your android project as described here in our <a href="https://github.com/bitmovin/bitmovin-analytics-collector-android" target="_blank" rel="noopener noreferrer nofollow">Bitmovin Analytics Collector repository</a>.<br><script src="https://gist.github.com/michael-riha/85c5d9629dfc38be9d4c5ad9aaf02a4f.js"></script><br><strong>Tip:</strong> Inside the <code><code></code></code><em>bitmovinAnalyticsConfig</em> Object, you need the Player license key, which is already stored in the manifest.xml. I was too lazy to paste it another time and thought it could save the trouble for others too.<br>Here’s a little method that automatically copies the license into the config object for you:<br><script src="https://gist.github.com/michael-riha/08fc8cd83b373b14baaf41a3f5de735b.js"></script><br>(So during configuration of the Bitmovin Analytics, I just call <code><code></code></code><em>getPlayerLicenseKey()</em> and put the result into the <code><code></code></code><em>BitmovinAnalyticsConfig</em> constructor)<br>If you already have this set up, just attach the <code><code></code></code><em>bitmovinPlayer</em> to the Analytics Collector and you are good to go.<br><script src="https://gist.github.com/michael-riha/cf88c8a2f578411cbeffee2c959fef72.js"></script></p>



<h2 class="wp-block-heading">Ad Integration</h2>



<p>Displaying ads using the Bitmovin Android Player SDK is straightforward as well, and we even offer a sample application for this.<br><strong>To keep it short:</strong></p>



<ul>
<li>You just have to create an AdSource object.</li>



<li>This AdSource is used in the constructor of an AdItem.</li>



<li>This AdvertisingConfiguration goes straight into the general PlayerConfig to set up the player, as you might already expect if you are familiar with the players from Bitmovin.</li>
</ul>



<p><script src="https://gist.github.com/michael-riha/3daa9e09d4ea3800f88f08d5853a183f.js"></script><br>If you call <code><code></code></code><em>play()</em> in the <code><code></code></code><em>bitmovinPlayer</em> now, all the ads from the <code><code></code></code><em>AdvertisingConfiguration</em> will be scheduled automatically as well.<br><a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/master/BasicAds/src/main/java/com/bitmovin/player/samples/ads/basic/MainActivity.java#L37" target="_blank" rel="noopener noreferrer nofollow">See this in action in our full example</a></p>



<h2 class="wp-block-heading">Debugging, Benchmarking, and Logging</h2>



<p>For debugging purposes, wireless debugging might be a lot of help with Android TV devices. This is pretty straightforward and the <a href="https://developer.android.com/studio/command-line/adb" target="_blank" rel="noopener noreferrer nofollow">Android Developer page</a> explains this in good detail. For convenience, we’ve included the relevant excerpt below:</p>



<ol>
<li>Connect your Android device and adb host computer to a common Wi-Fi network accessible to both. (use an access point whose firewall is configured properly to support adb)</li>



<li>Connect the device to the host computer with a USB cable.</li>



<li>Set the Android TV device to listen for a TCP/IP connection on port 5555.<br><code><code></code></code><em>$ adb tcpip 5555</em></li>



<li>Disconnect the USB cable from the Android TV device</li>



<li>Find the IP address of the Android device, for example: Settings &gt; Wi-Fi Settings &gt; Advanced &gt; IP address.</li>



<li>Connect to the device by its IP address.<br><code><code></code></code><em>$ adb connect device_ip_address</em></li>



<li>Confirm that your host computer is connected to the Android TV device<br><code><code></code></code><em>$ adb devices<br>List of devices attached<br>device_ip_address:5555 device</em></li>



<li><strong>Start debugging!</strong></li>
</ol>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://bitmovin.com/wp-content/uploads/2019/01/Large-GIF-1452x954-2-2.gif" alt="Android Studio showing emulator of Android TV app with network and CPU profiler" class="wp-image-25017" style="object-fit:cover"/></figure>



<p>Logging is straightforward in Android Studio so nothing new to share there, just take a look at: <a href="https://developer.android.com/studio/debug/am-logcat" target="_blank" rel="noopener noreferrer nofollow">https://developer.android.com/studio/debug/am-logcat</a><br>If you want to listen to errors dispatched by the player, just take a look at these few lines of code. <a href="https://github.com/bitmovin/bitmovin-player-android-samples/blob/master/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L203" target="_blank" rel="noopener noreferrer nofollow">https://github.com/bitmovin/bitmovin-player-android-samples/blob/master/BasicPlaybackTV/src/main/java/com/bitmovin/samples/tv/playback/basic/MainActivity.java#L203</a><br>During development, if you want to see what our ABR or Ad Integration is doing, use the built-in Network Profiler in Android Studio. <a href="https://developer.android.com/studio/profile/network-profiler" target="_blank" rel="noopener noreferrer nofollow">https://developer.android.com/studio/profile/network-profiler</a><br><br>Here you can see how our bitrate adaptation is doing a very good job.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>In the end, my final pet project took a couple of hours to set up, but in the process we’ve ironed all those out for you! Hopefully with this article and the new code samples in our repository you can get your Android TV development started in just a few minutes! Code away!<br><strong>Michael Riha&nbsp;</strong>is a product developer for the media content and advertising industry for two decades now. The curiosity he has to look deeply under the hood of digital development in general led&nbsp;to his rare ability to design, and technically implement, digital products with deep technical and strategical knowledge of the market.<br>The complete package made him the perfect match for Bitmovin as a Senior Solutions Architect.<br>Do you want to help us make sweet getting started guides like these? <a href="https://bitmovin.com/careers/">We&#8217;re hiring!</a></p>

    </div>
</section></div><p>The post <a rel="nofollow" href="https://bitmovin.com/beginners-guide-bitmovins-android-sdk-android-tv-platforms">A Beginner’s Guide to Bitmovin’s Android SDK on Android TV Platforms</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
		<media:content url="https://www.youtube.com/embed/qv-e1sV3gos" medium="video" width="1280" height="720">
			<media:player url="https://www.youtube.com/embed/qv-e1sV3gos" />
			<media:title type="plain">Bring your Android app to Android TV in minutes - Google I/O 2016</media:title>
			<media:description type="html"><![CDATA[Hear +WaynePiekarski (Wayne Piekarski) and +ryanseys1 (Ryan Seys) talk about bringing your Android app to Android TV in minutes. Bringing your app to the liv...]]></media:description>
			<media:thumbnail url="https://bitmovin.com/wp-content/uploads/2019/01/Main-Image-Android-TV-SDK-1.webp" />
			<media:rating scheme="urn:simple">nonadult</media:rating>
		</media:content>
	</item>
		<item>
		<title>Test Your Streams in Our Player on iOS and Android with the Bitmovin Mobile Apps</title>
		<link>https://bitmovin.com/test-streams-player-ios-android-bitmovin-mobile-apps</link>
		
		<dc:creator><![CDATA[Mario Graf]]></dc:creator>
		<pubDate>Fri, 24 Aug 2018 11:20:47 +0000</pubDate>
				<category><![CDATA[Product Updates]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS]]></category>
		<guid isPermaLink="false">http://bitmovin.com/?p=24116</guid>

					<description><![CDATA[<p>Quickly and easily check your video streams in our Native SDKs with the Bitmovin mobile apps using your own streams, DRM licenses and Ad servers If you are considering using the Bitmovin Player in your native app then the first thing you should do is download the Android and/or the iOS Bitmovin app to get...</p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/test-streams-player-ios-android-bitmovin-mobile-apps">Test Your Streams in Our Player on iOS and Android with the Bitmovin Mobile Apps</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-24120" src="https://bitmovin.com/wp-content/uploads/2018/08/Main-Images-DemoAppUI-1.jpg" alt="- Bitmovin" width="800" height="400"></p>
<blockquote><p>Quickly and easily check your video streams in our Native SDKs with the Bitmovin mobile apps using your own streams, DRM licenses and Ad servers</p></blockquote>
<p>If you are considering using the Bitmovin Player in your native app then the first thing you should do is download the Android and/or the iOS Bitmovin app to get a feeling for what you can expect from the Bitmovin Player when you integrate it into your own app. Our freshly redesigned apps are built specifically to help you to quickly and easily assess and test the Bitmovin Player before you invest time into integration.<br />
Answer questions like: Will your streams play in the Bitmovin Player on Android and iOS? How does DRM work? What are the advertising capabilities and how are they configured? Can you style the UI to fit your brand? All of these questions can be answered in a few minutes using your own streams, DRM licenses and ad sources so you can be sure that the Bitmovin Player is the right player to integrate into your project.</p>
<div style="text-align: center; margin-bottom: 50px;">
<h3>Download the App now:</h3>
<p>&nbsp;</p>
<div style="text-align: center;"><a style="display: inline-block;" href="https://itunes.apple.com/us/app/bitmovin-player/id1245174386?mt=8" target="_blank" rel="noopener noreferrer nofollow"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-24208" src="https://bitmovin.com/wp-content/uploads/2018/08/button-download-app-store.png" alt="- Bitmovin" width="192" height="60"></a>      <a style="display: inline-block;" href="https://play.google.com/store/apps/details?id=com.bitmovin.playerdemo&amp;hl=en_US" target="_blank" rel="noopener noreferrer nofollow"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-24209" src="https://bitmovin.com/wp-content/uploads/2018/08/button-download-google-play.png" alt="- Bitmovin" width="192" height="60"></a></div>
<p>and follow along on our brief product tour.
</p></div>
<p>&nbsp;</p>
<div style="text-align: center;"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-24143" style="border: 1px solid #d6d6d6; margin: 0 auto;" src="https://bitmovin.com/wp-content/uploads/2018/08/home-screen-1-355x1024.png" alt="- Bitmovin" width="355" height="1024"></div>
<h2>Product Tour: How to Test Video in your Mobile App with Bitmovin SDKs</h2>
<p>When you enter the app, one of the easiest ways to get started is to test your video stream in the Bitmovin Mobile Player, seeing if our mobile SDKs will support your stream. Hit “Own Stream” and copy and paste your file URL in the Stream Section at the top. After you hit “Play” you’ll see your video instantly play in the Bitmovin Player.<br />
You can also check your stream for your web version here: <a href="https://bitmovin.com/demos/stream-test" target="_blank" rel="noopener noreferrer">Stream Test for DASH, HLS and Progressive</a></p>
<div style="text-align: center;"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-24143" style="border: 1px solid #d6d6d6; margin: 0 auto;" src="https://bitmovin.com/wp-content/uploads/2018/08/video-details-1-1-576x1024.png" alt="- Bitmovin" width="400" height="711"></div>
<h2><a href="https://bitmovin.com/demos/player-ui-styling" target="_blank" rel="noopener noreferrer">UI Styling</a></h2>
<p>A unified user interface ensures that your player will look the same across devices while maintaining brand standards. When you try our streaming video demos, you’ll see a customization option on the “Video Details” screen labeled, “Theme.” Select this option on the bottom left, and you’ll be able to apply a skin that changes the color of the user interface. An added benefit? This styling is enabled via CSS, meaning your developers won’t or devote additional time to custom projects.<br />
<i>Please note, our app is an easily customizable with fully maintained code that you can build your mobile video experience on, but if you’d like to vary the look, feel, and functionality of your mobile app, we do offer sample open-source code. Developers can completely customize apps using our open source video projects.</i></p>
<div style="text-align: center;"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-24140" style="border: 1px solid #d6d6d6; margin: 0 auto;" src="https://bitmovin.com/wp-content/uploads/2018/08/drm-scheme-1-576x1024.png" alt="- Bitmovin" width="400" height="711"></div>
<h2><a href="https://bitmovin.com/demos/drm" target="_blank" rel="noopener noreferrer">DRM Stream Test</a></h2>
<p>Back in the streaming test area, labeled “Own Stream” there are other options for you to try. Security is paramount to many of our customers, so we’ve made it easy to test an encrypted DRM stream live. Simply copy and paste your license or certificate URL to see if your DRM system and codecs are supported. Integrating DRM into your mobile video app workflow is much easier than you think, and you’re always protected. (<a href="https://bitmovin.com/state-web-drm-whitepaper/">Download our DRM Whitepaper</a> or watch our Webinar: <a href="https://bitmovin.com/drm-basics-with-irdeto-bitmovin/">DRM Basics with Irdeto &amp; Bitmovin</a>)</p>
<div style="text-align: center;"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-24142" style="border: 1px solid #d6d6d6; margin: 0 auto;" src="https://bitmovin.com/wp-content/uploads/2018/08/schedule-ad-1-576x1024.png" alt="- Bitmovin" width="400" height="711"></div>
<h2><a href="https://bitmovin.com/demos/ad-scheduling" target="_blank" rel="noopener noreferrer">Ad Scheduling</a></h2>
<p>Also within the area of the app labeled “Own Stream” is our mobile ad scheduling demo. Test our seamless ad insertion and see how our app easily integrates with different advertising standards (VAST, VPAID, IMA, and VMAP). At the bottom of your screen, hit the “+” next to “Schedule Ad” and you’ll be able to set the position and location of your video advertisement. Then, paste the URL and then hit “Play” to see your ad inserted into our standard demo video at the time and location you requested. Push the test to the limits and schedule up to three ads at any time.</p>
<div style="text-align: center;"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-24137" style="border: 1px solid #d6d6d6; margin: 0 auto;" src="https://bitmovin.com/wp-content/uploads/2018/08/cast-1-576x1024.png" alt="- Bitmovin" width="400" height="711"></div>
<h2><a href="https://bitmovin.com/demos/chromecast" target="_blank" rel="noopener noreferrer">Chromecast</a> and iOS Airplay</h2>
<p>On the “Video Details” screen where you previously analyzed the essential properties of your files and played around with different themes, there is another Bitmovin application to try out! More users are discovering and watching videos on their phones, but sometimes going fullscreen isn’t enough- they want to share these experiences with those around them. This is where video casting and mirroring services like Chromecast and Airplay come in handy. When testing our mobile video app, throw your video stream up on a connected TV in your workplace by simply hitting the “Cast” or “Airplay” button. After confirming the TV name and network, your content will play on a larger screen with quality and resolution intact.</p>
<h2>Which Video App Demos Should You Try First?</h2>
<p>Testing functionality is a vital part of the development process. But when figuring out <a href="https://bitmovin.com/how-to-build-out-video-capabilities-for-your-app/" target="_blank" rel="noopener noreferrer">how to add video capabilities</a>, you’ll want to “try before you buy” so that you and your team see results before investing. If you’re in Marketing, make sure to try our UI styling demo. If you’re in Media, the Ad Scheduler and AirPlay functionalities may be attractive. Don’t be shy, get in there and play around! Make it a collaborative group activity at your next stand-up. We’ll be here to answer any questions you may have along the way.<br />
Remember, mobile app development can already be a costly undertaking. And now, to stay competitive, your business needs video too. Giving your developers the best tools is a no-brainer, but project delays are inevitable when you develop everything in-house. Using video SDKs, your business becomes more efficient and can better service customers long-term. When customers have a fantastic experience (and spend more time in your app,) advertisers and investors are happy too!</p>
<h3 style="text-align: center;">See It For Yourself:</h3>
<p>&nbsp;</p>
<div style="text-align: center;"><a style="display: inline-block;" href="https://itunes.apple.com/us/app/bitmovin-player/id1245174386?mt=8" target="_blank" rel="noopener noreferrer nofollow"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-24208" src="https://bitmovin.com/wp-content/uploads/2018/08/button-download-app-store.png" alt="- Bitmovin" width="192" height="60"></a>      <a style="display: inline-block;" href="https://play.google.com/store/apps/details?id=com.bitmovin.playerdemo&amp;hl=en_US" target="_blank" rel="noopener noreferrer nofollow"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-24209" src="https://bitmovin.com/wp-content/uploads/2018/08/button-download-google-play.png" alt="- Bitmovin" width="192" height="60"></a></div>
<p>The post <a rel="nofollow" href="https://bitmovin.com/test-streams-player-ios-android-bitmovin-mobile-apps">Test Your Streams in Our Player on iOS and Android with the Bitmovin Mobile Apps</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
