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

Post on 18-Jul-2015

141 views 3 download

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

+GabrieleMariotti@GabMarioPower

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

Droidcon Torino - 9/10 April 2015

How many of you have used open source

libraries in your projects?

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

Droidcon Torino - 9/10 April 2015

Use an open source library

Can you work without them?

Write your custom code

Which are the alternatives?

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

Droidcon Torino - 9/10 April 2015

Some important points:

● Licence

● Maintenance

● Support

● Documentation

● Quality code

Before using a 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?

Droidcon Torino - 9/10 April 2015

What do you know about

the types of licence ??

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

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

Droidcon Torino - 9/10 April 2015

Weak copyleft

● LGPL

● Mozilla Licence

Permissive

● Apache V2

● MIT

● BSD

Licence

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

Droidcon Torino - 9/10 April 2015

Who is the author of this library ??

Droidcon Torino - 9/10 April 2015

Who is maintaining the library ??

● a company ?

● a community ?

● a single developer ?

Maintenance

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

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

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

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

Droidcon Torino - 9/10 April 2015

How can I use the library ??

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

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

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

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

Droidcon Torino - 9/10 April 2015

Integration...

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

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

Droidcon Torino - 9/10 April 2015

Are you ready for….??

Droidcon Torino - 9/10 April 2015

Are you ready for…??

What if a day...

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

Droidcon Torino - 9/10 April 2015

Are you ready for…??

What if a day...

DEPRECATED

Droidcon Torino - 9/10 April 2015

Are you ready to explain to your

customer that a part of the project is no

longer maintained?

Droidcon Torino - 9/10 April 2015

Use an open source library

Can you work without them?

Write your custom code

Which are the alternatives?

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

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

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

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

Droidcon Torino - 9/10 April 2015

A different point of view:

on the other side

Droidcon Torino - 9/10 April 2015

An incredible experience

2 years ago I decided to share a library.

I could not expect this…..

Droidcon Torino - 9/10 April 2015

1. IDEA

Droidcon Torino - 9/10 April 2015

IDEA

● Collect your ideas

● Collect your code

● Collect your examples

Droidcon Torino - 9/10 April 2015

2. CODE

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

Droidcon Torino - 9/10 April 2015

3. PUBLISH

Droidcon Torino - 9/10 April 2015

PUBLISH

Brace yourself…

● Post a blog

● Publish a demo in Google Play

● Try to share your project

Droidcon Torino - 9/10 April 2015

4. SURPRISED

Droidcon Torino - 9/10 April 2015

SURPRISED

OMG…

● Emails

● Pull requests

● Issues

● Messages

Droidcon Torino - 9/10 April 2015

FINAL STEP…..

Droidcon Torino - 9/10 April 2015

Are you ready for…??

Now I can understand why I can find...

DEPRECATED

+GabrieleMariotti@GabMarioPower

Thank you!