Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Droidcon IT 2015: Can you work without open sou...

Droidcon IT 2015: Can you work without open source libraries?

Every Android developer uses Open Source libraries.
Android has a large ecosystem of libraries that developers can freely use in their own apps, but before to choose to use a library, you should know some important points about the open source development.

This sessions will introduce how to evaluate a library and how to get started the incredible experience to write an Open Source.

Gabriele Mariotti

April 10, 2015
Tweet

More Decks by Gabriele Mariotti

Other Decks in Technology

Transcript

  1. Droidcon Torino - 9/10 April 2015 Gabriele Mariotti Mobile Project

    Manager at Namirial S.p.A. Android Developer Community Lead at GDG Ancona
  2. Droidcon Torino - 9/10 April 2015 How many of you

    have used open source libraries in your projects?
  3. Droidcon Torino - 9/10 April 2015 Can you work without

    them? Picasso Retrofit Universal-Image-Loader Crouton Ion AndroidStaggeredGrid Cupboard OkHttp EventBus ListViewAnimations SwipeListView Dagger ButterKnife Otto ShowCaseView PhotoView SmoothProgressBar StickyListHeaders TwoWayView PagerSlidingTabStrip GoogleProgressBar Teleport Cardslib Material Dialogs
  4. Droidcon Torino - 9/10 April 2015 Use an open source

    library Can you work without them? Write your custom code Which are the alternatives?
  5. Droidcon Torino - 9/10 April 2015 • Never choose the

    first library • Read the licence • Read the readme • Pay attention to some points Before using open source libraries
  6. Droidcon Torino - 9/10 April 2015 Some important points: •

    Licence • Maintenance • Support • Documentation • Quality code Before using a open source libraries
  7. Droidcon Torino - 9/10 April 2015 Open source != Free

    • Open source doesn’t mean you're free to do anything you want with the library • you have to respect the license What is open source?
  8. Droidcon Torino - 9/10 April 2015 Can I use it

    ??? • Check the licence under which the library is released • Check if the licence is compatible with your project • Pay attention to legal issues Licence
  9. Droidcon Torino - 9/10 April 2015 Strong copyleft • GNU

    GPL It is a reciprocal licence VIRAL licence. Are you ready to release your product under GPL licence? Licence
  10. Droidcon Torino - 9/10 April 2015 Weak copyleft • LGPL

    • Mozilla Licence Permissive • Apache V2 • MIT • BSD Licence
  11. Droidcon Torino - 9/10 April 2015 Telegram+ was removed from

    Google Play for: Violation of the intellectual property and impersonation or deceptive behavior “Telegram is open source. What’s wrong with a third party app based on that source? ” Type of licence Telegram Telegram is licensed under the GPLv2+. This means you’re free to do pretty much whatever you want with the source code, as long as you make it available to anyone who asks (you can make it public accessible for everyone, or include a written offer to make the source code available any user who requests it). A recent history
  12. Droidcon Torino - 9/10 April 2015 Who is maintaining the

    library ?? • a company ? • a community ? • a single developer ? Maintenance
  13. Droidcon Torino - 9/10 April 2015 Is this library still

    alive ?? • Check the last commits in the repository. If the last commit was 1 year ago likely the project has been abandoned (or it is complete and doesn't require updates...). • Check how often the project is updated (or was updated). Maintenance
  14. Droidcon Torino - 9/10 April 2015 Do not underestimate this

    point. If you use a library which is no longer maintained, you could have problems in the future. Maintenance
  15. Droidcon Torino - 9/10 April 2015 Can someone help me….?

    • Evaluate what kind of support you can find using it. • Popular libraries have a tag (and a lot of posts) on stackoverflow • Popular libraries have a G+ community or a very good issues section where to find a lot of comments and posts. Support
  16. Droidcon Torino - 9/10 April 2015 Is someone fixing the

    issues….? • Check how many issues are open • Check how many issues were closed If you find 300 issues open and 1 issue closed is not a good evidence Issues
  17. Droidcon Torino - 9/10 April 2015 You can’t use a

    library without documentation! Check if the library provides: • Doc section • Wiki section • A good Readme file Doc & Wiki
  18. Droidcon Torino - 9/10 April 2015 Check if the library

    provides: • demo sources • examples • a demo in Google Play Often a demo is the best way to see the features and it capabilities Demo & examples
  19. Droidcon Torino - 9/10 April 2015 The existence of unit

    tests is a good indicator of a serious project • Few libraries have unit tests • Unit tests requires time • Unit test are very very important Unit tests
  20. Droidcon Torino - 9/10 April 2015 Is it good? •

    Spend a few hours to browse the code • Check how it is written • Check if the authors use comments, javadoc, clean code.. Code quality
  21. Droidcon Torino - 9/10 April 2015 • Does this library

    provide a Gradle support ?? Do not hesitate to open an issue to ask the author to push an aar on maven. Central Maven or jcenter
  22. Droidcon Torino - 9/10 April 2015 What is Travis CI?

    Travis CI is a hosted continuos integration and deployment system. Some libraries are beginning to have this integration. Travis CI
  23. Droidcon Torino - 9/10 April 2015 Are you ready for…??

    What if a day... PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED
  24. Droidcon Torino - 9/10 April 2015 Are you ready to

    explain to your customer that a part of the project is no longer maintained?
  25. Droidcon Torino - 9/10 April 2015 Use an open source

    library Can you work without them? Write your custom code Which are the alternatives?
  26. Droidcon Torino - 9/10 April 2015 Write your custom code:

    • Do you really need this code? • Don’t reinvent the wheel • Can you obtain the same result in a short time? • Is it so easy to build this code? Before writing a custom code
  27. Droidcon Torino - 9/10 April 2015 PRO: • Own code

    • Without licence or royalities costs • You can easily add a new feature Before writing a custom code
  28. Droidcon Torino - 9/10 April 2015 CON: • It can

    requires a lot of time • It can requires an extra budget Before writing a custom code
  29. Droidcon Torino - 9/10 April 2015 Use an open source

    library Can you work without them? Write your custom code It could be not so simple
  30. Droidcon Torino - 9/10 April 2015 An incredible experience 2

    years ago I decided to share a library. I could not expect this…..
  31. Droidcon Torino - 9/10 April 2015 IDEA • Collect your

    ideas • Collect your code • Collect your examples
  32. Droidcon Torino - 9/10 April 2015 CODE Writing for others

    is different from writing for themselves • Make abstractions • Write comments • Write javadoc • Write in a clean way
  33. Droidcon Torino - 9/10 April 2015 PUBLISH Brace yourself… •

    Post a blog • Publish a demo in Google Play • Try to share your project
  34. Droidcon Torino - 9/10 April 2015 SURPRISED OMG… • Emails

    • Pull requests • Issues • Messages
  35. Droidcon Torino - 9/10 April 2015 Are you ready for…??

    Now I can understand why I can find... DEPRECATED