Join Joseph Lowery for an in-depth discussion in this video Working cross-device, part of Learning Cloud Service APIs.
In the three device specific lessons in this chapter for iOS, Android, and Windows Phone, the coding approach has been to go native, with references to the low-level languages preferred by those systems. For many apps, this is the only way to go, which, if you're targeting more than one platform, is a lengthy development process to travel. In this lesson, we'll look at the number of alternative approaches that work cross device. However, before we do, let's examine cloud service APIs optimized for natively coded apps.
Not all decide targeted cloud service APIs come from the OS manufacturers. There are a number of third party services that offer dedicated APIs designed to work with one or more of the devices. Amazon Web Services, for example, provides separate SDKs for the top three smartphones. iOS, Android, and Windows Phone via .NET. Of course, there are other cloud services that hone in on just one or two of the markets.
Companies taking this approach include Sencha, as you see here, and Adobe PhoneGap. When Adobe acquired PhoneGap, they donated the cross-device libraries to Apache, so that they could run under the open source platform, which is now called Cordova. Both Sencha and PhoneGap use Cordova libraries to transform what is, in essence, a web app into a native app. Apps developed during this process are still able to be distributed through the various app stores.
Moreover, most of the individual device unique features are available through custom API. Here, for example, is the PhoneGap API for the Accelerometer, which captures device motion in three axes. The other approach to building cross-device apps from a single code base, is to use a lower-level language, which is then output into apps for the various platforms. One product that works this way is Xamarin. Xamarin relies on C# to build cross-device apps, which is great for .NET developers who are used to using that language anyway.
Such systems require a different and particular skill set to code and, depending on the app, be a bit longer to develop. Whichever approach you take for your app, whether it's native all the way or a version of cross device coding, will, of course, depend on many factors, including your app's needs and your available resources.
First, there are the popular Google cloud services and device-specific APIs for iOS, Android, and Windows Phone. Then there are APIs to connect to followers on platforms like Facebook and Twitter and even pull images from Flickr. For some really interesting data, Joe shows how to access corporate APIs from companies like Citrix and General Motors. (Imagine getting vehicle data straight from GM.) Last, he shows how to leverage public sector APIs and mine data from the national census, weather bureaus, and even federal job boards. Learn how to make your web projects stand out with cloud services.
- Working with Google Cloud APIs
- Connecting to mobile devices via APIs
- Interfacing with Facebook and managing a Twitter feed
- Utilizing the Google infrastructure in your own apps
- Working with the General Motors API
- Understanding public sector APIs