Each Activity within the application must be defined within the Android manifest file with an <activity> tag. For example, the following XML excerpt defines an Activity class called AudioActivity:
This Activity must be defined as a class within the com.androidbook.multimedia package. That is, the package specified in the <manifest> element of the Android manifest file. You can also enforce scope of the activity class by using the dot as a prefix in the Activity name:
Or you can specify the complete class name:
Designating a Primary Entry Point Activity for Your Application Using an Intent Filter
An Activity class can be designated as the primary entry point by configuring an intent filter using the Android manifest tag <intent-filter> in the application’s AndroidManifest.xml file with the MAIN action type and the LAUNCHER category.
The following tag of XML configures the Activity class called MultimediaMenuActivity as the primary launching point of the application:
Configuring Other Intent Filters
The Android operating system uses Intent filters to resolve implicit intents. That is, Intents that do not specify the Activity or Component they want launched. Intent filters can be applied to Activities, Services, and BroadcastReceivers. The filter declares that this component is open to receiving any Intent sent to the Android operating system that matches its criteria.
Intent filters are defined using the <intent-filter> tag and must contain at least one <action> tag but can also contain other information, such as <category> and <data> blocks. Here we have a sample intent filter block, which might be found within an <activity> block:
This intent filter definition uses a predefined action called VIEW, the action for viewing particular content. It is also BROWSABLE and uses a scheme of geoname so that when a Uri starts with geoname://, the activity with this intent filter launches.You can read more about this particular intent filter in Chapter “Using Location-Based Services (LBS) APIs.”
Registering Services and Broadcast Receivers
All application components are defined within the Android manifest file. In addition to activities, all services and broadcast receivers must be registered within the Android Manifest file.
Both Services and Broadcast Receivers use intent filters. You learn much more about services, broadcast receivers, and intent filters later in the book.
Registering Content Providers
If your application acts as a content provider, effectively exposing a shared data service for use by other applications, it must declare this capability within the Android manifest file using the <provider> tag. Configuring a content provider involves determining what subsets of data are shared and what permissions are required to access them, if any.
Setting Up Your Android Development Environment
Writing Your First Android Application
Understanding The Anatomy Of An Android Application
Defining Your Application Using The Android Manifest File
Managing Application Resources
Exploring User Interface Screen Elements
Designing User Interfaces With Layouts
Drawing And Working With Animation
Using Android Data And Storage Apis
Sharing Data Between Applications With Content Providers
Using Android Networking Apis
Using Android Web Apis
Using Location-based Services (lbs) Apis
Using Android Multimedia Apis
Using Android Telephony Apis
Using Android 3d Graphics With Opengl Es
Using The Android Ndk
Using Android’s Optional Hardware Apis
Working With Notifications
Working With Services
Extending Android Application Reach
Managing User Accounts And Synchronizing User Data
Handling Advanced User Input
Targeting Different Device Configurations And Languages
The Mobile Software Development Process
Designing And Developing Bulletproof Android Applications
Testing Android Applications
Selling Your Android Application
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.