I agree. Having direct access to ioio_ is not a problem IMO. The main issues making it difficult to consume were the library nesting, and the Log implementation.
Mark. On Wed Jan 21 2015 at 00:20:22 Ytai Ben-Tsvi <[email protected]> wrote: > Thanos, > Your proposed library structure makes a lot of sense. Would you be willing > to: > > 1. Squash these changes into a single commit and send a pull-request. > 2. Once merged, follow up on updating the relevant wiki pages. > > Regarding the API change of the looper, there is a problem with the > approach you took, which is breaking compatibility with existing apps. In > other words, if users upgrade the library, their existing code will break. > Since all that's required by the framework is a valid implementation of > IOIOLooper, then instead of modifying BaseIOIOLooper, you can add something > like BaseIOIOLooperAlt with whatever contract you prefer for your subclass, > where BaseIOIOLooperAlt either extends BaseIOIOLooper or not. Then, users > would be able to use one or the other. Personally, I don't see much added > value in this approach. Having direct access to the ioio_ member is often > useful in that it saves having to pass it around to utility methods, when > the logic becomes too complicated to fit in loop(). > > Thanks for doing that! > > On Tue, Jan 20, 2015 at 7:54 AM, Thanos Fisherman <[email protected]> > wrote: > >> Thats great to hear :) Eventually I will try to write some gradle stuff >> and make the libraries ready to be pussed to maven central (unless someone >> else does it first). Cause it's really handy to just use those libs in your >> projects with a few lines of code and let gradle do all the dirty job >> instead of including them by hand in android studio and make your project >> "polluted" with all those library projects >> >> Hi Thanos, >>> >>> This is almost exactly what I did when trying to get Android Studio to >>> work, so I can validate that these changes make sense to more than just >>> you. :) >>> >>> Regards, >>> Mark. >>> >>> On Tue Jan 20 2015 at 7:29:34 AM Thanos Fisherman <[email protected]> >>> wrote: >>> >>>> Hello ioioers I've made a few refactorings to ioio libs (At Software >>>> directory) Hopefully trying to make them more intuitive (to me) >>>> >>>> BUT First Let me explain what I did. >>>> It took me a while to realize I had to copy the ioio libs from >>>> /IOIOLib/src/ioio/lib to either /IOIOLib/target/android or >>>> /IOIOLib/target/pc >>>> Then I realized they were linked via src_commons but I didn't quite >>>> like the project structure. >>>> So I moved src_commons to a seperate java project IOIOCoreLib so that >>>> both android and desktop backends can extend from it. >>>> >>>> I also made a unified Logger class that can be used across all >>>> subsystems. When on android it will print on logcat and When on desktop it >>>> will print on console using println >>>> so now I think the project structure is more organized and ready to be >>>> ported to android studio later on. So That's pretty much how the project >>>> structure is: >>>> >>>> >>>> IOIOCoreLib >>>> / \ >>>> / \ >>>> IOIOLibPC IOIOLibAndroid >>>> / | \ >>>> / | \ >>>> / | \ >>>> / | >>>> \ >>>> IOIOLIbAccessory IOIOLibBT IOIOLibDevice >>>> >>>> >>>> I've also removed the ioio_ protected field and put it as an argument >>>> in ioio event methods. So now the BaseIOIOLooper methods look like this: >>>> >>>> public void setup(IOIO ioio) throws ConnectionLostException, >>>> InterruptedException {} >>>> >>>> @Override >>>> public void loop(IOIO ioio) throws ConnectionLostException, >>>> InterruptedException {} >>>> >>>> @Override >>>> public void disconnected(IOIO ioio) {} >>>> >>>> >>>> I updated the HelloIOIO and HelloIOIOSwing examples so that you can >>>> check them out. You can find the changes here >>>> <https://github.com/ThanosFisherman/ioio.git> >>>> I just hope it makes sense to you as much as it makes to me >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "ioio-users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/ioio-users. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "ioio-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/ioio-users. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "ioio-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/ioio-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "ioio-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/ioio-users. For more options, visit https://groups.google.com/d/optout.
