Image for post
Image for post

Hi there, what’s up?

So, I’ve just started to solve the Hacker Rank problems and I decided to share with you guys how I did solve each one of them. The language I chose is Swift, but I believe you can read it and find a way to implement the solution in your own language!

This is the function we need to use:

First of all, we need to make sure the amount of items within the array is between 1 and 100, so I checked « n »:

I could have used ar.count, but I just wanted…


Ionic Sip #001

Image for post
Image for post

Hello guys! Today I’m going to show you how to create your own Ionicons with the brand new Ionic 4. If you’ve been coding Ionic for quite a long time, chances are you’ve already needed to create your own custom Icons — I’ve done that myself and it’s quite a pain. Good news is how easily this can be done now, so get your poison and come along!

1- Get an SVG file:

In order to create your own Ionicon, you have to use an SVG file with the image you want.

2- Place your SVG into…


Android Sip #003

Image for post
Image for post

Hello guys! Today I’m going to show you how to share simple text to other apps, like email or whatsapp. This isn’t actually new stuff but I thought it a good idea to have it revisited. That being said, get your poison and come along!

1- Create the sharing function:

private void share(){     String string = “Place here” + “the text you want.”;     Intent intent = new Intent(android.content.Intent.ACTION_SEND);     intent.setType(“text/plain”);     intent.putExtra(android.content.Intent.EXTRA_TEXT, string);     startActivity(Intent.createChooser(intent,”Share via”));}

First you create a string with the text you want to share. Then, you create an Intent, set the type and the text…


iOS Sip #002

Image for post
Image for post

Hello guys, what’s up! Today I want to show you a very cool swift function: Filter. If you — just like me — have been coding around since the first days of internet, it’s big the chance that you still do something like:

let strArray = [“swift”, “ruby”, “java”, “php”]var filtered = [String]()for item in strArray {    if item == “swift” {        filtered.append(item)    }}print(filtered) //[‘swift’]

Though that works just fine, if you use Filter your life might get waaaay better, look:

let strArray = [“swift”, “ruby”, “java”, “php”]var filtered = strArray.filter{ $0 == “java”}print(filtered) //["java"]

Not to mention the code above is much more elegant, isn’t it? And that’s all folks! Thanks for reading, see you next coffee break.


Image for post
Image for post
SCLAlertView examples

Mobile Café #003 — iOS: How to create beautiful Alert Views

iOS Sip #001

Hello guys! Today I’m going to show you one of my favorite cocoa pods which is SCLAlertView. As you might have realized, it is a lib to create beautiful alert views with much less work than usual. In fact, all you need is a few lines of code. So, get your poison and come along!

1- Open your pod file and add:

pod ‘SCLAlertView’

*if you don’t know how to use cocoapods, check out this nice tutorial by Ray Wenderlich.

2- Import SCLAlertView in your view…


Android Sip #002

Image for post
Image for post

Hello guys! Today I’m going to show you how to check internet connection by pinging a website. It is important to mention that this method is good because sometimes you actually do have a NETWORK connection, but not an INTERNET connection, like when you are at Starbucks and have no code to use their wifi. That being said, get your poison and come along!

1- Paste the following code in your Activity:

public boolean isConnected() throws InterruptedException, IOException {String command = "ping -c 1 google.com";return (Runtime.getRuntime().exec (command).waitFor() == 0);}

The chunk of code above…


-Android Sip-

Image for post
Image for post

Hello guys! Today I’m going to show you how to compile “.jar” libraries with Gradle. Get your poison and come along!

1- Copy and paste your “.jar” file within the libs folder, which is placed in the “app” directory.

2- Open the module build.gradle file (also placed in the “app” directory).

3- Paste the following code within the “dependencies” section:

implementation fileTree(dir: ‘libs’, include: [‘*.jar’])

4- Sync Gradle.

And that’s all! Now you should be able to import the classes from your brand new library!

Thanks for reading, see you next coffee break!

Robson Ribeiro

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store