justinkendra - Fotolia

Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

NativeScript eases cross-platform app development for music app

Listen to this podcast

ShoutOutPlay app records and then blends user greetings with Spotify streams. The app runs natively on Android and iOS from a single NativeScript code base that compiles to JavaScript.

ShoutOutPlay is a mobile app built with NativeScript that lets users record personal dedications and attach them to music tracks that play in Spotify. In this podcast, developer and ShoutOutPlay creator Nathan Walker discusses his choice of NativeScript for cross-platform app development to yield native iOS and Android apps from a single code base. He also explains how the app links and syncs with Spotify and shares what he learned and how it can benefit other developers of cloud-based mobile apps.

To use ShoutOutPlay, users record a message (called a shout out), attach it to any track from Spotify and add it to a playlist. As the song plays, its volume drops and the shout out is mixed in and heard clearly. After the shout out plays, the song resumes playing at its normal volume. Frivolous fun, perhaps, but dead serious when it comes to application development.

"ShoutOutPlay could not have been built on the web," says Walker, "because it uses Spotify, which allows only 30-second previews of tracks on the web. I had to use the native SDK in order to integrate with Spotify." The app was built as a test using the NativeScript cross-platform app development framework.

Walker's day job is as a senior software engineer at Infowrap in Portland, Ore. Infowrap is a software as a service application that allows users working on projects to collect, organize and share different kinds of content with other collaborators. Walker is investigating using NativeScript's cross-platform app development capabilities in future versions of Infowrap.

Link and sync

The first step to using the ShoutOutPlay app is recording the shout out greeting as an .M4A file on an iOS or Android device. The second step is more complex -- linking the separate shout out and music files together. To do that, another tool is required.

"I integrated [Google] Firebase into this NativeScript application," says Walker. Each shout out is recorded locally on the phone and then synced and backed up to a Firebase database. Walker called an API from Spotify to access the streaming service's full music player.

If you have ever looked at an Apple app versus an Android app and looked at the UI construction, they're not the same at all.
Nathan WalkerInfowrap

The choice of NativeScript as a cross-platform app development platform came about as Infowrap researched moving its platform from a hybrid Apache Cordova app to a true native app, Walker says. "I was trying to find something where we didn't have a pure Objective-C or Java app because of the time involved."

As an experiment, Walker wrote several plug-ins in NativeScript that found their way into production. ShoutOutPlay uses 16 plug-ins, all of which passed app store scrutiny from Apple and Google. Only one issue popped up: Spotify's spotty support for IPv6.

Ultimately, Walker chose NativeScript because developers can write both iOS and Android UIs with one single, concise XLM language, he says. "If you have ever looked at an Apple app versus an Android app and looked at the UI construction, they're not the same at all."

In the remainder of this podcast, Walker discusses using NativeScript to leverage Angular 2, avoiding Objective-C and Java code and sticking with JavaScript. He also comments on the profound changes wrought by Angular 2 compared with its predecessor, including its ability to be used with multiple platforms.

The ShoutOutPlay mobile app is available in the Apple App Store and on Google Play.

 jshore@techtarget.com or follow @JshoreTT on Twitter.

Next Steps

Choosing Telerik as a mobile app development platform

Code once, run anywhere with cross-platform development tools

iOS, Android are not as secure as you think

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What tools do you use to develop an app that can run on iOS and Android?
Cancel

-ADS BY GOOGLE

SearchAWS

TheServerSide

SearchFinancialApplications

SearchBusinessAnalytics

SearchCRM

SearchSalesforce

Close