Chapter 2 intent, broadcast receiver, adapter, and Internet

Source: Internet
Author: User

At first glance, the topics in this chapter seem to have little to do with each other; in fact, these topics represent the adhesives that are bound between applications and their components.

 

Mobile applications on most platforms run in their hidden boxes. They are isolated from each other and have extremely strict restrictions on the interaction with system hardware and local components. Android applications also run in a dark box, but they can be expanded beyond their boundaries using intent, broadcast receiver, adapter, content provider, and Internet.

 

In this chapter, you will learn about intent and how to use it to start an activity, including explicit and runtime binding. With the implicit intent, you will learn how to request and operate a piece of data, and let Android decide which application components can serve this request.

 

Broadcast intent is used to notify application events within the system. You will learn how to launch these broadcasts and use the broadcast receiver to receive them.

 

You will practice the adapter and learn how to use them to bind the display layer and data source, and you will verify the dialog box mechanism.

 

After learning about the mechanism for transferring and receiving local data, we will introduce the android Internet connection model and some java skills for parsing Internet Data seeds.

 

The earthquake-monitoring example demonstrates how to bind these features together. Seismic monitor will take the shape of an example, and we will improve and expand it in the following chapters.

Intent Introduction

Start activity with Intent

Explicitly start a new activity

Implicit intent and runtime binding

Linkify Introduction

Local Link Type

Create a custom link string

Use match filter

Use transform filter

Activity Return Value

Promoter Activity

Return Value

Processing the results of a sub-Activity

Android Local Action

Use intent filter to respond to implicit intent

How Android parses intent Filter

Response after intent filter match

Transfer responsibility

Example: select a contact

Use intent filter to implement plug-in and extension Functions

Provides anonymous actions for Applications

Add anonymous actions to your activity menu

Use intent to broadcast events

Broadcast events

Broadcast receiver listens to broadcasts

Register in the manifest of the program

Register in code

Android local broadcast action

Adapter Introduction

Adapter introduction provided by Android

Bind data using Adapter

Use arrayadapter to customize to-do list

Use simplecursoradapter

Use Internet Resources

Connect to Internet Resources

Use Internet Resources

Dialog Introduction

Dialog class Introduction

Alertdialog class

Special input Dialog

Use and manage Dialog

Activity of the dialog topic

Create an earthquake Viewer

Summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.