Что такое пространство имен приложений Android?
Ниже приведен пример пространства имен app которое я видел из файла res/menu/main.xml
Какую цель предлагает пространство имен app ? Является ли это «стандартным» пространством имен Android для Android? Имеются ли одинаковые параметры значений для одного и того же атрибута, размещенного в двух разных пространствах имен (например, app:showAsAction и android:showAsAction ).
Из документов : android:showAsAction=[«ifRoom» | «never» | «withText» | «always» | «collapseActionView»] android:showAsAction=[«ifRoom» | «never» | «withText» | «always» | «collapseActionView»]
Т.е. строка в приведенном выше примере означает что-то другое, если атрибут был вместо этого:
Похоже, что это может быть какой-то механизм «подкласса», но я не могу найти никакой реальной документации в пространстве имен app из источников Google / Android.
Пространство имен app не является специфичным для библиотеки, но оно используется для всех атрибутов, определенных в вашем приложении, будь то вашим кодом или импортируемыми вами библиотеками, эффективно создавая единое глобальное пространство имен для пользовательских атрибутов, то есть атрибуты, не определенные андроидом система.
В этом случае библиотека appcompat-v7 использует настраиваемые атрибуты, appcompat-v7 пространство имен android: namespace для поддержки предыдущих версий android (например: android:showAsAction был добавлен только в API11, но app:showAsAction (предоставляется как часть вашего приложения) Работает на всех уровнях API, которые делает ваше приложение) – очевидно, используя android:showAsAction не будет работать на уровнях API, где этот атрибут не определен.
Источник
Android. App Namespace
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains high-level classes encapsulating the overall Android application model.
Classes
A primary toolbar within the activity that may display the activity title, application-level navigation affordances, and other interactive items.
Per-child layout information associated with action bar custom views.
Provides data for the MenuVisibility event.
A tab in the action bar.
An activity is a single, focused thing that the user can do.
Generates a /manifest/application/activity element within AndroidManifest.xml .
A screen that contains and runs multiple embedded activities.
This class gives information about, and interacts with, activities, services, and the containing process.
Information you can retrieve about the available memory through GetMemoryInfo(ActivityManager+MemoryInfo).
Information you can retrieve about any processes that are in an error condition.
Information you can retrieve about tasks that the user has most recently started or visited.
Information you can retrieve about a running process.
Information you can retrieve about a particular Service that is currently running in the system.
Information you can retrieve about a particular task that is currently «running» in the system.
Helper class for building an options Bundle that can be used with android.content.Context#startActivity(android.content.Intent, android.os.Bundle) Context.startActivity(Intent, Bundle) and related methods.
This class provides access to the system alarm services.
A subclass of Dialog that can display one, two or three buttons.
Stub activity that launches another activity (and then finishes itself) based on information in its component’s manifest meta-data.
Interface used to control the instantiation of manifest elements.
Base class for maintaining global application state.
Generates a /manifest/application element within AndroidManifest.xml .
Describes an application error.
Describes an application not responding error.
Describes a battery usage report.
Describes an application crash.
Describes a running service report.
Describes the information of an application process’s death.
App-ops are used for two purposes: Access control and tracking.
When an AppOpsManager#noteOp(String, int, String, String, String) app-op is noted and the app the app-op is noted for has a AppOpsManager.OnOpNotedCallback registered the note-event needs to be delivered to the callback.
Specialization of SecurityException that is thrown when authentication is needed from the end user before viewing the content.
Rule instance information for zen mode.
Exception thrown when an app tries to start a background Service when it’s not allowed to do so.
A simple dialog containing an android.widget.DatePicker .
Base class for Dialogs.
A fragment that displays a dialog window, floating on top of its activity’s window.
Represents a abstract action that can be perform on this app.
The download manager is a system service that handles long-running HTTP downloads.
This class may be used to filter download manager queries.
This class contains all the information necessary to request a new download.
An activity that displays an expandable list of items by binding to a data source implementing the ExpandableListAdapter, and exposes event handlers when the user selects an item.
Exception thrown when an app tries to start a foreground Service when it’s not allowed to do so.
A Fragment is a piece of an application’s user interface or behavior that can be placed in an Activity.
State information that has been retrieved from a fragment instance through SaveFragmentInstanceState(Fragment).
Helper class for showing «bread crumbs» representing the fragment stack in an activity.
Provides data for the BreadCrumbClick event.
Callbacks to a Fragment ‘s container.
Provides integration points with a FragmentManager for a fragment host.
Integration points with the Fragment host.
Interface for interacting with Fragment objects inside of an Activity
Developer Guides
FragmentManagerNonConfig stores the retained instance fragments across activity recreation events.
API for performing a set of Fragment operations.
The GameManager allows system apps to modify and query the game mode of apps.
Base class for implementing application instrumentation code.
Information about a particular kind of Intent that is being monitored.
Description of a Activity execution result to return to the original activity.
Generates the //intent-filter element within AndroidManifest.xml .
Class that can be used to lock and unlock the keyguard.
Displays a list of all activities which can be performed for a given intent.
Utility class to resize icons to match default icon size.
An item in the list
An activity that displays a list of items by binding to a data source such as an array or Cursor, and exposes event handlers when the user selects an item.
A fragment that displays a list of items by binding to a data source such as an array or Cursor, and exposes event handlers when the user selects an item.
Interface associated with an Activity or Fragment for managing one or more Loader instances associated with it.
Helper class for managing multiple running embedded activities in the same process.
The media route action provider displays a MediaRouteButton media route button in the application’s ActionBar to allow the user to select routes and to control the currently selected route.
Generates the //meta-data element within AndroidManifest.xml .
Convenience for implementing an activity that will be implemented purely in native code.
A class that represents how a persistent notification is to be presented to the user using the android.app.NotificationManager .
Helper class for generating large-format notifications that include a large image attachment.
Helper class for generating large-format notifications that include a lot of text.
Builder class for Notification objects.
Helper class for generating large-format notifications that include a list of (up to 5) strings.
Notification style for media playback notifications.
An object that can apply a rich notification style to a T:Android.App.Notification+Builder object.
A representation of settings that apply to a collection of similarly themed notifications.
A grouping of related notification channels.
Class to notify the user of events that happen.
A description of an Intent and target action to perform with it.
Exception thrown when trying to send through a PendingIntent that has been canceled or is otherwise no longer able to execute the request.
Provides an immutable reference to an entity that appears repeatedly on different surfaces of the platform.
Represents a set of parameters used to initialize and update an Activity in picture-in-picture mode.
Used by Activity#onPictureInPictureUiStateChanged(PictureInPictureUiState) .
Base class for presentations.
A dialog showing a progress indicator and an optional text message or view.
Specialization of SecurityException that contains additional information about how to involve the end user to recover from the exception.
Represents a remote action that can be called from another process.
A RemoteInput object specifies input to be collected from a user to be passed along with an intent inside a PendingIntent that is sent.
Searchability meta-data for an activity.
This class provides access to the system search services.
Generates a /manifest/application/service element within AndroidManifest.xml .
Exception thrown when an app tries to start a Service when it’s not allowed to do so.
Listener provided in Activity#setEnterSharedElementCallback(SharedElementCallback) and Activity#setExitSharedElementCallback(SharedElementCallback) as well as Fragment#setEnterSharedElementCallback(SharedElementCallback) and Fragment#setExitSharedElementCallback(SharedElementCallback) to monitor the Shared element transitions.
Allows an app to control the status bar.
Description of an app-op that was noted for the current process.
For apps developing against android.os.Build.VERSION_CODES#HONEYCOMB or later, tabs are typically presented in the UI using the new ActionBar#newTab() ActionBar.newTab() and related APIs for placing tabs within their action bar area.
Stores information about a particular Task.
Utility class for constructing synthetic back stacks for cross-task navigation on Android 3.
A dialog that prompts the user for the time of day using a TimePicker .
Class for interacting with the device’s UI by simulation user actions and introspection of the screen content.
Provides data for the AccessibilityEvent event.
This class provides access to the system uimode services.
Interface for an Activity to interact with the user through voice.
Provides information about the colors of a wallpaper.
This class is used to specify meta information of a wallpaper service.
Provides access to the system wallpaper.
Interfaces
Listener for receiving events when action bar menus are shown or hidden.
Listener interface for ActionBar navigation events.
Callback interface invoked when a tab is focused, unfocused, added, or removed.
The callback used to indicate the user is done filling in the date.
Interface to intercept clicks on the bread crumbs.
Representation of an entry on the fragment back stack, as created with AddToBackStack(String).
Interface to watch for changes to the back stack.
This is the interface to be implemented for the class that is specified by the android.R.styleable#AndroidManifestApplication_zygotePreloadName android:zygotePreloadName of the tag.
Callback interface for a client to interact with the manager.
Callback interface for discovering when a send operation has completed.
See SetOnCancelListener(SearchManager+IOnCancelListener) for configuring your activity to monitor search UI state.
See SetOnDismissListener(SearchManager+IOnDismissListener) for configuring your activity to monitor search UI state.
The callback interface used to indicate the user is done filling in the time (they clicked on the ‘Set’ button).
Listener for filtering accessibility events.
Listener for observing the AccessibilityEvent stream.
Enums
Enumerates values returned by several types and taken as a parameter of the F:Android.App.ActionBar.SetDisplayOptions, and F:Android.App.ActionBar.SetDisplayOptions members.
Enumerates values returned by several types.
Enumerates values returned by several methods of AlarmType and taken as a parameter of several methods of AlarmManager.
Enumerates values returned by several types.
Enumerates values returned by several types.
Enumerates values returned by several methods of DefaultKey and taken as a parameter of the F:Android.App.Activity.SetDefaultKeyMode member.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.DialogFragment.SetStyle member.
Enumerates values returned by the GoHome, None, and DisableCarModeGoHome members and taken as a parameter of the F:Android.App.UiModeManager.DisableCarMode member.
Enumerates values returned by several types.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.DownloadManager+Request.SetAllowedNetworkTypes member.
Enumerates values returned by several types.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.DownloadManager+Query.SetFilterByStatus member.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.DownloadManager+Request.SetNotificationVisibility member.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.UiModeManager.EnableCarMode member.
Enumerates values returned by several methods of FragmentTransit and taken as a parameter of the F:Android.App.Fragment.OnCreateAnimator, and F:Android.App.FragmentTransaction.SetTransition members.
Enumerates values returned by several types.
Enumerates values returned by several types.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.Notification+Builder.SetDefaults member.
Enumerates values returned by several types.
Enumerates values returned by several types.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.Notification+Builder.SetVisibility member.
Enumerates values returned by several methods of PendingIntentFlags and taken as a parameter of several types.
Enumerates values returned by the PopBackStackInclusive, Inclusive, and None members and taken as a parameter of several methods of FragmentManager.
Enumerates values returned by several types.
Enumerates values returned by the Horizontal, and Spinner members and taken as a parameter of the F:Android.App.ProgressDialog.SetProgressStyle member.
Enumerates values returned by the IgnoreUnavailable, and WithExcluded members and taken as a parameter of the F:Android.App.ActivityManager.GetRecentTasks member.
Enumerates values returned by several types and taken as a parameter of several types.
Enumerates values returned by several types.
Enumerates values returned by several types.
Enumerates values returned by several types and taken as a parameter of the F:Android.App.UiAutomation.SetRotation member.
Enumerates values returned by several types.
Источник