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.

Las Batallas en el Desierto

Voy a guardar intacto el recuerdo de este instante porque todo lo que existe ahora mismo nunca volverá a ser igual.

I am going to keep my memory of this moment intact because everything that now exists will never be the same again.

This book was a required read for me when I was in high school and I’ve just read it again. It was good to remember those old days and reconnect with the main character of this story, a young Mexican boy who is dealing with an impossible love and the absurdity of the ruled by adults world that surrounds him.

And, here’s a great song based on this book from one of my favorite bands.

 

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

App removed from Google Play: Android Advertising ID

I’ve received a Google Play Support email telling me that one of my apps has been removed from Google Play.

scared bruce lee GIF

This happened because my app is using the Android Advertising ID.

The Android Advertising ID is a user-specific, unique, resettable ID for advertising, provided by Google Play services. It gives users better control and provides developers with a simple, standard system to continue to monetize your apps. It is an anonymous identifier for advertising purposes and enables users to reset their identifier or opt out of interest-based ads within Google Play apps.

Irresponsible me didn’t pay attention at the Google terms which state that all apps that use the Android Advertising ID, must provide a valid privacy policy in both the designated field in the Play Console, and from within the app.

If you just received this message for one of your apps, DON’T PANIC, I solved this problem very easily for my apps and here’s how I did it.

1. Get a valid Privacy Policy

Of course you can contact your legal expert to create a valid Privacy Policy specifically for your app but you may also use a generic generated Privacy Policy if it suits your needs.

I used this simple web app, Privacy Policy Generator. It allows you to set a few settings accordingly to the information of your app and the features and services it uses and it generates a Privacy Policy right away which you can download in text, HTML or markdown.

2. Made your Privacy Policy accessible

Now you have to make sure that your new Privacy Policy is accessible to everyone, there are a few options to do this:

  • Your own website. If you already have a website I’ll recommend this option, just create a new page where you can host the HTML file or the text and you’re all set.
  • GitHub Pages. Use the simple platform offered by GitHub to host your Privacy Policy.
  • Any blog platform. Use any blog platform you prefer, there are some that are free where you can host your Privacy Policy and make it accessible.

Regardless of the method you prefer, once you have the public URL of your Privacy Policy you are ready to continue.

3. Set the URL in your Google Play Console

Go to your Google Play Console, select your unpublished application and go to Store presence > Store listing in the sidebar. Scroll to the bottom and there you should find the designated field to specify the Privacy Policy of your app. Set the public URL of your newly created Privacy Policy.

google-play-console-privacy-field

4. Integrate your Privacy Policy within your app

Now you need to make your Privacy Policy accessible from within your app, there are a few options to do this:

  • Integrate your Privacy Policy information into your app and make it accessible through a designated view integrated into your app’s navigation.
  • Load your accessible Privacy Policy within your app.
  • Add a link which opens your Privacy Policy in the device browser.

5. Publish your new .apk

Finally, package and ship your new apk and after a few days, your app should be published again.

best gif thumbs up GIF

Posted in Dev