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

Commit 022171be authored by Dirk Dougherty's avatar Dirk Dougherty
Browse files

Doc change: Add notes for SDK Tools r7 and ADT 0.9.8.

Change-Id: I7cc8301e0160acd0adb3efbd20c6515ed985684f
parent ca9d51b1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -438,10 +438,10 @@ framework_docs_SDK_CURRENT_DIR:=$(framework_docs_SDK_VERSION)_r$(framework_docs_
framework_docs_SDK_PREVIEW:=0

## Latest ADT version identifiers, for reference from published docs
framework_docs_ADT_VERSION:=0.9.7
framework_docs_ADT_DOWNLOAD:=ADT-0.9.7.zip
framework_docs_ADT_BYTES:=8033750
framework_docs_ADT_CHECKSUM:=de2431c8d4786d127ae5bfc95b4605df
framework_docs_ADT_VERSION:=0.9.8
framework_docs_ADT_DOWNLOAD:=ADT-0.9.8.zip
framework_docs_ADT_BYTES:=8703591
framework_docs_ADT_CHECKSUM:=22070f8e52924605a3b3abf87c1ba39f

framework_docs_LOCAL_DROIDDOC_OPTIONS += \
		-hdf sdk.version $(framework_docs_SDK_VERSION) \
+70 −12
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ page.title=Developing In Eclipse, with ADT
        <li><a href="#librarySetup">Setting up a library project</a></li>
        <li><a href="#libraryReference">Referencing a library project</a></li>
        <li><a href="#considerations">Development considerations</a></li>
        <li><a href="#libraryMigrating">Migrating library projects to ADT 0.9.8</a></li>
      </ol>
    </li>
    <li><a href="#Tips">Eclipse Tips</a></li>
@@ -644,10 +645,6 @@ across all projects). </p>
is because the library project is compiled by the main project to use the
correct resource IDs.</p>

<p><strong>One library project cannot reference another</strong></p>

<p>A library cannot depend on another library.</p>

<p><strong>A library project can include a JAR library</strong></p>

<p>You can develop a library project that itself includes a JAR library, however
@@ -664,13 +661,6 @@ application must declare the external library their manifest files, in a <a
href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>&lt;uses-library&gt;</code></a>
element. </p>

<p><strong>Library project can not include AIDL files</strong></p>

<p>The tools do not support the use of <a
href="{@docRoot}guide/developing/tools/aidl.html">AIDL</a> files in a library project.
Any AIDL files used by an application must be stored in the application project
itself.</p>

<p><strong>Library project can not include raw assets</strong></p>

<p>The tools do not support the use of raw asset files in a library project.
@@ -730,6 +720,74 @@ project can reference the library project by a relative link. You can place the
library project What is important is that the main project can reference the
library project through a relative link.</p>

<h3 id="libraryMigrating">Migrating library projects to ADT 0.9.8</h3>

<p>This section provides information about how to migrate a library project
created with ADT 0.9.7 to ADT 0.9.8 (or higher). The migration is needed only if
you are developing in Eclipse with ADT and assumes that you have also upgraded
to SDK Tools r7 (or higher). </p>

<p>The way that ADT handles library projects has changed between
ADT 0.9.7 and ADT 0.9.8. Specifically, in ADT 0.9.7, the <code>src/</code>
source folder of the library was linked into the dependent application project
as a folder that had the same name as the library project. This worked because
of two restrictions on the library projects:</p>

<ul>
<li>The library was only able to contain a single source folder (excluding the
special <code>gen/</code> source folder), and</li>
<li>The source folder was required to have the name <code>src/</code> and be
stored at the root of the project.</li>
</ul>

<p>In ADT 0.9.8, both of those restrictions were removed. A library project can
have as many source folders as needed and each can have any name. Additionally,
a library project can store source folders in any location of the project. For
example, you could store sources in a <code>src/java/</code> directory. In order
to support this, the name of the linked source folders in the main project are
now called &lt;<em>library-name</em>&gt;_&lt;<em>folder-name</em>&gt; For
example: <code>MyLibrary_src/</code> or <code>MyLibrary_src_java/</code>.</p>

<p>Additionally, the linking process now flags those folders in order for ADT to
recognize that it created them. This will allow ADT to automatically migrate the
project to new versions of ADT, should they contain changes to the handling of
library projects. ADT 0.9.7 did not flag the linked source folders, so ADT 0.9.8
cannot be sure whether the old linked folders can be removed safely. After
upgrading ADT to 0.9.8, you will need to remove the old linked folders manually
in a simple two-step process, as described below.</p>

<p>Before you begin, make sure to create a backup copy of your application or
save the latest version to your code version control system. This ensures that
you will be able to easily revert the migration changes in case there is a
problem in your environment.</p>

<p>When you first upgrade to ADT 0.9.8, your main project will look as shown
below, with two linked folders (in this example, <code>MyLibrary</code> and
<code>MyLibrary_src</code> &mdash; both of which link to
<code>MyLibrary/src</code>. Eclipse shows an error on one of them because they
are duplicate links to a single class.</p>

<img src="{@docRoot}images/developing/lib-migration-0.png" alt="">

<p>To fix the error, remove the linked folder that <em>does not</em> contain the
<code>_src</code> suffix. </p>

<ol>
<li>Right click the folder that you want to remove (in this case, the
<code>MyLibrary</code> folder) and choose <strong>Build Path</strong> &gt;
<strong>Remove from Build Path</strong>, as shown below.</li>

<img src="{@docRoot}images/developing/lib-migration-1.png" style="height:600px"
alt="">

<li>Next, When asked about unlinking the folder from the project, select
<strong>Yes</strong>, as shown below.</li>

<img src="{@docRoot}images/developing/lib-migration-2.png" alt="">
</ol>

<p>This should resolve the error and migrate your library project to the new
ADT environment. </p>

<h2 id="Tips">Eclipse Tips</h2>

+0 −11
Original line number Diff line number Diff line
@@ -838,10 +838,6 @@ across all projects). </p>
is because the library project is compiled by the main project to use the
correct resource IDs.</p>

<p><strong>One library project cannot reference another</strong></p>

<p>A library cannot depend on another library.</p>

<p><strong>A library project can include a JAR library</strong></p>

<p>You can develop a library project that itself includes a JAR library. When
@@ -858,13 +854,6 @@ application must declare the external library their manifest files, in a <a
href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>&lt;uses-library&gt;</code></a>
element. </p>

<p><strong>Library project cannot include AIDL files</strong></p>

<p>The tools do not support the use of <a
href="{@docRoot}guide/developing/tools/aidl.html">AIDL</a> files in a library project.
Any AIDL files used by an application must be stored in the application project
itself.</p>

<p><strong>Library project cannot include raw assets</strong></p>

<p>The tools do not support the use of raw asset files in a library project.
+26.2 KiB
Loading image diff...
+91.3 KiB
Loading image diff...
Loading