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.


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


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.


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

Android Remove .idea Folder from Git

There are many examples of .gitignore files for Android Studio projects, some of them have .idea files in them and others don’t. Let’s figure this out.

What’s the .idea folder?

When using IntelliJ IDE (or another IntelliJ based IDE like Android Studio), the .idea directory contains a set of configuration data. Project settings are stored with each specific project as a set of xml files.

It contains many files and configuration values, it includes assets information, caches, code styles, dictionaries, project type information, workspace settings among many other data.

For more information take a look at this article: Deep dive into .idea folder in Android Studio.

Should the .idea folder be kept under version control?

This is the debate area, this official article states that all files under the .idea directory in the project root except the workspace.xml, usage.statistics.xml and tasks.xml files which store user specific settings should be under version control.

This may be helpful if you are working in a team that needs to be synchronized in terms of IDE configuration or want to share project configuration contained in these files, however, I personally do not like to make my repos IDE-dependent so I prefer not to include the .idea folder in my repos and ignore it from my initial commit, instead I use maven or gradle files to make configuration and dependencies available to everyone.

How to remove the .idea folder from your repo?

So if you have already committed your .idea folder to your repo you can remove it pretty easily.

  1. Add the .idea folder to your .gitignore file in your master branch (You can do this by adding .idea to a new line in your .gitignore file) and commit the change.
    git commit -m "Add .idea folder to .gitignore"
  2. In your current branch, check this file out from master to get the updated file. Skip this step if you’re working in your master branch.
    git checkout master -- .gitignore
  3. Remove the .idea folder from the git tree.
    git rm --cached -r .idea
  4. Commit this change.
    git commit -m "Remove .idea folder from repo"

Your project is now free from the IDE chains.

mel gibson freedom GIF

Posted in Dev

Astrophysics for People in a Hurry

We are stardust brought to life, then empowered by the universe to figure itself out – and we have only just begun.

I’ve been always deeply fascinated with everything that extends beyond our beloved earth out to the universe.

I must say that I had to re read several parts of this book, I forced my little mind in order to grasp some of the magnificent concepts that are presented in this book. It is an introductory book into astrophysics and yet all the chapters are so mind blowing, it’s really hard for your mind to even take a tiny look into the grandiosity of the universe.

I read this review in Goodreads before I bought this book, I found it really funny and I’m agree with it:

Imagine you are standing with your face up and your mouth wide open underneath a waterfall of Skittles.At first, a few Skittles get into your mouth and you can taste them. Awesome, you think. I love Skittles. Then, the Skittles become overwhelming, as more and more try to force themselves in, and millions and millions puddle around your feet, piling up past your knees.


If I were not a software Engineer I would have loved to be an astrophysicist, what I’m left is to continue to be amazed by books like this that present us the immensity of the universe and the tininess of us.