What's the best practice for adding Android TV support to an existing smartphone / tablet app?

As I see there are several use cases for Android Studio:

  • Add a new Android TV module and create a generic module to share some of the code, but basically overwrite most of my Android TV code.

  • Add one or more Android TV packages to my existing application code; add developer intent filter Leanback for main Android TV activity and finally do manual code checks. Some of the existing stuff can be reused on Android TV, and some areas will need to be rewritten.

What do you think is the best option?

I personally think that the second option is the best as it is much easier to do, but it has several disadvantages, i.e. larger APK size.

+3


source to share


1 answer


It really suits 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.

EXPANDING A RIGID PROJECT

You can share your codebase and add specific TV classes to your existing project. This allows you to confidently speed up your downloads since you have all the code you need right there. Plus, for the end user , the Play Store entry won't change , so you'll get the same ratings, downloads, visibility, and so on. The disadvantage, in this case, is the risk that your application will become monolithic and therefore harder to manage.

CREATING A NEW MODULE



On the other hand, moving to a separate project "forces" you to write simple modules that (to me) sound like a good thing. You will have a longer bootstrap if your code / project is not modular enough, but it will pay off in the long run . Also, the APK of your TV app will benefit too, as it will be smaller . You will have a different Play Store entry , but that could be a disadvantage as well as a promotion. Finally, I think it is sometimes useful to periodically work on a separate project, so this is a completely subjective plus :)


In my company, we decided to go for a separate project / module. We wanted to modulate some common components, so it was a good time for that. That in itself was a good reason for us, and we did not regret it. We also had the opportunity to experiment with a new project structure that used a bus ( Otto ) and a job queue ( Path ).

In general, it depends on you and your project. I will try to add as many points as I can.

+1


source







All Articles