O'Reilly logo

Creating Mobile Apps with Appcelerator Titanium by Christian Brousseau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving the stock values from the Internet

The very last piece of our puzzle will be to retrieve the stock's latest price from the Internet. For this, we will encapsulate this feature into its own service. We will create a new file named OnlineQuotesService.js and it will be located in the Resources/service directory.

Inside this file, we will load into memory the preference service using the require function, and store its content in a variable named ps for later use. We will also create an empty function named OnlineQuotesService that will represent our service:

var ps = require('service/PreferenceService');

function OnlineQuotesService() {}

Knowing where to get it

Before we do any coding, we need to determine how we will be retrieving the information. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required