What You Need to Know When Switching from Android to iPhone

What You Need to Know When Switching from Android to iPhone

If you’ve decided to switch your smartphone from one running Android to an iPhone, you’re making a great choice. But if you’ve been using Android long enough to accumulate a decent number of apps and a good-sized music library, to say nothing of videos, contacts, and calendars, you may have questions about what you can bring to your new phone. Luckily, the answer is that you can bring most of your content and data, with a few notable exceptions. Sync Content to Your Computer Depending on how you’ve used your Android phone, you may have downloaded a lot of content, especially music, directly to it. It’s crucial that, before you switch to iPhone, you sync all of that music to your computer. If the music is on your computer as well as...

Convincing the Kotlin compiler that code is safe

Convincing the Kotlin compiler that code is safe

One of the best features of Kotlin is its built-in null safety in the type system. Try to use a nullable type in a non-null way and the compiler will yell at you. This null safety can occasionally create some tricky situations, though. Code that you know is ironclad turns out to be full of potential nulls… at least according to the compiler. Navigating Maps Let’s look at an example. Suppose we want to convert a List<String> into a Map<String, Int>, where each Int represents the number of times each String appeared in the list. Here’s how we might try to write it: fun countInstances(list: List<String>): Map<String, Int> { val map = mutableMapOf<String, Int>() for (key in list) { if (key !in map) { map[key] = 0 }...

DesignProtip – Keyline Pushing app + Layout Bound

DesignProtip – Keyline Pushing app + Layout Bound

I often got asked how do I inspect an app from design perspective, especially on the layout, alignment, keylines etc., so I thought to share this in my blog. Sometimes we are able to spot some issues by just looking at it, but with some nifty tools, the design inspection can be done much easier. Below screenshot is what I usually see when I do a design pass on the static design implementation. It’s an IMDb app screenshot with keyline grid + layout bound shown, which is very useful to spot misaligned elements and incorrect paddings. Tools Keyline Pushing app by Faiz Malkani – This awesome free app will print the 8dp gridlines on your screen which have the proper keylines recommended in Material Design. It also has some other gridlines like 4dp typographic grid...

Keeping Your App Responsive

Keeping Your App Responsive

It’s possible to write code that wins every performance test in the world, but still feels sluggish, hang or freeze for significant periods, or take too long to process input. The worst thing that can happen to your app’s responsiveness is an “Application Not Responding” (ANR) dialog. In Android, the system guards against applications that are insufficiently responsive for a period of time by displaying a dialog that says your app has stopped responding, such as the dialog in Figure 1. At this point, your app has been unresponsive for a considerable period of time so the system offers the user an option to quit the app. It’s critical to design responsiveness into your application so the system never displays an ANR dialog to the...

Performance Tips

Performance Tips

This document primarily covers micro-optimizations that can improve overall app performance when combined, but it’s unlikely that these changes will result in dramatic performance effects. Choosing the right algorithms and data structures should always be your priority, but is outside the scope of this document. You should use the tips in this document as general coding practices that you can incorporate into your habits for general code efficiency. There are two basic rules for writing efficient code: Don’t do work that you don’t need to do. Don’t allocate memory if you can avoid it. One of the trickiest problems you’ll face when micro-optimizing an Android app is that your app is certain to be running on multiple types of hardware....

9 THINGS EVERY ANDROID OWNER SHOULD TRY RIGHT NOW

9 THINGS EVERY ANDROID OWNER SHOULD TRY RIGHT NOW

There so many cool things you can do with Android that you probably don’t even know. From custom ROMs to gorgeous launchers, apps, LED notifications, gesture controls, icon packs and tweaks, there is plenty to keep you happy for a while. Here are nine things every Android owner should try. Supercharge your Wi-Fi Did you know you can tell Chrome to save time and money by reducing data usage? Most people don’t. By using this setting, I’ve cut my data usage by 30 percent in the past month. How’s that for easy savings? Go to Chrome > Settings > Data Saver and turn it on. Likewise, did you know you can tell your phone to keep Wi-Fi on during sleep? Just go to Settings > Wi-Fi > Advanced > Keep Wi-Fi on during sleep and select...