Connect

I’ve worked on some fairly large internationalized apps (50MM+ installs on each app) and on each app I’ve always had a problem with internationalization. It presents its own set of challenges. If you have not internationalized an app before you’ll quickly realize that your app design may not fit various locales – especially when text widgets are horizontally adjacent to each other. The text will eventually overlap or just look wonky and this can create odd UI bugs. You’ll find this out during testing, or as in my experience, when someone reports an odd text widget is overlapping another part of the UI. Finding these issues usually resulted in having your QA team go through each screen in the app to visually inspect the app for each locale. An optimal solution would be to visualize all of the different screens in the different locales so that it would be easy to inspect. Unfortunately that, solution did not exist …

While there is no silver bullet for this situation, there is a new tool that can help with this process (which also has ancillary uses as well).

I recently had the honor to work with the Fabric team – the same trusted team who brought us the Crashlytics tool that we all rely on. They were looking for some feedback on a new open source tool called screengrab. I got to try it out, and after some setup, I had an “Aha!” moment that made me want the tool immediately. It’s a tool that any pragmatic Android developer should evaluate as a possible candidate for their Android development toolbox – especially if your app is internationalized.

Let me explain why …

What is screengrab and why should I care?

Put simply, it is a command line tool that helps you take screenshots of your application at desired execution points in your functional android tests (Espresso) … in any locale.

A screenshot tool? Really? Any Locale? Why Should I care about that?

Therein lies the magic …

One thing you notice during the localization effort is that during design and development strings that fit in one language (English for me) do not necessarily translate well to other languages. Meaning that a five-letter word in English may translate to a twenty letter word in another language.

This is problematic when you are dealing with horizontal space. Longer text entries will overflow onto other widgets and you’ll have a problem.

As stated above, you often don’t realize it until it’s too late because manually testing your application on various locales is difficult and extremely time intensive.

How Does screengrab Help?

The screengrab tool will help automate the process of visually inspecting the various locale output of your app. You can configure screengrab to load up different locales, run all the UI tests and take screenshots during the execution of the test on various devices and configurations at the same time … and then ….

Screengrab will output all of the screenshot files for each locale for you. You can then use those files to quickly visually inspect if there are in fact visual problems with your application and locales.

Simply scroll through the files and check to see if anything is broken.

This can result in huge time savings when you make a feature change, add a new screen, etc.

How Do I Install It and Use it?

As usual, the Fabric team is making this as easy as possible. It’s one file to setup after the installation that anyone on your team can run once it’s checked into github (setup once, setup everyone forever).

Once installed you can start taking screenshots in your tests with the following Screengrab.screenshot(“screenshot_name”);

The above code is a jUnit 4 test that allows you to take a screenshot before an action with a the tag “before_button_click”. This tag will show up on the screenshot so you can trace the execution of your test and screenshots.

Then we click on a button, then take another screenshot.

Almost done …

Configuring Various Locales

Now, lets assume you have mulitpe locales and you want to test those various locales and see the screenshot results. To do that you’ll need to provide some configuration values in the screengrabfile.

The screengrabfile was generated when you installed screengrab. You’ll want to add the following information to the screengrab file:

What else can I use this for?

It’s fairly new for Android, so if you haven’t heard about it I totally get it. Here’s a quick synopsis – fastlane lets you, as a developer or release manager, automate your deployment pipeline. From integrating with continuous integration taking screenshots, to placing them into device frames (currently iOS only though, hopefully Android soon! Hint Hint Fabric team!), to upload the files to Google Play automatically. Fastlane helps you automate the deployment process of your Android apps. Check out fastlane for more detailed info.

The screengrab tool has a few additional use cases:

Design/Product Manager Review

Keep your product and design teams up to date with all of the screens in your application on a per build basis.

Automate Screenshots for release

Automate Screenshot automation for internal dog fooding and review processing with other tools.

… and of course, to validate what might have gone wrong during a test.

Does this replace my other screen capture tooling?

No, screengrab complements the existing toolchain that is out there. If you need/want to use your other solutions, feel free to keep using it. Screengrab is just another tool in your toolbox.

Pragmatic Development Tooling

I’m very pragmatic in my day to day development. When I do internationalize my next app (which I’m actually doing in the next month or two) I will be reaching for screengrab as the tool to help sanity check my work.

Why?

It’s simple. It’s easy. It helps me solve a problem and it gets out of my way. I don’t need to write the tool myself. It just works.

As with anything new, it has a purpose and it now occupies a space in my toolbox. Maybe it will help you save some time too.

I learned one simple thing years ago that helped me more than I think anything else I’ve learned in awhile.

What is it?

You can’t make everyone happy.

I’ve tried. It just doesn’t work.

When you do try to make everyone happy you eventually end up feeling defeated and burned out. At the end of the day you’ve wasted part of your life on trying to please people who do not want to be pleased.

I eventually learned to accept what I call the rule of thirds. I’m not the first one to come up with this, but it is very useful so I thought I’d share it here.

The Rule of Thirds

The rule of thirds is a mental system which you can apply to your day to day life to help alleviate the mental load of worrying about making everyone happy.

The rule of thirds is as follows …When you create something in life (a business, products, a presentation, public speaking, an idea, something at work, etc – it doesn’t matter .. its anything) people are going to react in one of three ways:

1/3 of people are going to be positive about it

1/3 of people are going to be indifferent about it

1/3 of people are going to be negative about it

As soon as you realize that this is the way the world works, the easier things become.

Give a presentation on XYZ Topic at your local MeetUp? Most may like it, some may hate it, and some are indifferent.

You can’t make everyone happy … and that’s ok.

Thats why this world is great. We all have different opinions, emotions and things we enjoy. Everyone is unique.

So the next time someone trolls you online about something you’ve done, just realize what bucket they’re in and move on with your life. Don’t let it disrupt your day.

What do all of things have in common?

They’re all on-demand.

We live in a world where we can now determine when and where we will reply to a text message or email. We get to watch what we want to watch when we want to watch it. We get to usher a cab/ride when we need to go somewhere at any point in the day. We get to listen to the music that we want to listen to when we want to listen to it. We get to learn what we want to learn when we want to learn it.

Many industries are getting disrupted by the on-demand economy.

Radio has been changing for years

Radio is ineffective because it’s live. I can only listen to what is on, right now, pre-programmed by someone who has tastes that are marginally similar to mine.

Don’t like a song?

Too bad. Listen to it.

Don’t like this ad?

Too bad. Listen to it.

Podcasts Are On-Demand Radio

That’s all there is to it. They’re on-demand radio that give you the ability to fast forward, rewind, save for later, etc.

Can’t listen to it now?

No problem. Listen to it later when you have time.

Can’t listen to the whole show?

No problem. Listen to the rest when you have time.

Miss something?

No problem. Hit rewind and listen to it again.

This is one of the reasons why Howard Stern remains a powerhouse on Sirius/XM. Though his show is not a podcast it is consistently replayed all day and through his off time during the weeekends/etc. If fans miss a show, they can tune in and catch it any time of the day. Without this, his show would be far less popular, IMO. Unfortunately not everyone can listen to it at any time they want but this consitent replay exposes his show as an on-demand show. Listeners listen during the day when they have time.

This is exactly why podcasts are becoming popular.

Podcasts are On-Demand Radio.

Download it and listen to it when you have time. Today. Tomorrow. Next week. Whenever.

That is why Podcasts are becoming popular.

If you’re an Android Developer/Mobile Developer you might like my podcast – Fragmented. Its a podcast about Android Development that I host with Kaushik Gopal.

Read REMOTE by Jason Fried and DHH

Alot of what I say is regurgitated in the book above. When I listened to the book years ago I thought to myself “Whoa, OMG, these guys think the same way I do … I’m NOT ALONE!!!!” – so I’ve been recommending it for ages.

Stick to a Schedule

Schedule. Schedule. Schedule. Stick to a schedule when starting out. It will save you.

I get up at the same time every day, just like if I had a on-site job. I take a shower, get dressed and wear a collared shirt (think Golf shirt) and pants (usually jeans). I do my hair, and “get ready for work”. This is PURELY MENTAL. It prepares your mind and gets you into the mindset of work. Futhermore, being presentable goes a long way in a video call!

Preparation

I then get the tea/coffee ready, grab some snacks, some water in a water bottle and head off to my “office”. This again, is mental. I grab drinks and snacks so that I do not have to leave the office for awhile.

Distractions are abound in your house, you need to limit your exposure to them.

By preparing these small things you are getting yourself into the mindset for work. Let’s be100% honest here, there is no way in hell you can be effective with an interesting movie blaring in the background and working in 2 hour chunks through the day. You need to be in the mental mindset and have a schedule.

Now, work your 6, 8, 10 hours or whatever you deem a work day. Get up and use the restroom, sparingly. When you eat lunch, spend 30 mins to 1 hour. Prepare your lunch before work if at all possible. Again, this is to limit distractions.

Make Time For Exercise

During lunch, fit in a workout in the garage if you can (or go to the gym/fitness group/etc – see below). Health is important. You don’t commute, so pick up some freaking weights or run or row, etc.

Don’t have equipment?

Go for a run. Do Calisthenics, etc.

If you need help here, I can help you – I have tons of fitness programs I do on the road, visiting family, in my garage, all with no equipment. I’m no Hulk, but I’d say I’m “in shape” somewhat, so it must be working.

Eat Healthy

This is key! Eat healthy! Tip: Eat ONE salad per day. I don’t care when. Only requirement: Do not soak it in dressing. I recommend Olive Oil and vinaigrette or some variation. Not ranch or thousand island or any of those heavy variants. Eating one salad a day will do insane things for your health and mindset. Doing this alone will make positive changes in your diet and health.

Understand and Recognize Cabin Fever

If you live in a city, get out for lunch at least once a week. Go to a taco shop, meet a friend, have a lunch date with your wife/girl[boy]friend/husband/etc.

Get out of the house.

Plan to work out of the house 1-2 days a week.

Time Block Your Tasks

List a couple of tasks that you want to complete that take about 2-4 hours to complete, go to a coffee shop or coworking space and get it done. It will do an insane amount for you mentally and creatively. Do that a couple times a week. I find that sometimes doing one task at one coffee shop and then going to another place (library, etc) and doing the other one will also help break the monotony.

Outside of Work (AKA: Social Life)

Outside of work – do something that requires you to get out of the house. Join a fitness group – yoga, pilates, CrossFit, Brazilian Jiu-Jitsu, etc. You’ll get that social connection that way. I highly recommend it to be fitness or martial arts related.

Fitness and martial arts communities are very tight knit and you’ll find a vast array of individuals you can connect with that have differnet backgrounds. Through these groups I’ve become friends with Lawyers, Doctors, Dentists, stay at home mothers, Insurance Reps, Students, you name it – they’re all there. Fitness and martial arts crosses all boundaries. It will be worth your while. Trust me on this one.

Create Some Mental Space

Try to meditate. Not into meditation? Try the free 10 day guided meditation from headspace.com (download the app and try it out).

If you haven’t noticed yet, this is all mainly mental.

Communication when Remote

As for your typical day to day work routine …
You are going to have to communicate about 3x-4x as hard as you did before.

When you’re remote you’re not visually there and sometimes you have to be loud before others respond. Voice your opinions.

The goal is to communicate very well.

TLDR;

Its all mental.

You need to create a schedule, stick to it, take care of your body, create the proper mental mindset and cultivate it (day in and day out). You need to create “out of band” social connections so you don’t go crazy. Do that with a fitness/martial arts group. Break work into chunks and get out of the house a couple times a week. Lastly, communicate the hell out of everything. If you’re not sure if you communicated enough, do it more. Annoy people if you have to, you’re remote and sometimes people forget about you if they can’t see you.

Follow those simple steps and you’ll thrive in a remote atmosphere and you’ll end up enjoying life 10x more than you ever did before.

Finally, if you ever have a question about remote working – email me – I’ll help. I’ve been through probably almost anything you’ve been through working remote.

Thankfully, I was able to fix the issue. Here’s how I did it – hopefully it works for you too:

The Issue

When I would attempt to start the virtual device I’d get the following message (with screenshot below):

Unable to start the virtual device. VirtualBox cannot start the virtual device. To find out the cause of the problem, start the virtual device from VirtualBox …

I then started the device in VirtualBox and received the following error:

VERR_SUPLIB_OWNER_NOT_ROOT

with the text saying “Cannot start device” or something like that. The key was the error message constant:

VERR_SUPLIB_OWNER_NOT_ROOT

I sent my logs and screenshots of Genymotion and VirtualBox to Genymotion and I was told to install new graphics drivers (smh) and upgrade VirtualBox. This error has nothing to do with graphics drivers. Anyway .. I did some digging.

The Fix

I noticed that Genymotion was installed in the /Applications folder. Ok, cool. I took a look at the permissions via the CLI with:

>ls -al

I noticed something weird … the /Applications folder was owned by someone else, not by wheel (the system admin group in OSX), myself or root. It was owned by some other user that I could not find (which is another issue altogether).

The error message states that the owner is not root. You can typically fix this with the diskutil command:

> diskutil verifyPermissions /

This will verify all the permissions on your system (sans the homedir IIRC), telling you what is out of whack. To fix the permission issues you can run the following command:

> diskutil repairPermissions /

After running these commands I was able to start my Genymotion device as the user has been changed back to ‘root’.

Still Stuck?

If that did not work you can try changing the owner manually like this, which changes the owner: