Let me lead this off with a disclaimer: This is not meant to be a puff piece for NativeScript at all, I even use Xamarin from time to time and if I knew React I would probably use React Native. I am a Telerik Developer Expert, which is a really awesome group comprised of some very intellectual, talented, and successful developers. I write NativeScript plugins for fun because I see a good future for developing with NativeScript and I’m guessing several thousand other developers would agree since it’s trending upward month after month. I’m not compensated monetarily by Telerik for anything I do, hell I wish I was compensated. I would rather be lounging by a pool than writing this anyway. All of the views and opinions on my blog are my own and don’t express those of my employer or any group I’m affiliated with. Oh and I also don’t have time to proofread this specific post so ignore any typos, grammar or silly writing mistakes.
So yesterday, July 19 2016, I was pointed to a Reddit thread which at first I didn’t want to even bother clicking for two reasons:
- Who actually uses Reddit?
- I don’t even have a Reddit account.
Well I was suckered into clicking after a friend told me how ridiculous the thread was, so I did it. I created a stupid Reddit account and couldn’t help but ‘feed the trolls’ as some people say.
We’ve all seen it, horizontal scrolling lists in our favorite apps. Google uses this UI concept in its Play Store app to list related apps horizontally. It’s slick and works well to show off a small set of items that are related.
Okay, so not everyone will need to record audio from a device in their mobile application, but it’s still a pretty kick-ass feature to add to your app. This tutorial will be short and sweet. We are going to use the nativescript-audio plugin. You can find the repo here. A pal of mine, Nathan Walker, contributed the iOS version and did a lot of the TypeScript cleanup on the code base so thanks to him for his contribution. This plugin actually records and plays back audio. I plan on doing a follow up on playing audio later on.
There is this awesome new feature for Android apps to use what is called Custom Tabs. What this feature does is allows your Android app to open external content inside Goolge Chrome and not in the traiditonal webview. You can set the color of the toolbar, the enter/exit animations, icons, and menu options. It’s a really nice addition to Android apps when you have links to external content, it keeps the user experience very smooth. There is an advanced usage where you can actually pre load in the background, which Google claims can save 700ms of loading time so it might be worth it for apps using webviews a lot.
Enough rambling, let’s look at the actual code to see how this works. Continue reading “Chrome Custom Tabs with NativeScript”