Defining a Preference Screen Layout in XML

Unlike in the standard UI layout, preference definitions are stored in the res/xml resources folder. Each preference layout is defined as a hierarchy, beginning with a single PreferenceScreen element: You can include additional Preference Screen elements, each of which will be represented as a selectable element that will display a new screen when clicked. Within … Read more

Downloading Data Without Draining The Battery in Android

The timing and techniques you use to download data can have a significant effect on battery life. The wireless radio on mobile devices draws significant power when active, so it’s important to consider how your application’s connectivity model may impact the operation of the underlying radio hardware Every time you create a new connection to … Read more

Internet Services in Android

Software as a service (SaaS) and cloud computing are becoming increasingly popular as companies try to reduce the cost overheads associated with installing, upgrading, and maintaining deployed software. The result is a range of rich Internet services with which you can build thin mobile applications that enrich online services with the personalization available from your … Read more

Download Manager Query in Android

The query method takes a DownloadManager.Query object as a parameter. Use the setFilterById method on a Query object to specify a sequence of download reference IDs, or use the setFilterByStatus method to filter on a download status using one of the DownloadManager .STATUS_* constants to specify running, paused, failed, or successful downloads The Download Manager … Read more

Download Manager in Android to download Files

The Download Manager was introduced in Android 2.3 (API level 9) as a Service to optimize the handling of long-running downloads. The Download Manager handles the HTTP connection and monitors connectivity changes and system reboots to ensure each download completes successfully To access the Download Manager, request the DOWNLOAD_SERVICE using the getSystemService method, as follows: … Read more

Android to Create an Earthquake Viewer APP

The earthquake feed XML is parsed here by the DOM parser Start by creating an Earthquake project featuring an Earthquake Activity. Create a new EarthquakeListFragment that extends ListFragment. This Fragment displays your list of earthquakes. public class EarthquakeListFragment extends ListFragment {} Modify the main.xml layout resource to include the Fragment you created in Step 2. … Read more

Managing Manifest Receivers at Run Time in Android

Using the Package Manager, you can enable and disable any of your application’s manifest Receivers at run time using the setComponentEnabledSetting method. You can use this technique to enable or disable any application component (including Activities and Services), but it is particularly useful for manifest Receivers. To minimize the footprint of your application, it’s good … Read more