Droidcon Italy 2015: can you work without open source libraries?

49
+GabrieleMariotti @GabMarioPower Can you work without open source libraries?

Transcript of Droidcon Italy 2015: can you work without open source libraries?

Page 1: Droidcon Italy 2015: can you work without open source libraries?

+GabrieleMariotti@GabMarioPower

Can you work without open source libraries?

Page 2: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Gabriele Mariotti

Mobile Project Manager at Namirial S.p.A.

Android Developer

Community Lead at GDG Ancona

Page 3: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

How many of you have used open source

libraries in your projects?

Page 4: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Can you work without them?Pica

sso

Retrofit

Universal-Image-Loader

Crouton

Ion

AndroidStaggeredGrid

CupboardOkHttp

EventBus

ListViewAnimationsSwipeListView

Dagger

ButterKnife

Otto

ShowCaseViewPhotoView

SmoothProgressBarStickyListHeaders

TwoWayView

PagerSlidingTabStrip

GoogleProgressBar

Teleport

CardslibMaterial Dialogs

Page 5: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Use an open source library

Can you work without them?

Write your custom code

Which are the alternatives?

Page 6: Droidcon Italy 2015: can you work without open source libraries?

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

Page 7: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Some important points:

● Licence

● Maintenance

● Support

● Documentation

● Quality code

Before using a open source libraries

Page 8: Droidcon Italy 2015: can you work without open source libraries?

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?

Page 9: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

What do you know about

the types of licence ??

Page 10: Droidcon Italy 2015: can you work without open source libraries?

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

Page 11: Droidcon Italy 2015: can you work without open source libraries?

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

Page 12: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Weak copyleft

● LGPL

● Mozilla Licence

Permissive

● Apache V2

● MIT

● BSD

Licence

Page 13: Droidcon Italy 2015: can you work without open source libraries?

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 TelegramTelegram 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

Page 14: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Who is the author of this library ??

Page 15: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Who is maintaining the library ??

● a company ?

● a community ?

● a single developer ?

Maintenance

Page 16: Droidcon Italy 2015: can you work without open source libraries?

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

Page 17: Droidcon Italy 2015: can you work without open source libraries?

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

Page 18: Droidcon Italy 2015: can you work without open source libraries?

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

Page 19: Droidcon Italy 2015: can you work without open source libraries?

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

Page 20: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

How can I use the library ??

Page 21: Droidcon Italy 2015: can you work without open source libraries?

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

Page 22: Droidcon Italy 2015: can you work without open source libraries?

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

Page 23: Droidcon Italy 2015: can you work without open source libraries?

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

Page 24: Droidcon Italy 2015: can you work without open source libraries?

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

Page 25: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Integration...

Page 26: Droidcon Italy 2015: can you work without open source libraries?

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

Page 27: Droidcon Italy 2015: can you work without open source libraries?

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

Page 28: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Are you ready for….??

Page 29: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Are you ready for…??

What if a day...

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

Page 30: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Are you ready for…??

What if a day...

DEPRECATED

Page 31: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Are you ready to explain to your

customer that a part of the project is no

longer maintained?

Page 32: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Use an open source library

Can you work without them?

Write your custom code

Which are the alternatives?

Page 33: Droidcon Italy 2015: can you work without open source libraries?

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

Page 34: Droidcon Italy 2015: can you work without open source libraries?

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

Page 35: Droidcon Italy 2015: can you work without open source libraries?

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

Page 36: Droidcon Italy 2015: can you work without open source libraries?

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

Page 37: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

A different point of view:

on the other side

Page 38: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

An incredible experience

2 years ago I decided to share a library.

I could not expect this…..

Page 39: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

1. IDEA

Page 40: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

IDEA

● Collect your ideas

● Collect your code

● Collect your examples

Page 41: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

2. CODE

Page 42: Droidcon Italy 2015: can you work without open source libraries?

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

Page 43: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

3. PUBLISH

Page 44: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

PUBLISH

Brace yourself…

● Post a blog

● Publish a demo in Google Play

● Try to share your project

Page 45: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

4. SURPRISED

Page 46: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

SURPRISED

OMG…

● Emails

● Pull requests

● Issues

● Messages

Page 47: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

FINAL STEP…..

Page 48: Droidcon Italy 2015: can you work without open source libraries?

Droidcon Torino - 9/10 April 2015

Are you ready for…??

Now I can understand why I can find...

DEPRECATED

Page 49: Droidcon Italy 2015: can you work without open source libraries?

+GabrieleMariotti@GabMarioPower

Thank you!