Showing posts with label tvOs. Show all posts
Showing posts with label tvOs. Show all posts

Sunday, November 15, 2015

Apps on the big screen part II; tvOS app development for real

Earlier I wrote about apps on the big screen, apps for Apple TV and for Android TV. Earlier I have been so lucky to receive one of the Apple TV developers kits so I had some time to play with it. Is it the larger screen or are the many new options that could become available with it causing all the fun? Anyway, I am having a great time creating apps for the new platform.

I had to buy an USB-C to USB-A cable to connect the Apple TV to my Mac book, because Apple informed me that using iTunes on a Mac is the only way to update the Apple TV. That cable did not come with my developers kit so it took some time to get one, as an USB-C cable is not yet in my otherwise large cable collection.

Hello TV!

So I connected the two devices only to find out that iTunes was not able to connect to the server. So, no update yet. But it was fun to find out that I was able to deploy directly from xCode to the TV.

It is not really different from running an app on your iPhone but I was surprised because I thought I had to use the TestFlight app for that and so far I had seen my early creations on the simulator only.



Get up to speed

There is no need to dive into TVML right away. You can use existing Objective-C or Swift code or code snippets and get up to speed with tvOS real quickly. The downside is that currently not all frameworks that exists for iOS are available for tvOS (yet). For some of them that makes sense as Apple TV development comes with some known limitations.

One of them is the lack of any option for local persistency. All application data needs to be stored in the (i)cloud. What makes less sense is that, for example, the Event Kit framework is missing for tvOS. I am sure there will be a workaround for this but these kind of things do not make the life of a tvOS developer very easy.

Parse & tvOS

Using SDKs from third parties in your tvOS project can be an issue as well. For my app I want to store data in the cloud using Parse. I cannot use iCloud because I want to share the app with Apple TV and with Android TV users.

Unfortunately Parse cannot be used, basically because the SDK supports caching and other local persistancy features. It is not going to work and you have to wait until the guys at Parse release a tvOS specific version of their SDK or you can try to use the Parse Rest API and do some things yourself.

Conclusion

Since I am a huge fan of Parse I really miss their SDK for tvOS. On GitHub you can find a Parse REST API approach for tvOS. It is written in Swift and although minimalistic it looks like an interesting start to make my tv app work with Parse anyway.

I still have not totally grokked tvOS yet and how to work around existing limitations but I am doing some great research on the topic. In the mean time you can check out some interesting resources on the topic. There are some nice examples available here. Or check this site or this one.

Or watch this video or this one.

Further reading

Sunday, November 1, 2015

Apps on the big screen; Apple TV 4 & Android TV

We have apps on our phones, phablets, tablets and on our watches. And since recently we do have apps on TV. This year Android TV has become available and of course Apple has released its Apple TV 4, and with that, tvOS. This creates interesting new opportunities for developers (and publishers).

Both Apple and Google are aiming at streaming movies and TV series and at casual gaming but you can also think of other type of apps. So called second screen apps, for example, could be integrated into a television show directly.

On the other hand apps for TV can not be compared with apps on your phone as the interaction is completely different on television. TV apps are much more about consuming content and information and are less focused on interaction. Given this fact it will be difficult to predict exactly what TV apps are going to bring us in the future, other than movies, music and TV-series.


Apple TV

The fourth generation of Apple TV finally comes with an app store and the possibility for third parties to develop apps for it. Now Siri on TV seems to be the most impressive part of the new Apple TV, but after a while, when more apps become available, I expect these new apps to be the most interesting part of it.

The new Apple TV comes with a nice remote control. It has a touch surface and allows the user to perform gestures such as swipes, taps and clicks. A gyroscope and a motion sensor are great additions to support game play in particular. In your code you can use gesture recognizers to detect swipes and taps and there a couple of ways to detect when various buttons on the control are selected.

The remote communicates using Bluetooth and it has a microphone on board, so you can actually ask Siri about your favorite movie or TV-serie. Unfortunately Siri is not (yet) available in most countries.



tvOS

In order to develop for tvOS you will need to have Xcode 7.1. It comes with support for tvOS and a tvOS Simulator. For your TV app there are basically two approaches that you can think of.

You can create a TV app using Swift or Objective-C. Of course you can also port your existing iOS app or game. UIKit, Core graphics and Spritekit, to name just a few, are all supported. Check out this this list for more information. If you are an iOS developer already you can create a tvOS app in no time.



TVML

Another approach is TVML. It is a new process of making apps with TVML, TVJS and TVML kit.

TVML stands for Television Markup Language and is a form of XML. TVJS is set of JavaScript APIs, which provide you with the means to display apps created with TVML. Finally there is TVMLKit, which is glue between TVML, JavaScript, and a native tvOS application.

There are many, probably familiar looking templates to be found here.


Use xCode 7.1 to create a new tvOS app...

Testflight has been updated to support tvOS app deployment. The Apple TV comes with the Testflight app pre installed.



Before you start it is important to know that tvOS has some limitations, although they are not really as bad as they might look at a first glance. The app size cannot exceed 200Mb and local persistency is not possible at all. To persist data you need to use iCloud, CloudKit, your own backend-service or a mBaaS, like Parse or FireBase.

If you want to share events or data with other users, CloudKit might be a good option. If you want to create a cross-platform app you should consider using a mBaas or creating your own backend.


Android TV

Great, but what about Android TV apps? Android TV runs on Android 5.0 (Lollipop) and above and it offers more or less the same user experience as the Apple TV is doing. Media streaming apps and games are available in the Google Play Store as well.

Android TV can be built into TV's or into stand-alone media players. Hardware manufacturers, such as Sony, Sharp and Philips have or will release TVs, supporting Android TV, in 2015. Their Android TVs comes with features such as voice search and of course the Google Play Store. Android TV does also support ChromeCast, allowing a phone to select and to control media playback on the TV.

Creating an Android TV is as easy as starting Android Studio,creating a new project and selecting TV as project type. If you are an Android developer it is not very different from a common smart phone app. The main difference, as is the case for any app on TV, is the interaction. For example, the TV is not a touch screen. Besides it probably will be too far away too touch anyway.


I will elaborate on Android TV app development later. For now I am in particular interested in what the differences between Apple TV and Android TV are.


Conclusion

I think apps on TV arrived way too late as a lot of people do already no longer just watch what is being broadcasted at a particular moment in time. Instead they watch the things they want to see at the time that is most suitable for them.

Apps on TV can contribute to this new way of watching TV and it could help to integrate second screen apps (voting apps and so on).

When you compare Android TV with Apple TV you see there is not really much difference in user experience. Since Apple TV is being produced by Apple only I expect Apple TV to run more smoothly, but I must admit I have not seen Android TV in reality yet so that is just an assumption, based on experiences with Android and iOS on smartphones. And yeah, both iTunes and Google play offer movies, music, games and series. So, what actually is the difference?

Apple TV comes as a set top box solution only and despite some rumours an Apple TV TV is not going to appear soon. Android TV will be integrated in both set top boxes and TV's. I expect this will result in more people using Android TV.

Altogether interesting stuff to examine. Let's think of some great apps for TV... In the end, the app eco system determines which platform will succeed.

Further reading