Httpmarketandroidcomsearchqpname or marketsearchqpname

2. Your application can then compare its own version number against that retrieved. If the retrieved value is greater, your application can show a dialog informing the user that a new version is available. The dialog can offer buttons to begin the download or cancel.

3. If the user clicks the button to begin the download, your application can call startActivity() using the ACTION_VIEW Intent, passing the URI received from your web service. The Intent launches the Market application on the device and initiates an immediate search on the Android Market site, based on the query parameters in the URI. When the result is displayed, the user can view the details of the upgraded application and begin the download.

Note that, because the URI string is received from your web service and not hard-coded into your application, you can easily change the Market launch behaviors whenever needed, without having to change your application.

For more information about URIs you can pass to the Market application at launch, see Using Intents to Launch the Market Application, below. Using Intents to Launch the Market Application on a Device

Android-powered devices include a preinstalled Market application that gives users access to the Android Market site. From Market, users can browse or search available applications, read ratings and reviews, and download/install applications.

You can launch the Market application from another Android application by sending an Intent to the system. You might want to do this, for example, to help the user locate and download an upgrade to an installed application, or to let the user know about related applications that are available for download.

To launch Market, you send an ACTION_VIEW Intent, passing a Market-handled URI string as the Intent data. In most cases, your application would call startActivity() to send the ACTION_VIEW Intent with the Market-handled URI.

The URI that you supply with the Intent lets the system route the intent properly and also expresses the type of action that you want Market to perform after launch. Currently, you can have Market initiate a search for applications on Android Market, based on query parameters that you provide. For example, you can specify URIs to search for applications by:

• Developer name

• String match across application name, developer name, and description, or

• Any combination of the above

Note that the URI queries return results from the public metadata supplied by developers in their Android Market profiles or application publishing information, but not from the developer's private account or from the certificate used to sign the application.

The table below provides a list of URIs and actions currently supported by the Market application.

For this Result

Pass this URI with the ACTION_VIEW Intent


Search for an application by its fully qualified Java package name and display the result. e:<package> or market://search?q=pname:<package>

Searches only the Java package name of applications. Returns only exact matches.

Search for applications by developer name and display the results. "<Developer Name>"or market://search?q=pub:"<Developer Name>"

Searches only the "Developer Name" fields of Market public profiles. Returns exact matches only.

Search for applications by substring and display the results.<sub string> or market://search?q=<substring>

Searches all public fields (application title, developer name, and application description) for all applications. Returns exact and partial matches.

Search using multiple query parameters and display the results.

Example: d pub:Android

Returns a list of applications meeting all the supplied parameters.

Note that these URIs work only when passed as intent data — you can't currently load the URIs in a web browser, either on a desktop machine or on the device.

Activity and Task Design Guidelines

Activities are the basic, independent building blocks of applications. As you design your application's UI and feature set, you are free to re-use activities from other applications as if they were yours, to enrich and extend your application. These guidelines describe how activities work, illustrates them with examples, and describes important underlying principles and mechanisms, such as multitasking, activity reuse, intents, the activity stack, and tasks. It covers this all from a high-level design perspective.

Menu Design Guidelines

Android applications make use of Option menus and Context menus that enable users to perform operations and navigate to other parts of your application or to other applications. These guidelines describe the difference between Options and Context menus, how to arrange menu items, when to put commands on-screen, and other details about menu design.

0 0

Post a comment