My History with Open Source

About 6 years ago, at the university where I got my Software Engineering degree, a professor gave my class this advice:

Open a GitHub account, if you don’t have one yet, and start contributing to open source projects.

Then he told us about all the wonders of Open Source and how, thanks to his own contributions, he got an amazing job at a fast-growing startup, Xamarin.

The truth is I didn’t follow this advice. I was just to “busy”, I was already working part-time in a cool startup, I was focused on concluding my degree, and, as hard as it is to accept it, my ego kept me from contributing by convincing myself I was working on very important and innovative stuff, my bright future was waiting and I didn’t have time for Open Source.

aint nobody got time for that GIF

Since then, Open Source has been in my mind, I took some reality punches, I stepped  down my cloud and realized how much I didn’t know, how much there was to learn, I changed my perspective and realized that Open Source was a world of possibilities for me, endless opportunities to learn from people all around the world while contributing to projects you believe in.

More and more, the urge to contributed continued to grow, I started looking projects for a possible first contribution for a LONG time, sometimes feeling encouraged, other times a bit scared about not being good enough, and finally last year, I tear down the fears and insecurities that were keeping me from contributing and I made my first tiny open source contribution. It felt great!

Right now I’m actively contributing to a few projects and I’ve open sourced some personal projects. The truth is I wish I’d started when I first received my professor’s advice but better now than never, right?

This is how my GitHub profile looks right now, I’m committed to seeing it a lot more greener a year from now and the truth is I can’t feel more excited about the places where Open Source will take me.

github-contributions

Posted in Dev

How to Make your First Open Source Contribution

I believe that contributing to an open source project is essential for any developer, contributing is very rewarding and it brings many benefits for you as a developer.

  • Improve your skills
  • Find mentors and teach others
  • Grow your career
  • Learn
  • Impact

These are just a few of the perks and I’ll not go deeper into the benefits of contributing to open source projects, I assume that anyone who’s reading this article is aware of them and is trying to make a contribution.

The truth is that it took me a long time to make my first contribution, far more I’d have liked to, I’ve been aware of Open Source for a long time and been wanting to contribute for almost a year. I know, contributing to open source can be intimidating and daunting so I’d like to share my experience and this little guide so many developers take the step earlier, overcome this fears and get started in the amazing world of Open Source.

afraid the phantom menace GIF by Star Wars

This guide is intended for developers looking to contribute code but remember that code is just one of many ways you can contribute to open source projects.

The Basics

Before anything I recommend to cover a few basic concepts you’ll need to make your first contribution, I’m talking about the basic steps to make a contribution.

  • Fork the repository, clone it and set up your environment.
  • Create a branch for your edits.
  • Code and test.
  • Provide documentation of your contribution.
  • Submit a Pull Request

I understand this process can be overwhelming, especially if you haven’t done it before but there are plenty of tutorials and guides about this online.

Here’s a great GitHub repository, First Contributions, which guides you through the full process, and gives you the opportunity to apply it in a practice environment. It is very well documented and very easy to follow, it will help you gain the confidence you’ll need for the real deal.

Pick a Project

Ok, now you need to find a project you’d like to contribute to, I believe it’s important to select a project you genuinely are interested in, it’s a huge satisfaction to be able to contribute to a mission you believe in.

There are plenty of Open Source projects of many kinds so take your time and start looking, I’m pretty sure you are already using an open source project in your daily life and I think this is one of the best options since you’ll surely already know the project and are familiar with the mission of it.

Here are a few resources where you can explore open source projects.

In my personal experience I choose Simplenote for Android, Simplenote is the simplest way to take notes, a light, clean and free available for iOS, Android, Mac, Windows, Linux and the web supported by Automattic.

Pick One Issue

Now you need to find a bug/feature where you can help and you’ll need patience for this, most probably you’ll not find the perfect easy but meaningful bug/feature waiting for you, be prepared to spend some time reading through the bugs/features available, getting to know the problems and making sure you’ll be able to help.

Some repos make this task easier by using some tags for you to identify which issues could be a good fit like help wanted and good first issue.

Get the Context

Based on my experience you may be in need of additional information in order to be able to fix the issue you selected. Don’t be afraid to ask but be patient, many projects have official communication channels so be sure to search for this in the repository docs. I’m pretty sure current contributors will be happy to help you.

Contribute

Now, you’re all set to hack the project and contribute, once you’ve finished you’ll need to open your Pull Request and follow it closely until it is merged and closed.

Most probably you’ll receive comments and requests, don’t feel bad about them, that’s the magic of open source, you’ll learn and discuss the best way to do things and hopefully after a little back and forth your code will be merged and shipped into the next release.

Posted in Dev

Android Services with Kotlin

An Android Service, is an application component that can perform long-running operations in the background, and it doesn’t provide a user interface.

A few example uses for a service could be:

  • Network transactions
  • Play music
  • Perform file I/O operations
  • Interact with content providers
  • Background operations

I’ve recently implemented a service in one of my applications to start a sound triggered by a BroadcastReceiver when an alarm expires and here is how I implemented it with Kotlin.

AlarmService.kt

Then, this is how it’s started from the BroadcastReceiver.

TimerExpiredReceiver.kt

Finally don’t forget to add your reference to your app’s manifest file.

By using this service I’m able to stop it from anywhere within the application and stop the alarm sound when the user interacts with my app by calling stopService().

I implemented this functionality in PowerNap, an app that will help you take efficient naps by controlling the time you sleep. You can find the source code in GitHub.

Posted in Dev