Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae7067f5 authored by Scott Main's avatar Scott Main
Browse files

docs: update optimization guide with more info

most importantly, information about using <compatible-screens>
also add sample code to <compatible-screens> doc

Change-Id: I62f6ceee4e358a18f5e513cf54c9c96f27470ae9
parent 9f187296
Loading
Loading
Loading
Loading
+379 −100

File changed.

Preview size limit exceeded, changes collapsed.

+32 −0
Original line number Original line Diff line number Diff line
@@ -101,6 +101,38 @@ href="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple
    </dd>
    </dd>
  </dl>
  </dl>
</dd>
</dd>

<dt>example</dt>
<dd>
<p>If your application is compatible with only small and normal screens, regardless
of screen density, then you must specify eight different {@code &lt;screen&gt;} elements,
because each screen size has four different density configurations. You must declare each one of
these; any combination of size and density that you do <em>not</em> specify is considered a screen
configuration with which your application is <em>not</em> compatible. Here's what the manifest
entry looks like if your application is compatible with only small and normal screens:</p>

<pre>
&lt;manifest ... >
    ...
    &lt;compatible-screens>
        &lt;!-- all small size screens -->
        &lt;screen android:screenSize="small" android:screenDensity="ldpi" />
        &lt;screen android:screenSize="small" android:screenDensity="mdpi" />
        &lt;screen android:screenSize="small" android:screenDensity="hdpi" />
        &lt;screen android:screenSize="small" android:screenDensity="xhdpi" />
        &lt;!-- all normal size screens -->
        &lt;screen android:screenSize="normal" android:screenDensity="ldpi" />
        &lt;screen android:screenSize="normal" android:screenDensity="mdpi" />
        &lt;screen android:screenSize="normal" android:screenDensity="hdpi" />
        &lt;screen android:screenSize="normal" android:screenDensity="xhdpi" />
    &lt;/compatible-screens>
    &lt;application ... >
        ...
    &lt;application>
&lt;/manifest>
</pre>
</dd>

<dt>introduced in:</dt>
<dt>introduced in:</dt>
<dd>API Level 9</dd>
<dd>API Level 9</dd>
<dt>see also:</dt>
<dt>see also:</dt>
+3 −3
Original line number Original line Diff line number Diff line
@@ -595,7 +595,7 @@ orientation" described above.</p>
    </tr>
    </tr>
-->
-->
    <tr id="VersionQualifier">
    <tr id="VersionQualifier">
      <td>System Version (API Level)</td>
      <td>Platform Version (API Level)</td>
      <td>Examples:<br/>
      <td>Examples:<br/>
        <code>v3</code><br/>
        <code>v3</code><br/>
        <code>v4</code><br/>
        <code>v4</code><br/>
@@ -608,7 +608,7 @@ orientation" described above.</p>
href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a> document for more information
href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a> document for more information
about these values.</p>
about these values.</p>
        <p class="caution"><strong>Caution:</strong> Android 1.5 and 1.6 only match resources
        <p class="caution"><strong>Caution:</strong> Android 1.5 and 1.6 only match resources
with this qualifier when it exactly matches the system version. See the section below about <a
with this qualifier when it exactly matches the platform version. See the section below about <a
href="#KnownIssues">Known Issues</a> for more information.</p>
href="#KnownIssues">Known Issues</a> for more information.</p>
      </td>
      </td>
    </tr>
    </tr>
@@ -974,7 +974,7 @@ href="accessing-resources.html">Accessing Resources</a>.</p>


<p>The correct behavior is for the system to match resources marked with a <a
<p>The correct behavior is for the system to match resources marked with a <a
href="#VersionQualifier">version qualifier</a> equal
href="#VersionQualifier">version qualifier</a> equal
to or less than the system version on the device, but on Android 1.5 and 1.6, (API Level 3 and 4),
to or less than the platform version on the device, but on Android 1.5 and 1.6, (API Level 3 and 4),
there is a bug that causes the system to match resources marked with the version qualifier
there is a bug that causes the system to match resources marked with the version qualifier
only when it exactly matches the version on the device.</p>
only when it exactly matches the version on the device.</p>