As mobile users access applications and pull remote data on the move, we need to be conscious and aware that our application may be using up the limited data services. We can implement services and techniques to help reduce unnecessary remote calls to data.
In this recipe, we will build an application that allows the user to search Twitter using its open API. We'll store the results for the search in localStorage
so that they are available when we reopen the application:
Firstly, create a new PhoneGap project named
localstorage
by running this line:phonegap create localstorage com.myapp.localstorage localstorage
Add the devices platform. You can choose to use Android, iOS, or both:
cordova platform add ios cordova platform add android
We will be using the jQuery Mobile framework for our layout, so we include the relevant CSS and JavaScript file references within the
head
tag.Open
www/index.html
and clean up the unnecessary elements...