Reputation: 13242
The way I see it, there are a few options using Android Studio:
Add a new module for Android TV, and create a common module to share some of the code, but mainly re-write most of my code for Android TV.
Add one or more Android TV specific packages in my existing application code; add the Leanback manifest intent filter for the Android TV main Activity, and finally do manual checks in code. Some of the existing stuff can be re-used on Android TV, and some areas will need to be re-written.
What do you think is the best option?
I personally think that the second option is the best, as it's significantly easier to do, but it does have a few disadvantages, i.e. a larger APK size.
Upvotes: 3
Views: 1512
Reputation: 12339
It really goes down to your project, how it is built, how big it is, and so on. In a general sense, each option has its own advantages and disadvantages.
EXTENDING THE SAME PROJECT
You can decide to share your code base and add some TV-specific classes to your existing project. This allows for a faster bootstrap for sure, since you have all the code you need right there. Plus, to the end user, the Play Store entry will not change, so you will benefit from the same ratings, downloads, visibility and so on. The downside, in this case, is the risk of your app becoming monolithic and thus, harder to handle.
CREATING A NEW MODULE
On the other hand, going for a separate project "forces" you to write common modules, which (to me) sounds like a good thing. You will have a longer bootstrap if your code/project is not modular enough, but in the long term it will pay off. Also, the APK of your TV application will benefit too, since it's going to be smaller. You will have a different Play Store entry, but that could be a downside as well as an upside. Finally, I think it feels refreshing to work on a separate project once in a while, so this is a totally subjective plus :)
In my company, we decided to go for a separate project/module. We wanted to modularize some common components, so it felt like the right time to do so. That alone was a good reason for us, and we did not regret it. Also, we had the chance to experiment with a new project structure, which involved using a bus (Otto) and a job queue (Path's).
All in all, it's up to you and to your project. I will try to add as many other points as I can.
Upvotes: 2