From 08320015f853d014238b24716cb6cf01c5ff68bf Mon Sep 17 00:00:00 2001
From: Joe Fernandez
To add the AIDL to your project:
IInAppBillingService.java file gets generated.
If you are not familiar with AVDs or how to use them, see Managing Virtual Devices.
above — either on an actual device or on an emulator — make sure to update your application project or build scripts as needed, so that your compiled.apk files that use licensing are deployed into that environment.
-In particular, if you are developing in Eclipse, make sure that you set up a
+In particular, if you are developing in Android Studio, make sure that you set up a
Run/Debug Configuration that targets the appropriate device or AVD.
You do not need to make any changes to your application's @@ -323,28 +326,22 @@ across all of your projects and maintain it centrally.
The LVL is provided as a configured library project — once you have downloaded it, you can start using it right away.
-If you are working in Eclipse with ADT, you need to add the LVL to your -workspace as a new development project, in the same way as you would a new -application project.
+If you are working in Android Studio, you need to add the LVL to your +project as a new module.
library directory
-(the directory containing the library's AndroidManifest.xml file) as the project
-root.library directory (the directory containing the library's AndroidManifest.xml file)
+as the project root ({@code <sdk>/extras/google/play_licensing/library/AndroidManifest.xml}),
+then select Next. When created, the project is
-predefined as a library project in its project.properties file, so
-no further configuration is needed.
For more information about how to create an application project or work with -library projects in Eclipse, see Managing Projects from -Eclipse with ADT.
+For more information about how to work with library modules in Android Studio, see +Managing Projects from +Android Studio.
If you are developing in Eclipse with ADT, you should already have added the -library project to your workspace, as described in the previous section. If you +
If you are developing in Android Studio, you should already have added the +library module to your project, as described in the previous section. If you haven't done that already, do it now before continuing.
-Next, open the application's project properties window, as shown below. -Select the "Android" properties group and click Add, then -choose the LVL library project (com_android_vending_licensing) and click -OK. For more information, see - -Managing Projects from Eclipse with ADT
. - - -
-Figure 3. If you are -working in Eclipse with ADT, you can add the LVL library project to your -application from the application's project properties.
- -If you are developing using the SDK command-line tools, navigate to the
directory containing your application project and open the
project.properties file. Add a line to the file that specifies the
diff --git a/docs/html/guide/components/aidl.jd b/docs/html/guide/components/aidl.jd
old mode 100644
new mode 100755
index 0be6e6fa56b31..78fa99696b7b5
--- a/docs/html/guide/components/aidl.jd
+++ b/docs/html/guide/components/aidl.jd
@@ -190,11 +190,11 @@ project's {@code gen/} directory. The generated file name matches the {@code .ai
with a {@code .java} extension (for example, {@code IRemoteService.aidl} results in {@code
IRemoteService.java}).
If you use Eclipse, the incremental build generates the binder class almost immediately. If you
-do not use Eclipse, then the Ant tool generates the binder class next time you build your
-application—you should build your project with ant debug (or ant
-release) as soon as you're finished writing the {@code .aidl} file, so that your code can
-link against the generated class.
If you use Android Studio, the incremental build generates the binder class almost immediately.
+If you do not use Android Studio, then the Gradle tool generates the binder class next time you
+build your application—you should build your project with gradle assembleDebug
+(or gradle assembleRelease) as soon as you're finished writing the {@code .aidl} file,
+so that your code can link against the generated class.
Here is an example implementation of an interface called {@code IRemoteService} (defined by the {@code IRemoteService.aidl} example, above) using an anonymous instance:
- +
private final IRemoteService.Stub mBinder = new IRemoteService.Stub() {
public int getPid(){
@@ -324,7 +324,7 @@ href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos.
-
+
Passing Objects over IPC
diff --git a/docs/html/legal.jd b/docs/html/legal.jd
old mode 100644
new mode 100755
index 5ee6b5c314952..0a685082d5d7d
--- a/docs/html/legal.jd
+++ b/docs/html/legal.jd
@@ -70,12 +70,10 @@ Policy & Terms of Service.
restrictions. Such services include:
The simplest place to begin investigating your app’s memory usage is the runtime log messages. Sometimes when a GC occurs, a message is printed to logcat. The logcat output is also available in the -Device Monitor or directly in IDEs such as Eclipse and Android Studio.
+Device Monitor or directly in an IDE such as Android Studio.Use Android Studio to view your app's memory use:
-You can also still perform these procedures in the Android monitor:
@@ -655,10 +655,12 @@ HPROF tool. The major difference in an Android heap dump is due to the fact that number of allocations in the Zygote process. But because the Zygote allocations are shared across all app processes, they don’t matter very much to your own heap analysis. -To analyze your heap dump, you can use a standard tool like jhat or the Eclipse Memory Analyzer Tool (MAT). However, first +
To analyze your heap dump, you can use Memory Monitor in Android Studio.
+You can also use a standard tool like jhat. However, first
you'll need to convert the HPROF file from Android's format to the J2SE HPROF format. You can do
-this using the hprof-conv tool provided in the <sdk>/platform-tools/
+this using the hprof-conv tool provided in the
+<sdk>/platform-tools/
directory. Simply run the hprof-conv command with two arguments: the original HPROF
file and the location to write the converted HPROF file. For example:
Note: If you're using the version of DDMS that's integrated into -Eclipse, you do not need to perform the HPROF conversation—it performs the conversion by -default.
-You can now load the converted file in MAT or another heap analysis tool that understands + +
You can now load the converted file into a heap analysis tool that understands the J2SE HPROF format.
When analyzing your heap, you should look for memory leaks caused by:
@@ -682,77 +682,6 @@ reference to the container Activity or Context. -The Eclipse Memory Analyzer Tool (MAT) is just one -tool that you can use to analyze your heap dump. It's also quite powerful so most of its -capabilities are beyond the scope of this document, but here are a few tips to get you started. - -
Once you open your converted HPROF file in MAT, you'll see a pie chart in the Overview, -showing what your largest objects are. Below this chart, are links to couple of useful features:
- -You might want to use this view to find extra instances of classes for which you know there - should be only a certain number. For example, a common source of leaks is additional instance of - your {@link android.app.Activity} class, for which you should usually have only one instance - at a time. To find a specific class instance, type the class name into the <Regex> - field at the top of the list. -
When you find a class with too many instances, right-click it and select - List objects > with incoming references. In the list that - appears, you can determine where an instance is retained by right-clicking it and selecting - Path To GC Roots > exclude weak references.
-What you should look for is anything that's retaining a portion of heap that's roughly - equivalent to the memory size you observed leaking from the GC logs, - heap updates, or allocation - tracker. -
When you see something suspicious, right-click on the item and select - Path To GC Roots > exclude weak references. This opens a - new tab that traces the references to that object which is causing the alleged leak.
- -Note: Most apps will show an instance of - {@link android.content.res.Resources} near the top with a good chunk of heap, but this is - usually expected when your app uses lots of resources from your {@code res/} directory.
-
-Figure 4. The Eclipse Memory Analyzer Tool (MAT), -showing the Histogram view and a search for "MainActivity".
- -For more information about MAT, watch the Google I/O 2011 presentation, -Memory management for Android apps, -which includes a walkthrough using MAT beginning at about 21:10. -Also refer to the Eclipse Memory -Analyzer documentation.
- -You may find it useful to compare your app's heap state at two different points in time in order -to inspect the changes in memory allocation. To compare two heap dumps using MAT:
- -For more information about how to create an .apk file that you can install on an emulator/device instance, see Building and Running
-Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you.
+Note that, if you are using Android Studio, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, Android Studio handles the packaging and installation of the application for you.
diff --git a/docs/html/tools/help/sdk-manager.jd b/docs/html/tools/help/sdk-manager.jd old mode 100644 new mode 100755 index cc95edf6bf6a3..c8493dcfa3b5e --- a/docs/html/tools/help/sdk-manager.jd +++ b/docs/html/tools/help/sdk-manager.jd @@ -34,7 +34,7 @@ SDK checking:Tip: The standalone SDK Manager is still available from the -command line, but we recommend it only for use with Eclipse ADT and standalone SDK installations.
+command line, but we recommend it only for use with standalone SDK installations.By default, the SDK Manager installs the latest packages and tools. Click the checkbox next to each additional SDK platform and tool that you want to install. Clear the @@ -99,7 +99,7 @@ Android Virtual Devices (AVDs) in the Android APIs (such as fragments, plus others not included in the framework at all) on devices running a platform version as old as Android 1.6. All of the activity templates available when creating -a new project with the ADT Plugin +a new project with Android Studio require this. For more information, read Support Library. diff --git a/docs/html/tools/help/zipalign.jd b/docs/html/tools/help/zipalign.jd old mode 100644 new mode 100755 index 184cdcb6ad227..c70810cd66df1 --- a/docs/html/tools/help/zipalign.jd +++ b/docs/html/tools/help/zipalign.jd @@ -16,12 +16,12 @@ when running the application.
This tool should always be used to align your .apk file before distributing it to end-users. The Android build tools can handle -this for you. When using Eclipse with the ADT plugin, the Export Wizard -will automatically zipalign your .apk after it signs it with your private key. +this for you. Android Studio automatically aligns your .apk after it signs it with your +private key. The build scripts used -when compiling your application with Ant will also zipalign your .apk, +when compiling your application with Gradle also align your .apk, as long as you have provided the path to your keystore and the key alias in -your project {@code ant.properties} file, so that the build tools +your project {@code gradle.properties} file, so that the build tools can sign the package first.
Caution: zipalign must only be performed
diff --git a/docs/html/training/contacts-provider/retrieve-names.jd b/docs/html/training/contacts-provider/retrieve-names.jd
old mode 100644
new mode 100755
index d97b81b1e3406..49d6e955536c9
--- a/docs/html/training/contacts-provider/retrieve-names.jd
+++ b/docs/html/training/contacts-provider/retrieve-names.jd
@@ -230,7 +230,7 @@ public class ContactsFragment extends Fragment implements
{@link android.provider.ContactsContract.Contacts#DISPLAY_NAME_PRIMARY
Contacts.DISPLAY_NAME_PRIMARY} requires Android 3.0 (API version 11) or later, setting your
app's minSdkVersion to 10 or below generates an Android Lint warning in
- Eclipse with ADK. To turn off this warning, add the annotation
+ Android Studio. To turn off this warning, add the annotation
@SuppressLint("InlinedApi") before the definition of FROM_COLUMNS.
To add the In-app Billing Version 3 library to your new In-app Billing project:
.jar file.