Книга: Beginning Android

In the Beginning There Was the Root, and It Was Good

In the Beginning There Was the Root, and It Was Good

The root of all manifest files is, not surprisingly, a manifest element:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.commonsware.android.search">
 ...
</manifest>

Note the namespace declaration. Curiously, the generated manifests apply it only on the attributes, not the elements (e.g., it’s manifest, not android:manifest). However, that pattern works, so unless Android changes, stick with their pattern.

The biggest piece of information you need to supply on the manifest element is the package attribute (also curiously not namespaced). Here you can provide the name of the Java package that will be considered the “base” of your application. Then, everywhere else in the manifest file that needs a class name, you can just substitute a leading dot as shorthand for the package. For example, if you needed to refer to com.commonsware.android.search.Snicklefritz in our example manifest, you could just use .Snicklefritz since com.commonsware.android.search is defined as the application’s package.

Оглавление книги


Генерация: 2.192. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз