In this program we initiate a HTTPS connection and using this connection we get a json object which we print on the screen.
In this example we are going to parse an Xml that we receive from the internet particularly from http://developer.yahoo.com/yql/console/ from here go to the bottom right corner in DATA TABLES and select Show Community Table and scroll dowm to yahoo and click on yahoo.finance.quote in the console that appears and type the following sql statement – select * from yahoo.finance.quote where symbol in (“MSFT”) , and uncheck Diagnostics and click on test , now u will get the following shown output
Here is source code of the Program demonstrates Download Manager in Android in Android. The program is successfully compiled and run on a Windows system using Eclipse Ide. The program output is also shown below.
Before you can access Internet resources, you need to add an INTERNET uses-permission node to your application manifest, as shown in the following XML snippet:
<uses-permission android:name=”android.permission.INTERNET”/>
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:
String serviceString = Context.DOWNLOAD_SERVICE; DownloadManager downloadManager; downloadManager = (DownloadManager)getSystemService(serviceString);
In this program we initiate a HTTPS connection and using this connection we get a json object which we print on the screen.
In this tutorial we would be dealing with Google map and how to show a Google Map in your Application using Google Map API’s , in order to do so we would need the MapFragment class which extends the Fragment class and provides the life-cycle management and the services for displaying a GoogleMap widget. GoogleMap is the class which shows the map. The MapFragment has the getMap() method to access this class.
Program to demonstrate Zoom-IN and Zoom -Out of an image using Touch events in Android. The program is successfully compiled and run on a Windows system using Eclipse Ide.
Shared Preferences are a simple, lightweight name/value pair (NVP) mechanism for saving primitive application data, most commonly a user’s application preferences.
Android offers an XML-driven framework to create system-style Preference Screens for your applications.
By using this framework you can create Preference Activities that are consistent with those used in both native and other third-party applications.
This has two distinct advantages:
1. Users will be familiar with the layout and use of your settings screens.
2. You can integrate settings screens from other applications (including system settings such as location settings) into your application’s preferences.
If you want to place groups of settings into a subscreen , place the group of Preference objects inside a PreferenceScreen.
Here is source code of the Program to Write to Demonstrate Intent in Preference Screen in Android. The program is successfully compiled and run on a Windows system using Eclipse Ide. The program output is also shown below.
In some cases, you might want a preference item to open a different activity instead of a settings screen, such as a web browser to view a web page. To invoke an Intent when the user selects a preference item, add an element as a child of the corresponding elemen
This Android Java Program demonstrates Preference Headers.
Here is source code of the Program to Demonstrate Preference Headers in Android. The program is successfully compiled and run on a Windows system using Eclipse Ide. The program output is also shown below.
In rare cases, you might want to design your settings such that the first screen displays only a list of subscreens. When you’re developing such a design for Android 3.0 and higher, you should use a new “headers” feature in Android 3.0, instead of building subscreens with nested PreferenceScreen elements.
To build your settings with headers, you need to:
1.Separate each group of settings into separate instances of PreferenceFragment. That is, each group of settings needs a separate XML file.
2.Create an XML headers file that lists each settings group and declares which fragment contains the corresponding list of settings.
3.Extend the PreferenceActivity class to host your settings.
4.Implement the onBuildHeaders() callback to specify the headers file.
A great benefit to using this design is that PreferenceActivity automatically presents the two-pane layout when running on large screens.
for more info go to:-
http://developer.android.com/guide/topics/ui/settings.html#top