Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
ioan
Level 8

Re: What it the best way to share source with global functions between projects?

"EnTerr" wrote:
"ioan" wrote:
I need to share code between multiple channels, between the Pro version and Basic version. Right now I copied my global brs file in both channels and make all modifications twice and I'm hoping that there is a better way to share global functions between channels. 

Can i propose a very simple solution to your very specific problem, which avoids tackling at all sharing of sources between projects? Smiley Wink
Have only 1 channel source!

No, just wait a minute - hear me out: since your Basic version is a subset of the Pro version, build from a single codebase - moreover build a single app, once - then upload to 2 channels. But how will they differentiate? Quite simple - when started, query what's the channel# - roAppInfo.getID() - and based on that tune up the behavior (i.e. act as Pro or Basic). Say if the # is that of the Basic channel, then disable some features, maybe tweak some messages - otherwise (i.e. side-loaded or Pro), have the full functionality. Reminder, the channel name and thumbnails are specified in the dev.portal (outside of the app bundle).

That is actually a great idea! I have a question though, considering that one of the differences between the channels is the screensaver, how would I completely remove it from the basic with "if"s? 
https://github.com/e1ioan/
http://rokucam.com
0 Kudos
EnTerr
Level 9

Re: What it the best way to share source with global functions between projects?

"ioan" wrote:
That is actually a great idea! I have a question though, considering that one of the differences between the channels is the screensaver, how would I completely remove it from the basic with "if"s? 

Well, there is a limitation to my idea. You can't outright remove SS functionality. You can cripple it... like have the SS only work for a few minutes and exit - or plaster a semi-transparent (ad?) banner on top of the video
0 Kudos
ioan
Level 8

Re: What it the best way to share source with global functions between projects?

"EnTerr" wrote:
or plaster a semi-transparent (ad?) banner on top of the video


That gives me an idea. I could make it an "in channel product" for the basic. Same with extra cameras.
https://github.com/e1ioan/
http://rokucam.com
0 Kudos
EnTerr
Level 9

Re: What it the best way to share source with global functions between projects?

"ioan" wrote:
That gives me an idea. I could make it an "in channel product" for the basic. Same with extra cameras.

Yes. Fair warning though - the in-app purchases API is not exactly in great shape (https://forums.roku.com/viewtopic.php?f=34&t=95592), you may find out it takes way too much effort making it work at the end.
0 Kudos