From d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 3 Mar 2009 18:28:45 -0800 Subject: auto import from //depot/cupcake/@135843 --- docs/html/app.yaml | 11 - docs/html/blog/blog_toc.cs | 1 - docs/html/blog/index.jd | 4 - docs/html/community/index.jd | 118 -- docs/html/favicon.ico | Bin 1150 -> 0 bytes docs/html/googleb38c1d60b7ba5d19.html | 0 docs/html/guide/appendix/app-intents.jd | 106 -- docs/html/guide/appendix/faq/commontasks.jd | 812 --------- docs/html/guide/appendix/faq/framework.jd | 198 --- docs/html/guide/appendix/faq/index.jd | 15 - docs/html/guide/appendix/faq/licensingandoss.jd | 19 - docs/html/guide/appendix/faq/security.jd | 156 -- docs/html/guide/appendix/faq/troubleshooting.jd | 305 ---- docs/html/guide/appendix/g-app-intents.jd | 112 -- docs/html/guide/appendix/glossary.jd | 293 ---- docs/html/guide/appendix/index.jd | 13 - docs/html/guide/appendix/media-formats.jd | 197 --- docs/html/guide/basics/appmodel.jd | 261 --- docs/html/guide/basics/building-blocks.jd | 76 - docs/html/guide/basics/fixme-gs-core-packages.jd | 92 -- docs/html/guide/basics/index.html | 8 - docs/html/guide/basics/what-is-android.jd | 135 -- docs/html/guide/developing/app-signing.jd | 428 ----- docs/html/guide/developing/debug-tasks.jd | 207 --- docs/html/guide/developing/device.jd | 163 -- docs/html/guide/developing/eclipse-adt.jd | 193 --- docs/html/guide/developing/index.html | 8 - docs/html/guide/developing/other-ide.jd | 167 -- docs/html/guide/developing/tools/aapt.jd | 20 - docs/html/guide/developing/tools/adb.jd | 699 -------- docs/html/guide/developing/tools/adt.jd | 154 -- docs/html/guide/developing/tools/aidl.jd | 302 ---- docs/html/guide/developing/tools/ddms.jd | 250 --- docs/html/guide/developing/tools/draw9patch.jd | 58 - docs/html/guide/developing/tools/emulator.jd | 1736 -------------------- .../guide/developing/tools/hierarchy-viewer.jd | 98 -- docs/html/guide/developing/tools/index.jd | 88 - docs/html/guide/developing/tools/monkey.jd | 240 --- docs/html/guide/developing/tools/othertools.jd | 104 -- docs/html/guide/developing/tools/traceview.jd | 310 ---- docs/html/guide/guide_toc.cs | 189 --- docs/html/guide/index.jd | 84 - docs/html/guide/practices/design/index.jd | 21 - docs/html/guide/practices/design/performance.jd | 549 ------- docs/html/guide/practices/design/responsiveness.jd | 117 -- docs/html/guide/practices/design/seamlessness.jd | 242 --- docs/html/guide/practices/index.html | 8 - docs/html/guide/publishing/app-signing.jd | 489 ------ docs/html/guide/publishing/preparing.jd | 252 --- docs/html/guide/publishing/publishing.jd | 250 --- docs/html/guide/publishing/versioning.jd | 155 -- docs/html/guide/samples/index.jd | 23 - docs/html/guide/topics/data/data-storage.jd | 199 --- docs/html/guide/topics/data/index.html | 9 - docs/html/guide/topics/drawing/index.html | 9 - docs/html/guide/topics/drawing/opengl.jd | 53 - docs/html/guide/topics/fundamentals.jd | 1726 ------------------- docs/html/guide/topics/geo/lbs.jd | 73 - docs/html/guide/topics/geo/mapkey.jd | 28 - docs/html/guide/topics/graphics/2d-graphics.jd | 480 ------ docs/html/guide/topics/graphics/index.jd | 203 --- docs/html/guide/topics/graphics/opengl.jd | 56 - docs/html/guide/topics/index.html | 8 - docs/html/guide/topics/intents/index.html | 9 - docs/html/guide/topics/intents/intents-filters.jd | 693 -------- docs/html/guide/topics/location/geo/mapkey.jd | 210 --- docs/html/guide/topics/location/index.jd | 109 -- docs/html/guide/topics/manifest/action-element.jd | 46 - .../topics/manifest/activity-alias-element.jd | 129 -- .../html/guide/topics/manifest/activity-element.jd | 565 ------- .../guide/topics/manifest/application-element.jd | 226 --- .../html/guide/topics/manifest/category-element.jd | 38 - docs/html/guide/topics/manifest/data-element.jd | 148 -- .../manifest/grant-uri-permission-element.jd | 85 - .../topics/manifest/instrumentation-element.jd | 61 - .../guide/topics/manifest/intent-filter-element.jd | 130 -- .../html/guide/topics/manifest/manifest-element.jd | 94 -- docs/html/guide/topics/manifest/manifest-intro.jd | 511 ------ .../guide/topics/manifest/meta-data-element.jd | 90 - .../guide/topics/manifest/permission-element.jd | 131 -- .../topics/manifest/permission-group-element.jd | 59 - .../topics/manifest/permission-tree-element.jd | 61 - .../html/guide/topics/manifest/provider-element.jd | 267 --- .../html/guide/topics/manifest/receiver-element.jd | 164 -- docs/html/guide/topics/manifest/service-element.jd | 176 -- .../guide/topics/manifest/uses-library-element.jd | 32 - .../topics/manifest/uses-permission-element.jd | 39 - .../html/guide/topics/manifest/uses-sdk-element.jd | 49 - docs/html/guide/topics/media/index.jd | 188 --- docs/html/guide/topics/media/media.jd | 172 -- .../guide/topics/processes/process-lifecycle.jd | 120 -- .../guide/topics/providers/content-providers.jd | 922 ----------- .../guide/topics/resources/available-resources.jd | 1135 ------------- docs/html/guide/topics/resources/index.jd | 40 - docs/html/guide/topics/resources/resources-i18n.jd | 704 -------- docs/html/guide/topics/security/security.jd | 397 ----- docs/html/guide/topics/sensors/accelerometer.jd | 18 - docs/html/guide/topics/sensors/camera.jd | 18 - docs/html/guide/topics/sensors/compass.jd | 18 - docs/html/guide/topics/sensors/index.jd | 13 - docs/html/guide/topics/ui/binding.jd | 113 -- docs/html/guide/topics/ui/custom-components.jd | 563 ------- docs/html/guide/topics/ui/declaring-layout.jd | 275 ---- docs/html/guide/topics/ui/how-android-draws.jd | 94 -- docs/html/guide/topics/ui/index.jd | 235 --- docs/html/guide/topics/ui/layout-objects.jd | 305 ---- docs/html/guide/topics/ui/menus.jd | 522 ------ docs/html/guide/topics/ui/themes.jd | 182 -- docs/html/guide/topics/ui/ui-events.jd | 283 ---- docs/html/guide/topics/views/custom-views.jd | 544 ------ docs/html/guide/topics/views/intro.jd | 49 - docs/html/guide/topics/views/ui-xml.jd | 133 -- docs/html/guide/topics/wireless/bluetooth.jd | 18 - docs/html/guide/topics/wireless/index.jd | 19 - docs/html/guide/topics/wireless/wifi.jd | 18 - docs/html/guide/tutorials/hello-android.jd | 473 ------ docs/html/guide/tutorials/hello-world.jd | 500 ------ docs/html/guide/tutorials/images/hello_world_0.png | Bin 30614 -> 0 bytes docs/html/guide/tutorials/images/hello_world_1.png | Bin 38174 -> 0 bytes docs/html/guide/tutorials/images/hello_world_2.png | Bin 67830 -> 0 bytes docs/html/guide/tutorials/images/hello_world_3.png | Bin 60750 -> 0 bytes docs/html/guide/tutorials/images/hello_world_4.png | Bin 61711 -> 0 bytes docs/html/guide/tutorials/images/hello_world_5.png | Bin 6244 -> 0 bytes docs/html/guide/tutorials/images/hello_world_8.png | Bin 10993 -> 0 bytes docs/html/guide/tutorials/images/hello_world_9.png | Bin 25933 -> 0 bytes docs/html/guide/tutorials/index.html | 8 - .../tutorials/notepad/codelab/NotepadCodeLab.zip | Bin 431473 -> 0 bytes docs/html/guide/tutorials/notepad/index.jd | 142 -- docs/html/guide/tutorials/notepad/notepad-ex1.jd | 589 ------- docs/html/guide/tutorials/notepad/notepad-ex2.jd | 647 -------- docs/html/guide/tutorials/notepad/notepad-ex3.jd | 358 ---- .../tutorials/notepad/notepad-extra-credit.jd | 70 - docs/html/guide/tutorials/notepad/notepad-index.jd | 143 -- .../guide/tutorials/views/hello-autocomplete.jd | 116 -- .../html/guide/tutorials/views/hello-datepicker.jd | 151 -- docs/html/guide/tutorials/views/hello-formstuff.jd | 262 --- docs/html/guide/tutorials/views/hello-gallery.jd | 135 -- docs/html/guide/tutorials/views/hello-gridview.jd | 128 -- .../guide/tutorials/views/hello-linearlayout.jd | 130 -- docs/html/guide/tutorials/views/hello-listview.jd | 90 - docs/html/guide/tutorials/views/hello-mapview.jd | 243 --- .../guide/tutorials/views/hello-relativelayout.jd | 75 - docs/html/guide/tutorials/views/hello-spinner.jd | 106 -- .../guide/tutorials/views/hello-tablelayout.jd | 118 -- docs/html/guide/tutorials/views/hello-tabwidget.jd | 124 -- .../html/guide/tutorials/views/hello-timepicker.jd | 159 -- docs/html/guide/tutorials/views/hello-webview.jd | 118 -- docs/html/guide/tutorials/views/images/android.png | Bin 693 -> 0 bytes .../guide/tutorials/views/images/androidmarker.png | Bin 702 -> 0 bytes .../tutorials/views/images/hello-autocomplete.png | Bin 4601 -> 0 bytes .../tutorials/views/images/hello-datepicker.png | Bin 7322 -> 0 bytes .../tutorials/views/images/hello-formstuff.png | Bin 4258 -> 0 bytes .../guide/tutorials/views/images/hello-gallery.png | Bin 5593 -> 0 bytes .../tutorials/views/images/hello-gridview.png | Bin 21768 -> 0 bytes .../tutorials/views/images/hello-linearlayout.png | Bin 4207 -> 0 bytes .../tutorials/views/images/hello-listview.png | Bin 6926 -> 0 bytes .../guide/tutorials/views/images/hello-mapview.png | Bin 16922 -> 0 bytes .../views/images/hello-relativelayout.png | Bin 2399 -> 0 bytes .../guide/tutorials/views/images/hello-spinner.png | Bin 2513 -> 0 bytes .../tutorials/views/images/hello-tablelayout.png | Bin 3446 -> 0 bytes .../tutorials/views/images/hello-tabwidget.png | Bin 2117 -> 0 bytes .../tutorials/views/images/hello-timepicker.png | Bin 5644 -> 0 bytes .../guide/tutorials/views/images/hello-webview.png | Bin 5874 -> 0 bytes docs/html/guide/tutorials/views/index.jd | 118 -- docs/html/images/activity_lifecycle.png | Bin 66148 -> 0 bytes docs/html/images/android_adc.gif | Bin 2335 -> 0 bytes docs/html/images/android_icon_125.png | Bin 4628 -> 0 bytes docs/html/images/anr.png | Bin 13005 -> 0 bytes docs/html/images/binder_rpc.png | Bin 30742 -> 0 bytes docs/html/images/content_uri.png | Bin 5388 -> 0 bytes docs/html/images/designing_ui_layout_example.png | Bin 7774 -> 0 bytes docs/html/images/designing_ui_relative_layout.png | Bin 46542 -> 0 bytes docs/html/images/draw9patch-bad.png | Bin 20089 -> 0 bytes docs/html/images/draw9patch-norm.png | Bin 21841 -> 0 bytes docs/html/images/e-mini-hvga-l.png | Bin 8698 -> 0 bytes docs/html/images/e-mini-hvga-p.png | Bin 8784 -> 0 bytes docs/html/images/e-mini-qvga-l.png | Bin 19315 -> 0 bytes docs/html/images/e-mini-qvga-p.png | Bin 7170 -> 0 bytes docs/html/images/emulator-hvga-p.png | Bin 133613 -> 0 bytes docs/html/images/emulator.png | Bin 228108 -> 0 bytes docs/html/images/gradient_drawable.png | Bin 518 -> 0 bytes docs/html/images/hello_world_0.png | Bin 30614 -> 0 bytes docs/html/images/hello_world_1.png | Bin 38174 -> 0 bytes docs/html/images/hello_world_2.png | Bin 67830 -> 0 bytes docs/html/images/hello_world_3.png | Bin 60750 -> 0 bytes docs/html/images/hello_world_4.png | Bin 61711 -> 0 bytes docs/html/images/hello_world_5.png | Bin 6244 -> 0 bytes docs/html/images/hello_world_8.png | Bin 10993 -> 0 bytes docs/html/images/hello_world_9.png | Bin 28538 -> 0 bytes docs/html/images/hierarchyviewer-layout.png | Bin 49085 -> 0 bytes docs/html/images/hierarchyviewer-pixelperfect.png | Bin 72830 -> 0 bytes docs/html/images/icon_barriers.png | Bin 3692 -> 0 bytes docs/html/images/icon_equal.png | Bin 3650 -> 0 bytes docs/html/images/icon_fast.png | Bin 3501 -> 0 bytes docs/html/images/icon_open.png | Bin 3395 -> 0 bytes docs/html/images/layoutparams.png | Bin 42180 -> 0 bytes docs/html/images/like_thumb1.png | Bin 25822 -> 0 bytes docs/html/images/like_thumb2.png | Bin 24049 -> 0 bytes docs/html/images/like_thumb3.png | Bin 24822 -> 0 bytes docs/html/images/like_thumb4.png | Bin 19900 -> 0 bytes docs/html/images/linearlayout.png | Bin 10100 -> 0 bytes docs/html/images/logo_android.gif | Bin 2849 -> 0 bytes docs/html/images/mediaplayer_state_diagram.gif | Bin 23582 -> 0 bytes docs/html/images/mediarecorder_state_diagram.gif | Bin 21124 -> 0 bytes docs/html/images/ninepatch_examples.png | Bin 2555 -> 0 bytes docs/html/images/ninepatch_raw.png | Bin 19137 -> 0 bytes docs/html/images/no_scrollview.png | Bin 9406 -> 0 bytes docs/html/images/notepad.png | Bin 7059 -> 0 bytes docs/html/images/options_menu.png | Bin 24241 -> 0 bytes docs/html/images/padding_margins.png | Bin 6689 -> 0 bytes docs/html/images/radio_buttons.png | Bin 24017 -> 0 bytes docs/html/images/service_lifecycle.png | Bin 59286 -> 0 bytes docs/html/images/setting_width_and_height.png | Bin 6696 -> 0 bytes docs/html/images/system-architecture.jpg | Bin 198676 -> 0 bytes docs/html/images/table_layout.png | Bin 3456 -> 0 bytes docs/html/images/tracedump.png | Bin 584919 -> 0 bytes docs/html/images/traceview_profile.png | Bin 199686 -> 0 bytes docs/html/images/traceview_timeline.png | Bin 24822 -> 0 bytes docs/html/images/video_thumb_dan.png | Bin 7920 -> 0 bytes docs/html/images/video_thumb_mike.png | Bin 8206 -> 0 bytes docs/html/images/viewgroup.png | Bin 14243 -> 0 bytes docs/html/images/views_autocomplete.png | Bin 7194 -> 0 bytes docs/html/images/views_controls_example2.png | Bin 6797 -> 0 bytes .../images/views_datewidgets_example1_pickdate.png | Bin 9347 -> 0 bytes .../images/views_datewidgets_example1_picktime.png | Bin 7720 -> 0 bytes docs/html/images/views_gallery_example1.png | Bin 7796 -> 0 bytes docs/html/images/views_grid_example2.png | Bin 16972 -> 0 bytes docs/html/images/views_image_switcher.png | Bin 29639 -> 0 bytes docs/html/images/views_imagebutton_example1.png | Bin 2810 -> 0 bytes .../images/views_layouts_linearlayout_example1.png | Bin 6486 -> 0 bytes .../images/views_layouts_linearlayout_example7.png | Bin 2957 -> 0 bytes .../views_layouts_relativelayout_example2.png | Bin 67960 -> 0 bytes .../images/views_layouts_tablelayout_example10.png | Bin 7053 -> 0 bytes .../images/views_layouts_tablelayout_spanning.png | Bin 68627 -> 0 bytes docs/html/images/views_lists_example1.png | Bin 9479 -> 0 bytes docs/html/images/views_spinner.png | Bin 4012 -> 0 bytes docs/html/images/zippy_bullet.gif | Bin 52 -> 0 bytes docs/html/images/zippy_closed.gif | Bin 56 -> 0 bytes docs/html/images/zippy_open.gif | Bin 54 -> 0 bytes docs/html/index.jd | 157 -- docs/html/license.jd | 143 -- docs/html/maps-api-signup.html | 369 ----- docs/html/maps-api-tos.pdf | Bin 97303 -> 0 bytes docs/html/offline.jd | 36 - docs/html/publish/index.jd | 5 - docs/html/publish/publish_toc.cs | 1 - docs/html/reference/index.html | 8 - docs/html/reference/reference_toc.cs | 1 - docs/html/robots.txt | 6 - docs/html/samples/index.jd | 23 - docs/html/sdk/1.0_r1/index.jd | 64 - docs/html/sdk/1.0_r1/installing.jd | 124 -- docs/html/sdk/1.0_r1/upgrading.jd | 151 -- docs/html/sdk/1.0_r2/index.jd | 64 - docs/html/sdk/1.0_r2/installing.jd | 124 -- docs/html/sdk/1.0_r2/upgrading.jd | 151 -- docs/html/sdk/1.1_r1/index.jd | 62 - docs/html/sdk/1.1_r1/installing.jd | 223 --- docs/html/sdk/1.1_r1/requirements.jd | 42 - docs/html/sdk/1.1_r1/upgrading.jd | 150 -- docs/html/sdk/RELEASENOTES.jd | 327 ---- docs/html/sdk/adt_download.jd | 65 - docs/html/sdk/android-1.1.jd | 249 --- docs/html/sdk/download.jd | 86 - docs/html/sdk/index.jd | 5 - docs/html/sdk/sdk_toc.cs | 26 - docs/html/sdk/terms.jd | 219 --- docs/html/sdk/terms_body.html | 216 --- docs/html/search.jd | 60 - docs/html/security_at_android_dot_com.txt | 40 - 270 files changed, 32800 deletions(-) delete mode 100644 docs/html/app.yaml delete mode 100644 docs/html/blog/blog_toc.cs delete mode 100644 docs/html/blog/index.jd delete mode 100644 docs/html/community/index.jd delete mode 100644 docs/html/favicon.ico delete mode 100644 docs/html/googleb38c1d60b7ba5d19.html delete mode 100644 docs/html/guide/appendix/app-intents.jd delete mode 100644 docs/html/guide/appendix/faq/commontasks.jd delete mode 100644 docs/html/guide/appendix/faq/framework.jd delete mode 100644 docs/html/guide/appendix/faq/index.jd delete mode 100644 docs/html/guide/appendix/faq/licensingandoss.jd delete mode 100644 docs/html/guide/appendix/faq/security.jd delete mode 100644 docs/html/guide/appendix/faq/troubleshooting.jd delete mode 100644 docs/html/guide/appendix/g-app-intents.jd delete mode 100644 docs/html/guide/appendix/glossary.jd delete mode 100644 docs/html/guide/appendix/index.jd delete mode 100644 docs/html/guide/appendix/media-formats.jd delete mode 100644 docs/html/guide/basics/appmodel.jd delete mode 100644 docs/html/guide/basics/building-blocks.jd delete mode 100644 docs/html/guide/basics/fixme-gs-core-packages.jd delete mode 100644 docs/html/guide/basics/index.html delete mode 100644 docs/html/guide/basics/what-is-android.jd delete mode 100644 docs/html/guide/developing/app-signing.jd delete mode 100644 docs/html/guide/developing/debug-tasks.jd delete mode 100644 docs/html/guide/developing/device.jd delete mode 100644 docs/html/guide/developing/eclipse-adt.jd delete mode 100644 docs/html/guide/developing/index.html delete mode 100644 docs/html/guide/developing/other-ide.jd delete mode 100644 docs/html/guide/developing/tools/aapt.jd delete mode 100644 docs/html/guide/developing/tools/adb.jd delete mode 100644 docs/html/guide/developing/tools/adt.jd delete mode 100644 docs/html/guide/developing/tools/aidl.jd delete mode 100644 docs/html/guide/developing/tools/ddms.jd delete mode 100644 docs/html/guide/developing/tools/draw9patch.jd delete mode 100644 docs/html/guide/developing/tools/emulator.jd delete mode 100644 docs/html/guide/developing/tools/hierarchy-viewer.jd delete mode 100644 docs/html/guide/developing/tools/index.jd delete mode 100644 docs/html/guide/developing/tools/monkey.jd delete mode 100644 docs/html/guide/developing/tools/othertools.jd delete mode 100644 docs/html/guide/developing/tools/traceview.jd delete mode 100644 docs/html/guide/guide_toc.cs delete mode 100644 docs/html/guide/index.jd delete mode 100644 docs/html/guide/practices/design/index.jd delete mode 100644 docs/html/guide/practices/design/performance.jd delete mode 100644 docs/html/guide/practices/design/responsiveness.jd delete mode 100644 docs/html/guide/practices/design/seamlessness.jd delete mode 100644 docs/html/guide/practices/index.html delete mode 100644 docs/html/guide/publishing/app-signing.jd delete mode 100644 docs/html/guide/publishing/preparing.jd delete mode 100644 docs/html/guide/publishing/publishing.jd delete mode 100644 docs/html/guide/publishing/versioning.jd delete mode 100644 docs/html/guide/samples/index.jd delete mode 100644 docs/html/guide/topics/data/data-storage.jd delete mode 100644 docs/html/guide/topics/data/index.html delete mode 100644 docs/html/guide/topics/drawing/index.html delete mode 100644 docs/html/guide/topics/drawing/opengl.jd delete mode 100644 docs/html/guide/topics/fundamentals.jd delete mode 100644 docs/html/guide/topics/geo/lbs.jd delete mode 100644 docs/html/guide/topics/geo/mapkey.jd delete mode 100644 docs/html/guide/topics/graphics/2d-graphics.jd delete mode 100644 docs/html/guide/topics/graphics/index.jd delete mode 100644 docs/html/guide/topics/graphics/opengl.jd delete mode 100644 docs/html/guide/topics/index.html delete mode 100644 docs/html/guide/topics/intents/index.html delete mode 100644 docs/html/guide/topics/intents/intents-filters.jd delete mode 100644 docs/html/guide/topics/location/geo/mapkey.jd delete mode 100644 docs/html/guide/topics/location/index.jd delete mode 100644 docs/html/guide/topics/manifest/action-element.jd delete mode 100644 docs/html/guide/topics/manifest/activity-alias-element.jd delete mode 100644 docs/html/guide/topics/manifest/activity-element.jd delete mode 100644 docs/html/guide/topics/manifest/application-element.jd delete mode 100644 docs/html/guide/topics/manifest/category-element.jd delete mode 100644 docs/html/guide/topics/manifest/data-element.jd delete mode 100644 docs/html/guide/topics/manifest/grant-uri-permission-element.jd delete mode 100644 docs/html/guide/topics/manifest/instrumentation-element.jd delete mode 100644 docs/html/guide/topics/manifest/intent-filter-element.jd delete mode 100644 docs/html/guide/topics/manifest/manifest-element.jd delete mode 100644 docs/html/guide/topics/manifest/manifest-intro.jd delete mode 100644 docs/html/guide/topics/manifest/meta-data-element.jd delete mode 100644 docs/html/guide/topics/manifest/permission-element.jd delete mode 100644 docs/html/guide/topics/manifest/permission-group-element.jd delete mode 100644 docs/html/guide/topics/manifest/permission-tree-element.jd delete mode 100644 docs/html/guide/topics/manifest/provider-element.jd delete mode 100644 docs/html/guide/topics/manifest/receiver-element.jd delete mode 100644 docs/html/guide/topics/manifest/service-element.jd delete mode 100644 docs/html/guide/topics/manifest/uses-library-element.jd delete mode 100644 docs/html/guide/topics/manifest/uses-permission-element.jd delete mode 100644 docs/html/guide/topics/manifest/uses-sdk-element.jd delete mode 100644 docs/html/guide/topics/media/index.jd delete mode 100644 docs/html/guide/topics/media/media.jd delete mode 100644 docs/html/guide/topics/processes/process-lifecycle.jd delete mode 100644 docs/html/guide/topics/providers/content-providers.jd delete mode 100644 docs/html/guide/topics/resources/available-resources.jd delete mode 100644 docs/html/guide/topics/resources/index.jd delete mode 100644 docs/html/guide/topics/resources/resources-i18n.jd delete mode 100644 docs/html/guide/topics/security/security.jd delete mode 100644 docs/html/guide/topics/sensors/accelerometer.jd delete mode 100644 docs/html/guide/topics/sensors/camera.jd delete mode 100644 docs/html/guide/topics/sensors/compass.jd delete mode 100644 docs/html/guide/topics/sensors/index.jd delete mode 100644 docs/html/guide/topics/ui/binding.jd delete mode 100644 docs/html/guide/topics/ui/custom-components.jd delete mode 100644 docs/html/guide/topics/ui/declaring-layout.jd delete mode 100644 docs/html/guide/topics/ui/how-android-draws.jd delete mode 100644 docs/html/guide/topics/ui/index.jd delete mode 100644 docs/html/guide/topics/ui/layout-objects.jd delete mode 100644 docs/html/guide/topics/ui/menus.jd delete mode 100644 docs/html/guide/topics/ui/themes.jd delete mode 100644 docs/html/guide/topics/ui/ui-events.jd delete mode 100644 docs/html/guide/topics/views/custom-views.jd delete mode 100644 docs/html/guide/topics/views/intro.jd delete mode 100644 docs/html/guide/topics/views/ui-xml.jd delete mode 100644 docs/html/guide/topics/wireless/bluetooth.jd delete mode 100644 docs/html/guide/topics/wireless/index.jd delete mode 100644 docs/html/guide/topics/wireless/wifi.jd delete mode 100644 docs/html/guide/tutorials/hello-android.jd delete mode 100644 docs/html/guide/tutorials/hello-world.jd delete mode 100644 docs/html/guide/tutorials/images/hello_world_0.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_1.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_2.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_3.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_4.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_5.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_8.png delete mode 100644 docs/html/guide/tutorials/images/hello_world_9.png delete mode 100644 docs/html/guide/tutorials/index.html delete mode 100644 docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip delete mode 100644 docs/html/guide/tutorials/notepad/index.jd delete mode 100644 docs/html/guide/tutorials/notepad/notepad-ex1.jd delete mode 100644 docs/html/guide/tutorials/notepad/notepad-ex2.jd delete mode 100644 docs/html/guide/tutorials/notepad/notepad-ex3.jd delete mode 100644 docs/html/guide/tutorials/notepad/notepad-extra-credit.jd delete mode 100644 docs/html/guide/tutorials/notepad/notepad-index.jd delete mode 100644 docs/html/guide/tutorials/views/hello-autocomplete.jd delete mode 100644 docs/html/guide/tutorials/views/hello-datepicker.jd delete mode 100644 docs/html/guide/tutorials/views/hello-formstuff.jd delete mode 100644 docs/html/guide/tutorials/views/hello-gallery.jd delete mode 100644 docs/html/guide/tutorials/views/hello-gridview.jd delete mode 100644 docs/html/guide/tutorials/views/hello-linearlayout.jd delete mode 100644 docs/html/guide/tutorials/views/hello-listview.jd delete mode 100644 docs/html/guide/tutorials/views/hello-mapview.jd delete mode 100644 docs/html/guide/tutorials/views/hello-relativelayout.jd delete mode 100644 docs/html/guide/tutorials/views/hello-spinner.jd delete mode 100644 docs/html/guide/tutorials/views/hello-tablelayout.jd delete mode 100644 docs/html/guide/tutorials/views/hello-tabwidget.jd delete mode 100644 docs/html/guide/tutorials/views/hello-timepicker.jd delete mode 100644 docs/html/guide/tutorials/views/hello-webview.jd delete mode 100755 docs/html/guide/tutorials/views/images/android.png delete mode 100755 docs/html/guide/tutorials/views/images/androidmarker.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-autocomplete.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-datepicker.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-formstuff.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-gallery.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-gridview.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-linearlayout.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-listview.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-mapview.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-relativelayout.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-spinner.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-tablelayout.png delete mode 100644 docs/html/guide/tutorials/views/images/hello-tabwidget.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-timepicker.png delete mode 100755 docs/html/guide/tutorials/views/images/hello-webview.png delete mode 100644 docs/html/guide/tutorials/views/index.jd delete mode 100644 docs/html/images/activity_lifecycle.png delete mode 100644 docs/html/images/android_adc.gif delete mode 100644 docs/html/images/android_icon_125.png delete mode 100644 docs/html/images/anr.png delete mode 100644 docs/html/images/binder_rpc.png delete mode 100644 docs/html/images/content_uri.png delete mode 100644 docs/html/images/designing_ui_layout_example.png delete mode 100644 docs/html/images/designing_ui_relative_layout.png delete mode 100644 docs/html/images/draw9patch-bad.png delete mode 100644 docs/html/images/draw9patch-norm.png delete mode 100644 docs/html/images/e-mini-hvga-l.png delete mode 100644 docs/html/images/e-mini-hvga-p.png delete mode 100644 docs/html/images/e-mini-qvga-l.png delete mode 100644 docs/html/images/e-mini-qvga-p.png delete mode 100644 docs/html/images/emulator-hvga-p.png delete mode 100644 docs/html/images/emulator.png delete mode 100644 docs/html/images/gradient_drawable.png delete mode 100644 docs/html/images/hello_world_0.png delete mode 100644 docs/html/images/hello_world_1.png delete mode 100644 docs/html/images/hello_world_2.png delete mode 100644 docs/html/images/hello_world_3.png delete mode 100644 docs/html/images/hello_world_4.png delete mode 100644 docs/html/images/hello_world_5.png delete mode 100644 docs/html/images/hello_world_8.png delete mode 100644 docs/html/images/hello_world_9.png delete mode 100644 docs/html/images/hierarchyviewer-layout.png delete mode 100644 docs/html/images/hierarchyviewer-pixelperfect.png delete mode 100644 docs/html/images/icon_barriers.png delete mode 100644 docs/html/images/icon_equal.png delete mode 100644 docs/html/images/icon_fast.png delete mode 100644 docs/html/images/icon_open.png delete mode 100644 docs/html/images/layoutparams.png delete mode 100644 docs/html/images/like_thumb1.png delete mode 100644 docs/html/images/like_thumb2.png delete mode 100644 docs/html/images/like_thumb3.png delete mode 100644 docs/html/images/like_thumb4.png delete mode 100644 docs/html/images/linearlayout.png delete mode 100644 docs/html/images/logo_android.gif delete mode 100644 docs/html/images/mediaplayer_state_diagram.gif delete mode 100644 docs/html/images/mediarecorder_state_diagram.gif delete mode 100644 docs/html/images/ninepatch_examples.png delete mode 100644 docs/html/images/ninepatch_raw.png delete mode 100644 docs/html/images/no_scrollview.png delete mode 100644 docs/html/images/notepad.png delete mode 100755 docs/html/images/options_menu.png delete mode 100644 docs/html/images/padding_margins.png delete mode 100755 docs/html/images/radio_buttons.png delete mode 100644 docs/html/images/service_lifecycle.png delete mode 100644 docs/html/images/setting_width_and_height.png delete mode 100644 docs/html/images/system-architecture.jpg delete mode 100644 docs/html/images/table_layout.png delete mode 100644 docs/html/images/tracedump.png delete mode 100644 docs/html/images/traceview_profile.png delete mode 100644 docs/html/images/traceview_timeline.png delete mode 100644 docs/html/images/video_thumb_dan.png delete mode 100644 docs/html/images/video_thumb_mike.png delete mode 100644 docs/html/images/viewgroup.png delete mode 100644 docs/html/images/views_autocomplete.png delete mode 100644 docs/html/images/views_controls_example2.png delete mode 100644 docs/html/images/views_datewidgets_example1_pickdate.png delete mode 100644 docs/html/images/views_datewidgets_example1_picktime.png delete mode 100644 docs/html/images/views_gallery_example1.png delete mode 100644 docs/html/images/views_grid_example2.png delete mode 100644 docs/html/images/views_image_switcher.png delete mode 100644 docs/html/images/views_imagebutton_example1.png delete mode 100644 docs/html/images/views_layouts_linearlayout_example1.png delete mode 100644 docs/html/images/views_layouts_linearlayout_example7.png delete mode 100644 docs/html/images/views_layouts_relativelayout_example2.png delete mode 100644 docs/html/images/views_layouts_tablelayout_example10.png delete mode 100644 docs/html/images/views_layouts_tablelayout_spanning.png delete mode 100644 docs/html/images/views_lists_example1.png delete mode 100644 docs/html/images/views_spinner.png delete mode 100644 docs/html/images/zippy_bullet.gif delete mode 100644 docs/html/images/zippy_closed.gif delete mode 100644 docs/html/images/zippy_open.gif delete mode 100644 docs/html/index.jd delete mode 100644 docs/html/license.jd delete mode 100644 docs/html/maps-api-signup.html delete mode 100644 docs/html/maps-api-tos.pdf delete mode 100644 docs/html/offline.jd delete mode 100644 docs/html/publish/index.jd delete mode 100644 docs/html/publish/publish_toc.cs delete mode 100644 docs/html/reference/index.html delete mode 100644 docs/html/reference/reference_toc.cs delete mode 100644 docs/html/robots.txt delete mode 100644 docs/html/samples/index.jd delete mode 100644 docs/html/sdk/1.0_r1/index.jd delete mode 100644 docs/html/sdk/1.0_r1/installing.jd delete mode 100644 docs/html/sdk/1.0_r1/upgrading.jd delete mode 100644 docs/html/sdk/1.0_r2/index.jd delete mode 100644 docs/html/sdk/1.0_r2/installing.jd delete mode 100644 docs/html/sdk/1.0_r2/upgrading.jd delete mode 100644 docs/html/sdk/1.1_r1/index.jd delete mode 100644 docs/html/sdk/1.1_r1/installing.jd delete mode 100644 docs/html/sdk/1.1_r1/requirements.jd delete mode 100644 docs/html/sdk/1.1_r1/upgrading.jd delete mode 100644 docs/html/sdk/RELEASENOTES.jd delete mode 100644 docs/html/sdk/adt_download.jd delete mode 100644 docs/html/sdk/android-1.1.jd delete mode 100644 docs/html/sdk/download.jd delete mode 100644 docs/html/sdk/index.jd delete mode 100644 docs/html/sdk/sdk_toc.cs delete mode 100644 docs/html/sdk/terms.jd delete mode 100644 docs/html/sdk/terms_body.html delete mode 100644 docs/html/search.jd delete mode 100644 docs/html/security_at_android_dot_com.txt (limited to 'docs/html') diff --git a/docs/html/app.yaml b/docs/html/app.yaml deleted file mode 100644 index c63791e..0000000 --- a/docs/html/app.yaml +++ /dev/null @@ -1,11 +0,0 @@ -application: androidappdocs-staging -version: 1 -runtime: python -api_version: 1 - -handlers: - -- url: / - static_dir: / - - diff --git a/docs/html/blog/blog_toc.cs b/docs/html/blog/blog_toc.cs deleted file mode 100644 index b2a73f5..0000000 --- a/docs/html/blog/blog_toc.cs +++ /dev/null @@ -1 +0,0 @@ - FIXME diff --git a/docs/html/blog/index.jd b/docs/html/blog/index.jd deleted file mode 100644 index 835c55d..0000000 --- a/docs/html/blog/index.jd +++ /dev/null @@ -1,4 +0,0 @@ -page.title=Android Developer Blog -@jd:body - -FIXME diff --git a/docs/html/community/index.jd b/docs/html/community/index.jd deleted file mode 100644 index 4dc5503..0000000 --- a/docs/html/community/index.jd +++ /dev/null @@ -1,118 +0,0 @@ -community=true -page.title=Community -@jd:body - -
-

Community

-

Welcome to the Android developers community! We're glad you're here and invite you to participate in these discussions. Before posting, please red the Groups Charter that covers the community guidelines.

- -

Note: If you are seeking discussion about Android source code (not application development), -then please refer to the Open Source Project Mailing lists.

- -

Contents

-
    -
  1. Before you post
  2. -
  3. Application developer mailing lists
  4. -
  5. Using email with the mailing lists
  6. -
  7. Using IRC
  8. -
- -

Before you post

-

Before writing a post, please try the following:

- -
    -
  1. Read the FAQs The most common questions about developing Android applications are addressed in this frequently updated list.
  2. -
  3. Type in keywords of your questions in the main Android site's search bar (such as the one above). This search encompasses all previous discussions, across all groups, as well as the full contents of the site, documentation, and blogs. Chances are good that somebody has run into the same issue before.
  4. -
  5. Search the mailing list archives to see whether your questions have already been discussed. -
  6. -
- -

If you can't find your answer, then we encourage you to address the community. -As you write your post, please do the following: -

    -
  1. Read -the mailing list charter that covers the community guidelines. -
  2. -
  3. Select the most appropriate mailing list for your question. There are several different lists for -developers, described below.
  4. -
  5. - Be very clear about your question -in the subject -- it helps everyone, both those trying to answer your -question as well as those who may be looking for information in the -future.
  6. -
  7. Give plenty of details in your post to -help others understand your problem. Code or log snippets, as well as -pointers to screenshots, may also be helpful. For a great guide to -phrasing your questions, read How To Ask Questions The Smart Way. -
  8. -
- - -

Application developer mailing lists

- - - - -

Using email with the mailing lists

-

Instead of using the Google Groups site, you can use your email client of choice to participate in the mailing lists.

-

To subscribe to a group without using the Google Groups site, use the link under "subscribe via email" in the lists above.

-

To set up how you receive mailing list postings by email:

- -
  1. Sign into the group via the Google Groups site. For example, for the android-framework group you would visit http://groups.google.com/group/android-framework.
  2. -
  3. Click "Edit -my membership" on the right side.
  4. -
  5. Under "How do -you want to read this group?" select one of the email options.
  6. -
- -

Using IRC

-

The Android community is using the #android channel on the irc.freenode.net server. -

- - - - - - - -
\ No newline at end of file diff --git a/docs/html/favicon.ico b/docs/html/favicon.ico deleted file mode 100644 index d8884b7..0000000 Binary files a/docs/html/favicon.ico and /dev/null differ diff --git a/docs/html/googleb38c1d60b7ba5d19.html b/docs/html/googleb38c1d60b7ba5d19.html deleted file mode 100644 index e69de29..0000000 diff --git a/docs/html/guide/appendix/app-intents.jd b/docs/html/guide/appendix/app-intents.jd deleted file mode 100644 index 102183b..0000000 --- a/docs/html/guide/appendix/app-intents.jd +++ /dev/null @@ -1,106 +0,0 @@ -page.title=Reference of Available Intents -@jd:body - -

This document describes the default applications and settings that Google provides - in their standard Android implementation.

-

Intents handled by Google Android applications

-

Android ships with Activities that handle the following Intent URI/Action pairs.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SchemeAction
- android.intent.action.value
Description
http://web_address
- https://web_address
VIEWOpen a browser window to the URL specified.
"" (empty string)
- http://web_address
- https://web_address
WEB_SEARCHOpens the file at the location on the device in the browser.
tel: phone_numberCALL

Calls the entered phone number. Valid telephone numbers as defined - in the IETF RFC 3966 are - accepted. Valid examples include the following:

-
    -
  • tel:2125551212
  • -
  • tel: - (212) 555 1212
  • -
-

The dialer is good at normalizing some kinds of schemes: for example - telephone numbers, so the schema described isn't strictly required - in the {@link android.net.Uri#parse(java.lang.String) - Uri(URI string)} factory. However, if you have not tried a - schema or are unsure whether it can be handled, use the {@link - android.net.Uri#fromParts(java.lang.String, java.lang.String, - java.lang.String) Uri.fromParts(scheme, ssp, fragment)} factory - instead.

-

Note:   This requires your - application to request the following permission in your manifest: <uses-permission - id="android.permission.CALL_PHONE" />

tel:phone_number
- voicemail:

DIAL

Dials (but does not actually initiate the call) the number given - (or the stored voicemail on the phone). Telephone number normalization - described for CALL applies to DIAL as well.

geo:latitude,longitude
- geo:latitude,longitude?z=zoom
- geo:0,0?q=my+street+address
- geo:0,0?q=business+near+city
-
VIEWOpens the Maps application to the given location or query. The Geo URI scheme - (not fully supported) is currently under - development.

- The z field specifies the zoom level. A zoom level of 1 shows the whole Earth, centered at the - given lat,lng. A zoom level of 2 shows a quarter of the Earth, and so on. The highest - zoom level is 23. A larger zoom level will be clamped to 23. -

google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapZoom - VIEWOpens the Street View application to the given location. The URI scheme is - based on the syntax used for Street View panorama information in Google Maps URLs.

- The cbll field is required. The cbp and mz fields are optional.

- - - - - - - - -
ParameterDescription
latlatitude
lnglongitude
yawPanorama center-of-view in degrees clockwise from North.
- Note: The two commas after the yaw parameter are required. They are present - for backwards-compatibility reasons.
pitchPanorama center-of-view in degrees from - -90 (look straight up) to 90 (look straight down.)
zoomPanorama zoom. 1.0 = normal zoom, 2.0 = zoomed in 2x, 3.0 = zoomed in 4x, and so on.
- A zoom of 1.0 is 90 degree horizontal FOV for a nominal - landscape mode 4 x 3 aspect ratio display. - Android phones in portrait mode will adjust the zoom so that - the vertical FOV is approximately the same as the landscape vertical - FOV. This means that the horizontal FOV of an Android phone in portrait - mode is much narrower than in landscape mode. This is done to minimize - the fisheye lens effect that would be present if a 90 degree horizontal - FOV was used in portrait mode.
mapZoomThe map zoom of the map location associated with this panorama. This value is passed on to the - Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the z paramaeter in - the geo: intent.
-

-

diff --git a/docs/html/guide/appendix/faq/commontasks.jd b/docs/html/guide/appendix/faq/commontasks.jd deleted file mode 100644 index 9c79bdd..0000000 --- a/docs/html/guide/appendix/faq/commontasks.jd +++ /dev/null @@ -1,812 +0,0 @@ -page.title=Common Tasks and How to Do Them in Android -parent.title=FAQs, Tips, and How-to -parent.link=index.html -@jd:body - - -

The ApiDemos sample application includes many, many examples of common -tasks and UI features. See the code inside -<sdk>samples/ApiDemos and the other sample applications -under the samples/ folder in the SDK.

- - -

Creating an Android Application using the Eclipse Plugin

- -

Using the Android Eclipse plugin is the fastest and easiest way -to start creating a new Android application. The plugin automatically generates -the correct project structure for your application, and keeps the resources -compiled for you automatically.

- -

It is still a good idea to know what is going on though. Take a look at Application Fundamentals -to understand the basics of how an Android application works.

- -

You should also take a look at the ApiDemos application and the other sample -applications included in the SDK, in the <sdk>/samples/ -folder in the SDK.

- -

Finally, a great way to started with Android development in Eclipse is to -follow both the Hello, -World and Notepad code -tutorials. In particular, the start of the Hello Android tutorial is an -excellent introduction to creating a new Android application in Eclipse.

- -

Creating an Android Application without the Eclipse Plugin

- -

This topic describes the manual steps in creating an Android application. -Before reading this, you should read Application Fundamentals -to understand the basics of how an Android application works. You might also -want to look at the sample code included with the Android SDK, in the -<sdk>/samples/ directory.

- -

Here is a list of the basic steps in building an application.

-
    -
  1. Create your required resource files   This includes - the AndroidManifest.xml global description file, string files that your application - needs, and layout files describing your user interface. A full list of optional - and required files and syntax details for each is given in File - List for an Android Application.
  2. -
  3. Design your user interface   See User Interface for - details on elements of the Android screen.
  4. -
  5. Implement your Activity (this page)   You - will create one class/file for each screen in your application. Screens will - inherit from an {@link android.app android.app} class, typically {@link android.app.Activity - android.app.Activity} for basic screens, {@link android.app.ListActivity - android.app.ListActivity} for list screens, or {@link android.app.Dialog - android.app.Dialog} for dialog boxes. You will implement the required callbacks - that let you draw your screen, query data, and commit changes, and also perform - any required tasks such as opening additional screens or reading data from - the device. Common tasks, such as opening a new screen or reading data from - the device, are described below. - The list of files you'll need for your application are described in List - of Files for an Android Application.
  6. -
  7. Build and install your - package. The Android SDK has some nice tools for generating - projects and debugging code.
  8. -
- -

Adding an External Library (.jar) using Eclipse

-

-You can use a third party JAR in your application by adding it to your Eclipse project as follows: -

-
    -
  1. -In the Package Explorer panel, right-click on your project and select Properties. -
  2. -Select Java Build Path, then the tab Libraries. -
  3. -Press the Add External JARs... button and select the JAR file. -
-

-Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead.

-

-It is not necessary to put external JARs in the assets folder. -

- - -

Implementing Activity Callbacks

-

Android calls a number of callbacks to let you draw your screen, store data before - pausing, and refresh data after closing. You must implement at least some of - these methods. See Lifecycles - discussion in Application Fundamentals to learn when and in what order these methods - are called. Here are some of the standard types of screen classes that Android provides:

- - -

Opening a New Screen

-

Your Activity will often need to open another Activity screen as it progresses. - This new screen can be part of the same application or part of another application, - the new screen can be floating or full screen, it can return a result, and you - can decide whether to close this screen and remove it from the history stack - when you are done with it, or to keep the screen open in history. These next - sections describe all these options.

-

Floating or full?

-

When you open a new screen you can decide whether to make it transparent or floating, - or full-screen. The choice of new screen affects the event sequence of events - in the old screen (if the new screen obscures the old screen, a different - series of events is called in the old screen). See Lifecycles discussion - in Application Fundamentals for details.

-

Transparent or floating windows are implemented in three - standard ways:

- -
-
<activity class="AddRssItem" android:label="Add an item" android:theme="@android:style/Theme.Dialog"/>
-
-
-

Calling startActivity() or startActivityForResult() will open a new screen in whatever - way it defines itself (if it uses a floating theme it will be floating, - otherwise it will be full screen).

-

Opening a Screen

-

When you want to open a new screen, you can either explicitly specify the activity - class to open, or you can let the operating system decide which screen to open, - based upon the data and various parameters you pass in. A screen is opened by - calling {@link android.app.Activity#startActivity(android.content.Intent) startActivity} - and passing in an {@link android.content.Intent Intent} object, which specifies - the criteria for the handling screen. To specify a specific screen, call Intent.setClass - or setClassName with the exact activity class to open. Otherwise, set a variety - of values and data, and let Android decide which screen is appropriate to open. - Android will find one or zero Activities that match the specified requirements; - it will never open multiple activities for a single request. More information - on Intents and how Android resolves them to a specific class is given in the - {@link android.content.Intent Intent} topic.

-

Some Intent examples

-

The following snippet loads the com.android.samples.Animation1 class, and - passes it some arbitrary data.:

-
Intent myIntent = new Intent();
-myIntent.setClassName("com.android.samples", "com.android.samples.Animation1");
-myIntent.putExtra("com.android.samples.SpecialValue", "Hello, Joe!"); // key/value pair, where key needs current package prefix.
-startActivity(myIntent);    
-

The next snippet requests that a Web page be opened by specifying the VIEW action, - and a URI data string starting with "http://" schema:

-
Intent myIntent = new Intent(Intent.VIEW_ACTION, Uri.parse("http://www.google.com"));
-

Here is the intent filter from the AndroidManifest.xml file for com.android.browser:

-
<intent-filter>
-    <action android:name="android.intent.action.VIEW" />
-    <category android:name="android.intent.category.DEFAULT" />
-    <scheme android:name="http" />
-    <scheme android:name="https" />
-    <scheme android:name="file" />
-</intent-filter> 
-

Android defines a number of standard values, for instance the action constants - defined by {@link android.content.Intent}. You can define custom values, but - both the caller and handler must use them. See the <intent-filter> - tag description in The AndroidManifest.xml - File for more information on the manifest syntax for the handling - application.

-

Returning a Result from a Screen

-

A window can return a result after it closes. This result will be passed back - into the calling Activity's {@link android.app.Activity#onActivityResult(int,int,android.content.Intent) - onActivityResult()} method, which can supply an Intent containing arbitrary data, along with - the request code passed to startActivityForResult(). Note that you must call the {@link - android.app.Activity#startActivityForResult(android.content.Intent,int) startActivityForResult()} - method that accepts a request code parameter to get this callback. The following - code demonstrates opening a new screen and retrieving a result.

-
// Open the new screen.
-public void onClick(View v){
-    // Start the activity whose result we want to retrieve.  The
-    // result will come back with request code GET_CODE.
-    Intent intent = new Intent(this, com.example.app.ChooseYourBoxer.class);
-    startActivityForResult(intent, CHOOSE_FIGHTER);
-}
-
-// Listen for results.
-protected void onActivityResult(int requestCode, int resultCode, Intent data){
-    // See which child activity is calling us back.
-    switch (resultCode) {
-        case CHOOSE_FIGHTER:
-            // This is the standard resultCode that is sent back if the
-            // activity crashed or didn't doesn't supply an explicit result.
-            if (resultCode == RESULT_CANCELED){
-                myMessageboxFunction("Fight cancelled");
-            } 
-            else {
-                myFightFunction(data);
-            }
-        default:
-            break;
-    }
-}
-
-// Class SentResult
-// Temporary screen to let the user choose something.
-    private OnClickListener mLincolnListener = new OnClickListener(){
-        public void onClick(View v) {
-            Bundle stats = new Bundle();
-            stats.putString("height","6\'4\""); 
-            stats.putString("weight", "190 lbs");
-            stats.putString("reach", "74\"");
-            setResult(RESULT_OK, "Lincoln", stats);
-            finish();
-        }
-    };
-
-    private OnClickListener mWashingtonListener = new OnClickListener() {
-        public void onClick(View v){
-            Bundle stats = new Bundle();
-            stats.putString("height","6\'2\""); 
-            stats.putString("weight", "190 lbs");
-            stats.putString("reach", "73\"");
-            setResult(RESULT_OK, "Washington", Bundle);
-            finish();
-        }
-    };
-	
-

Lifetime of the new screen

-

An activity can remove itself from the history stack by calling {@link android.app.Activity#finish() - Activity.finish()} on itself, or the activity that opened the screen can call - {@link android.app.Activity#finishActivity(int) Activity.finishActivity()} - on any screens that it opens to close them.

-

Listening for Button Clicks

-

Button click and other UI event capturing are covered in Handling UI Events on the UI Design page.

-

Configuring General Window Properties

-

You can set a number of general window properties, such as whether to display - a title, whether the window is floating, and whether it displays an icon, by - calling methods on the {@link android.view.Window Window} member - of the underlying View object for the window. Examples include calling {@link - android.app.Activity#getWindow() getWindow().requestFeature()} (or the convenience - method {@link android.app.Activity#requestWindowFeature(int) requestWindowFeature(some_feature)}) - to hide the title. Here is an example of hiding the title bar:

-
//Hide the title bar
-requestWindowFeature(Window.FEATURE_NO_TITLE);
-
-

Referring to localhost from the emulated environment

-

-If you need to refer to your host computer's localhost, such as when you -want the emulator client to contact a server running on the same host, use the alias -10.0.2.2 to refer to the host computer's loopback interface. -From the emulator's perspective, localhost (127.0.0.1) refers to its own -loopback interface. -

-

Storing and Retrieving State

-

If your application is dumped from memory because of space concerns, it will lose - all user interface state information such as checkbox state and text box values - as well as class member values. Android calls {@link android.app.Activity#onSaveInstanceState(android.os.Bundle) - Activity.onSaveInstanceState} before it pauses the application. This method hands in a {@link - android.os.Bundle Bundle} that can be used to store name/value pairs that will - persist and be handed back to the application even if it is dropped from memory. - Android will pass this Bundle back to you when it calls {@link android.app.Activity#onCreate(android.os.Bundle) - onCreate()}. This Bundle only exists while the application is still in the history - stack (whether or not it has been removed from memory) and will be lost when - the application is finalized. See the topics for {@link android.app.Activity#onSaveInstanceState} and - {@link android.app.Activity#onCreate} for - examples of storing and retrieving state.

-

Read more about the lifecycle of an application in Application Fundamentals.

-

Storing and Retrieving Larger or More Complex Persistent Data

-

Your application can store files or complex collection objects, and reserve them - for private use by itself or other activities in the application, or it can expose - its data to all other applications on the device. See Storing, - Retrieving, and Exposing Data to learn how to store and retrieve private data, - how to store and retrieve common data from the device, and how to expose your - private data to other applications.

-

Playing Media Files

-

Please see the document Audio and Video for more details.

-

Listening For and Broadcasting Global Messages, and Setting Alarms

-

You can create a listening class that can be notified or even instantiated whenever - a specific type of system message is sent. -

-

The listening classes, called broadcast receivers, extend {@link android.content.BroadcastReceiver - BroadcastReceiver}. If you want Android to instantiate the object whenever an appropriate - intent notification is sent, define the receiver with a <receiver> element - in the AndroidManifext.xml file. If the caller is expected to instantiate the - object in preparation to receive a message, this is not required. The receiver - will get a call to their {@link android.content.BroadcastReceiver#onReceive(android.content.Context,android.content.Intent) - BroadcastReceiver.onReceive()} method. A receiver can define an <intent-filter> tag - that describes the types of messages it will receive. Just as Android's IntentResolver - will look for appropriate Activity matches for a startActivity() call, it will - look for any matching Receivers (but it will send the message to all matching - receivers, not to the "best" match).

-

To send a notification, the caller creates an {@link android.content.Intent Intent} - object and calls {@link android.app.Activity#sendBroadcast(android.content.Intent) - Context.sendBroadcast()} with that Intent. Multiple recipients can receive - the same message. You can broadcast an Intent message to an intent receiver in - any application, not only your own. If the receiving class is not registered - using <receiver> in its manifest, you can dynamically instantiate - and register a receiver by calling {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,android.content.IntentFilter) - Context.registerReceiver()}.

-

Receivers can include intent filters to specify what kinds of intents they are - listening for. Alternatively, if you expect a single known caller to contact - a single known receiver, the receiver does not specify an intent filter, and - the caller specifies the receiver's class name in the Intent by calling {@link - android.content.Intent#setClassName(java.lang.String, java.lang.String) Intent.setClassName()} - with the recipient's class name. The recipient receives a {@link android.content.Context - Context} object that refers to its own package, not to the package of the sender.

-

Note:   If a receiver or broadcaster - enforces permissions, your application might need to request permission - to send or receive messages from that object. You can request permission by using - the <uses-permission> tag in the manifest.

-

Here is a code snippet of a sender and receiver. This example does not demonstrate - registering receivers dynamically. For a full code example, see the AlarmService - class in the ApiDemos project.

-

Sending the message

-
// We are sending this to a specific recipient, so we will
-// only specify the recipient class name. 
-Intent intent = new Intent(this, AlarmReceiver.class);
-intent.putExtra("message","Wake up.");
-sendBroadcast(intent);
-
-

Receiving the message

-

Receiver AndroidManifest.xml (because there is no intent filter - child, this class will only receive a broadcast when the receiver class is specified - by name, as is done in this example):

-
-<receiver class=".AlarmReceiver" />
-

Receiver Java code:

-
-public class AlarmReceiver extends BroadcastReceiver{
-    // Display an alert that we've received a message.    
-    @Override 
-    public void onReceive(Context context, Intent intent){
-	    // Send a text notification to the screen.
-        NotificationManager nm = (NotificationManager)
-        context.getSystemService(Context.NOTIFICATION_SERVICE);
-        nm.notifyWithText(R.id.alarm,
-                          "Alarm!!!",
-                          NotificationManager.LENGTH_SHORT,
-                          null);
-   }
-}   
-

Other system messages

-

You can listen for other system messages sent by Android as well, such as USB - connection/removal messages, SMS arrival messages, and timezone changes. See - {@link android.content.Intent} for a list of broadcast messages to listen for. - Messages are marked "Broadcast Action" in the documentation.

-

Listening for phone events

-

The {@link android.telephony android.telephony} package overview page describes how to - register to listen for phone events.

-

Setting Alarms

-

Android provides an {@link android.app.AlarmManager AlarmManager} service that - will let you specify an Intent to send at a designated time. This intent is typically - used to start an application at a preset time. (Note: If you want to send - a notification to a sleeping or running application, use {@link android.os.Handler - Handler} instead.)

-

Displaying Alerts

-

There are two major kinds of alerts that you may display to the user: -(1) Normal alerts are displayed in response to a user action, such as -trying to perform an action that is not allowed. (2) Out-of-band alerts, -called notifications, are -displayed as a result of something happening in the background, such as the -user receiving new e-mail.

- -

Normal Alerts

- -

Android provides a number of ways for you to show popup notifications to your - user as they interact with your application.

- - - - - - - - - - - - - - - - - - - - - -
ClassDescription
{@link android.app.Dialog app.Dialog}A generic floating dialog box with a layout that you design.

{@link android.app.AlertDialog app.AlertDialog}

A popup alert dialog with two buttons (typically OK and Cancel) that - take callback handlers. See the section after this table for more details.
{@link android.app.ProgressDialog ProgressDialog} A dialog box used to indicate progress of an operation with a known progress - value or an indeterminate length (setProgress(bool)). See Views > Progress Bar in - ApiDemos for examples.
ActivityBy setting the theme of an activity to - {@link android.R.style#Theme_Dialog - android:theme="android:style/Theme.Dialog"}, - your activity will take on - the appearance of a normal dialog, floating on top of whatever was - underneath it. You usually set the theme through the - {@link android.R.attr#theme android:theme} attribute in your AndroidManifest.xml. - The advantage of this - over Dialog and AlertDialog is that Application has a much better managed - life cycle than dialogs: if a dialog goes to the background and is killed, - you cannot recapture state, whereas Application exposes a {@link android.os.Bundle - Bundle} of saved values in onCreate() to help you maintain state.
-

AlertDialog

-

This is a basic warning dialog box that lets you configure a message, button text, - and callback. You can create one by calling using the {@link - android.app.AlertDialog.Builder} class, as shown here.

-
private Handler mHandler = new Handler() {
-    public void handleMessage(Message msg) {
-        switch (msg.what) {
-            case ACCEPT_CALL:
-            answer(msg.obj);
-            break;
-    
-            case BOUNCE_TO_VOICEMAIL:
-            voicemail(msg.obj);
-            break;
-    
-        }
-    }
-};
-
-
-private void IncomingMotherInlawCall(Connection c) {
-    String Text;
-    
-    // "Answer" callback.
-    Message acceptMsg = Message.obtain();
-    acceptMsg.target = mHandler;
-    acceptMsg.what = ACCEPT_CALL;
-    acceptMsg.obj = c.getCall();
-    
-    // "Cancel" callback.
-    final Message rejectMsg = Message.obtain();
-    rejectMsg.target = mHandler;
-    rejectMsg.what = BOUNCE_TO_VOICEMAIL;
-    rejectMsg.obj = c.getCall();
-
-    new AlertDialog.Builder(this)
-      .setMessage("Phyllis is calling")
-      .setPositiveButton("Answer", acceptMsg)
-      .setOnCanceListener(new OnCancelListener() {
-        public void onCancel(DialogInterface dialog) {
-          rejectMsg.sendToTarget();
-        }});
-      .show();
-}    
- -

Notifications

- -

Out-of-band alerts should always be displayed using the -{@link android.app.NotificationManager}, which allows you to tell the user -about something they may be interested in without disrupting what they are -currently doing. A notification can be anything from a brief pop-up box -informing the user of the new information, through displaying a persistent -icon in the status bar, to vibrating, playing sounds, or flashing lights to -get the user's attention. In all cases, the user must explicitly shift their -focus to the notification before they can interact with it.

- -

The following code demonstrates using NotificationManager to display a basic text - popup when a new SMS message arrives in a listening service, and provides the - current message count. You can see several more examples in the ApiDemos application, - under app/ (named notification*.java).

-
static void setNewMessageIndicator(Context context, int messageCount){
-   // Get the static global NotificationManager object.
-   NotificationManager nm = NotificationManager.getDefault();

- - // If we're being called because a new message has been received, - // then display an icon and a count. Otherwise, delete the persistent - // message. - if (messageCount > 0) { - nm.notifyWithText(myApp.NOTIFICATION_GUID, // ID for this notification. - messageCount + " new message" + messageCount > 1 ? "s":"", // Text to display. - NotificationManager.LENGTH_SHORT); // Show it for a short time only. - } -}
-

To display a notification in the status bar and have it launch an intent when - the user selects it (such as the new text message notification does), call {@link - android.app.NotificationManager#notify(int, android.app.Notification) NotificationManager.notify()}, - and pass in vibration patterns, status bar icons, or Intents to associate with - the notification.

-

Displaying a Progress Bar

-

An activity can display a progress bar to notify the user that something is happening. - To display a progress bar in a screen, call {@link android.app.Activity#requestWindowFeature(int) - Activity.requestWindowFeature(Window.FEATURE_PROGRESS)}. To set the value - of the progress bar, call {@link android.view.Window#setFeatureInt(int,int) - Activity.getWindow().setFeatureInt(Window.FEATURE_PROGRESS, level)}. - Progress bar values are from 0 to 9,999, or set the value to 10,000 to make the - progress bar invisible.

-

You can also use the {@link android.app.ProgressDialog ProgressDialog} class, - which enables a dialog box with an embedded progress bar to send a "I'm working - on it" notification to the user.

-

Adding Items to the Screen Menu

-

See Creating Menus.

- -

Display a Web Page

-

Use the {@link android.webkit.WebView webkit.WebView} object.

-

Binding to Data

-

You can bind a ListView to a set of underlying data by using a shim class called - {@link android.widget.ListAdapter ListAdapter} (or a subclass). ListAdapter subclasses - bind to a variety of data sources, and expose a common set of methods such as - getItem() and getView(), and uses them to pick View items to display in its list. - You can extend ListAdapter and override getView() to create your own custom list - items. There are essentially only two steps you need to perform to bind to data:

-
    -
  1. Create a ListAdapter object and specify its data source
  2. -
  3. Give the ListAdapter to your ListView object.
  4. -
-

That's it!

-

Here's an example of binding a ListActivity screen to the results from a cursor - query. (Note that the setListAdapter() method shown is a convenience method that - gets the page's ListView object and calls setAdapter() on it.)

-
// Run a query and get a Cursor pointing to the results.
-Cursor c = People.query(this.getContentResolver(), null);
-startManagingCursor(c);
-
-// Create the ListAdapter. A SimpleCursorAdapter lets you specify two interesting things:
-// an XML template for your list item, and
-// The column to map to a specific item, by ID, in your template.
-ListAdapter adapter = new SimpleCursorAdapter(this,  
-                android.R.layout.simple_list_item_1,  // Use a template that displays a text view
-                c,                                    // Give the cursor to the list adapter
-                new String[] {People.NAME} ,          // Map the NAME column in the people database to...
-                new String[] {"text1"});              // The "text1" view defined in the XML template
-setListAdapter(adapter);
-

See view/List4 in the ApiDemos project for an example of extending ListAdapter - for a new data type.

- - - -

Getting a Handle to a Screen Element

-

You can get a handle to a screen element by calling {@link -android.app.Activity#findViewById(int) Activity.findViewById}. You can then use -the handle to set or retrieve any values exposed by the object.

-

Capture Images from the Phone Camera

-

You can hook into the device's camera onto your own Canvas object by using the - {@link android.hardware.Camera Camera} class. See that class's documentation, - and the ApiDemos project's Camera Preview application (Graphics/Camera Preview) - for example code.

- - -

Handling Expensive Operations in the UI Thread

-

Avoid performing long-running operations (such as network I/O) directly in the UI thread — -the main thread of an application where the UI is run — or your application may be blocked -and become unresponsive. Here is a brief summary of the recommended approach for handling expensive operations:

-
    -
  1. Create a Handler object in your UI thread
  2. -
  3. Spawn off worker threads to perform any required expensive operations
  4. -
  5. Post results from a worker thread back to the UI thread's handler either through a Runnable or a {@link android.os.Message}
  6. -
  7. Update the views on the UI thread as needed
  8. -
- -

The following outline illustrates a typical implementation:

- -
-public class MyActivity extends Activity {
-
-    [ . . . ]
-    // Need handler for callbacks to the UI thread
-    final Handler mHandler = new Handler();
-
-    // Create runnable for posting
-    final Runnable mUpdateResults = new Runnable() {
-        public void run() {
-            updateResultsInUi();
-        }
-    };
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        [ . . . ]
-    }
-
-    protected void startLongRunningOperation() {
-
-        // Fire off a thread to do some work that we shouldn't do directly in the UI thread
-        Thread t = new Thread() {
-            public void run() {
-                mResults = doSomethingExpensive();
-                mHandler.post(mUpdateResults);
-            }
-        };
-        t.start();
-    }
-
-    private void updateResultsInUi() {
-
-        // Back in the UI thread -- update our UI elements based on the data in mResults
-        [ . . . ]
-    }
-}
-
- -

For further discussions on this topic, see -Designing for Responsiveness -and the {@link android.os.Handler} documentation.

- -

Selecting, Highlighting, or Styling Portions of Text

-

You can highlight or style the formatting of strings or substrings of text in - a TextView object. There are two ways to do this:

- -

To style text on the fly, you must make sure the TextView is using {@link android.text.Spannable} - storage for the text (this will always be true if the TextView is an EditText), - retrieve its text with {@link android.widget.TextView#getText}, and call {@link - android.text.Spannable#setSpan}, passing in a new style class from the {@link - android.text.style} package and the selection range.

-

The following code snippet demonstrates creating a string with a highlighted section, - italic section, and bold section, and adding it to an EditText object.

-
// Get our EditText object.
-EditText vw = (EditText)findViewById(R.id.text);
-
-// Set the EditText's text.
-vw.setText("Italic, highlighted, bold.");
-
-// If this were just a TextView, we could do:
-// vw.setText("Italic, highlighted, bold.", TextView.BufferType.SPANNABLE);
-// to force it to use Spannable storage so styles can be attached.
-// Or we could specify that in the XML.
-
-// Get the EditText's internal text storage
-Spannable str = vw.getText();
-
-// Create our span sections, and assign a format to each.
-str.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-str.setSpan(new BackgroundColorSpan(0xFFFFFF00), 8, 19, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-str.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 21, str.length() - 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-
- -

Utilizing attributes in a Map query

-

-When using a search intent to ask the Maps activity to search for something, the Maps activity responds to the following attributes in the optional context bundle: -

-
-               float "centerLatitude" default 0.0f
-               float "centerLongitude" default 0.0f
-               float "latitudeSpan" default 0.0f
-               float "longitudeSpan" default 0.0f
-               int "zoomLevel" default 10
-
-

-This context information is used to center the search result in a particular area, and is equivalent to adjusting the Map activity to the described location and zoom level before issuing the query. -

-

-If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent, then it is undefined which one takes precedence. -

- -

List of Files for an Android Application

-

The following list describes the structure and files of an Android application. - Many of these files can be built for you (or stubbed out) by the activitycreator - application shipped in the tools/ menu of the SDK.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MyApp/
 
    AndroidManifest.xml(required) Advertises the screens that this application provides, - where they can be launched (from the main program menu or elsewhere), - any content providers it implements and what kind of data they handle, - where the implementation classes are, and other application-wide - information. Syntax details for this file are described in The AndroidManifest.xml File.
    src/
-         /myPackagePath/.../MyClass.java
(required) This folder holds all the source code files for your - application, inside the appropriate package subfolders.
    res/(required) This folder holds all the resources for - your application. Resources are external data files or description files - that are compiled into your code at build time. Files in different folders - are compiled differently, so you must put the proper resource into the - proper folder. (See Resources for details.)
        anim/
-                animation1.xml
-                         ...
(optional) Holds any animation XML description files that the - application uses. The format of these files is described in Resources.
        drawable/
-                       some_picture.png
-                       some_stretchable.9.png
-                       some_background.xml
-                                     ...
(optional) Zero or more files that will be compiled to {@link - android.graphics.drawable android.graphics.drawable} resources. Files - can be image files (png, gif, or other) or XML files describing other - graphics such as bitmaps, stretchable bitmaps, or gradients. Supported - bitmap file formats are PNG (preferred), JPG, and GIF (discouraged), - as well as the custom 9-patch stretchable bitmap format. These formats - are described in Resources.
        layout/
-                       screen_1_layout.xml
-                                  ...
(optional) Holds all the XML files describing screens or parts - of screens. Although you could create a screen in Java, defining them - in XML files is typically easier. A layout file is similar in concept - to an HTML file that describes the screen layout and components. See User Interface for more information about designing screens, and Available Resource Types for the syntax of these files.
        values/
-                       arrays
-                       classes.xml
-                       colors.xml
-                       dimens.xml
-                      strings.xml
-                       styles.xml
-                       values.xml

(optional) XML files describing additional resources - such as strings, colors, and styles. The naming, quantity, and number - of these files are not enforced--any XML file is compiled, but these - are the standard names given to these files. However, the syntax - of these files is prescribed by Android, and described in Resources.

-
        xml/(optional) XML files that can be read at run time on the device.
        raw/(optional) Any files to be copied directly to the device.
- - - -

Print Messages to a Log File

- -

To write log messages from your application:

-
  1. Import android.util.Log.
  2. -
  3. Use Log.v(), Log.d(), Log.i(), - Log.w(), or Log.e() to log messages. - (See the {@link android.util.Log} class.)
    E.g., - Log.e(this.toString(), "error: " + err.toString())
  4. -
  5. Launch DDMS from a terminal - by executing ddms in your Android SDK /tools path.
  6. -
  7. Run your application in the Android emulator.
  8. -
  9. From the DDMS application, select the emulator - (e.g., "emulator-5554") and click Device > Run logcat... - to view all the log data.
  10. -
-

Note: If you are running Eclipse and -encounter a warning about the VM debug port when opening DDMS, you can ignore it -if you're only interested in logs. However, if you want to further inspect and -control your processes from DDMS, then you should close Eclipse before launching DDMS so that -it may use the VM debugging port.

- - diff --git a/docs/html/guide/appendix/faq/framework.jd b/docs/html/guide/appendix/faq/framework.jd deleted file mode 100644 index 76a19c5..0000000 --- a/docs/html/guide/appendix/faq/framework.jd +++ /dev/null @@ -1,198 +0,0 @@ -page.title=Android Application Framework FAQ -parent.title=FAQs, Tips, and How-to -parent.link=index.html -@jd:body - - - - - - - -

Do all the Activities and Services of an application run in a -single process?

- -

All Activities and Services in an application run in a single process by -default. If needed, you can declare an android:process attribute -in your manifest file, to explicitly place a component (Activity/Service) in -another process.

- - - - - -

Do all Activities run in the main thread of an application -process?

- -

By default, all of the application code in a single process runs -in the main UI thread. This is the same thread -that also handles UI events. The only exception is the code that handles -IPC calls coming in from other processes. The system maintains a -separate pool of transaction threads in each process to dispatch all -incoming IPC calls. The developer should create separate threads for any -long-running code, to avoid blocking the main UI thread.

- - - - - -

How do I pass data between Activities/Services within a single -application?

- -

It depends on the type of data that you want to share:

- -

Primitive Data Types

- -

To share primitive data between Activities/Services in an -application, use Intent.putExtras(). For passing primitive data that -needs to persist use the - -Preferences storage mechanism.

- -

Non-Persistent Objects

- -

For sharing complex non-persistent user-defined objects for short -duration, the following approaches are recommended: -

-

The android.app.Application class

-

The android.app.Application is a base class for those who need to -maintain global application state. It can be accessed via -getApplication() from any Activity or Service. It has a couple of -life-cycle methods and will be instantiated by Android automatically if -your register it in AndroidManifest.xml.

- -

A public static field/method

-

An alternate way to make data accessible across Activities/Services is to use public static -fields and/or methods. You can access these static fields from any other -class in your application. To share an object, the activity which creates your object sets a -static field to point to this object and any other activity that wants to use -this object just accesses this static field.

- -

A HashMap of WeakReferences to Objects

-

You can also use a HashMap of WeakReferences to Objects with Long -keys. When an activity wants to pass an object to another activity, it -simply puts the object in the map and sends the key (which is a unique -Long based on a counter or time stamp) to the recipient activity via -intent extras. The recipient activity retrieves the object using this -key.

- -

A Singleton class

-

There are advantages to using a static Singleton, such as you can -refer to them without casting getApplication() to an -application-specific class, or going to the trouble of hanging an -interface on all your Application subclasses so that your various -modules can refer to that interface instead.

-

But, the life cycle of a static is not well under your control; so -to abide by the life-cycle model, the application class should initiate and -tear down these static objects in the onCreate() and onTerminate() methods -of the Application Class

-

- -

Persistent Objects

- -

Even while an application appears to continue running, the system -may choose to kill its process and restart it later. If you have data -that you need to persist from one activity invocation to the next, you -need to represent that data as state that gets saved by an activity when -it is informed that it might go away.

- -

For sharing complex persistent user-defined objects, the -following approaches are recommended: -

-

- -

If the shared data needs to be retained across points where the application -process can be killed, then place that data in persistent storage like -Application Preferences, SQLite DB, Files or ContentProviders. Please refer to -the Data Storage -for further details on how to use these components.

- - - - - - -

How can I check if an Activity is already running before starting -it?

- -

The general mechanism to start a new activity if its not running— -or to bring the activity stack to the front if is already running in the -background— is the to use the NEW_TASK_LAUNCH flag in the startActivity() -call.

- - - - - -

If an Activity starts a remote service, is there any way for the -Service to pass a message back to the Activity?

- -

The remote service can define a callback interface and register it with the -clients to callback into the clients. The -{@link android.os.RemoteCallbackList RemoteCallbackList} class provides methods to -register and unregister clients with the service, and send and receive -messages.

- -

The sample code for remote service callbacks is given in ApiDemos/RemoteService

- - - - - -

How to avoid getting the Application not responding dialog?

- -

Please read the Designing for Responsiveness -document.

- - - - - - -

How does an application know if a package is added or removed? -

- -

Whenever a package is added, an intent with PACKAGE_ADDED action -is broadcast by the system. Similarly when a package is removed, an -intent with PACKAGE_REMOVED action is broadcast. To receive these -intents, you should write something like this: -

-       <receiver android:name ="com.android.samples.app.PackageReceiver">
-            <intent-filter>
-             <action android:name="android.intent.action.PACKAGE_ADDED"/>
-              <action android:name="android.intent.action.PACKAGE_REMOVED"/>            
-            
-              <data android:scheme="package" />
-            </intent-filter>
-        </receiver>
-  
-
-Here PackageReceiver is a BroadcastReceiver class.Its onReceive() -method is invoked, every time an application package is installed or -removed. - -

- - - diff --git a/docs/html/guide/appendix/faq/index.jd b/docs/html/guide/appendix/faq/index.jd deleted file mode 100644 index 90415ae..0000000 --- a/docs/html/guide/appendix/faq/index.jd +++ /dev/null @@ -1,15 +0,0 @@ -page.title=FAQs, Tips, and How-to -@jd:body - -
-
Common Development Tasks and How To Do Them
-
Quick and to the point — how-to's for a variety of development tasks you are likely to use.
-
Application Framework FAQ
-
Common questions about the Android Application Framework.
-
Troubleshooting Tips
-
Answers to help you troubleshoot common problems.
-
Open Source Licensing FAQ
-
Common topics around licensing and Android Open Source
-
Android Security FAQ
-
Answers to common questions about Android security.
-
diff --git a/docs/html/guide/appendix/faq/licensingandoss.jd b/docs/html/guide/appendix/faq/licensingandoss.jd deleted file mode 100644 index c267fe8..0000000 --- a/docs/html/guide/appendix/faq/licensingandoss.jd +++ /dev/null @@ -1,19 +0,0 @@ -page.title=Android Open Source Licensing FAQ -parent.title=FAQs, Tips, and How-to -parent.link=index.html -@jd:body - - - -

Where can I find the open source components of Android?

-

The source code for the full Android stack is available from the Android Open Source Project site. - -

Other mirrored GPL and LGPL'd components are available at http://code.google.com/p/android/downloads/list.

-

Notices for other licenses can be found within the SDK.

- -

Why are you releasing the code under the Apache License instead of GPLv2?

-

One of the best explanations for the reasoning behind releasing code under Apache2 can be found in a ArsTechnica article by Ryan Paul.

diff --git a/docs/html/guide/appendix/faq/security.jd b/docs/html/guide/appendix/faq/security.jd deleted file mode 100644 index b0d832b..0000000 --- a/docs/html/guide/appendix/faq/security.jd +++ /dev/null @@ -1,156 +0,0 @@ -page.title=Android Security FAQ -parent.title=FAQs, Tips, and How-to -parent.link=index.html -@jd:body - - - - -

Is Android secure?

- -

The security and privacy of our users' data is of primary importance to the -Android Open Source Project. We are dedicated to building and maintaining one -of the most secure mobile platforms available while still fulfilling our goal -of opening the mobile device space to innovation and competition.

- -

The Android Platform provides a rich security model -that allows developers to request the capabilities, or access, needed by their -application and to define new capabilities that other applications can request. -The Android user can choose to grant or deny an application's request for -certain capabilities on the handset.

- -

We have made great efforts to secure the Android platform, but it is -inevitable that security bugs will be found in any system of this complexity. -Therefore, the Android team works hard to find new bugs internally and responds -quickly and professionally to vulnerability reports from external researchers. -

- - -

I think I found a security flaw. How do I -report it?

- -

You can reach the Android security team at security@android.com. If you like, you -can protect your message using our PGP -key.

- -

We appreciate researchers practicing responsible disclosure by emailing us -with a detailed summary of the issue and keeping the issue confidential while -users are at risk. In return, we will make sure to keep the researcher informed -of our progress in issuing a fix and will properly credit the reporter(s) when -we announce the patch. We will always move swiftly to mitigate or fix an -externally-reported flaw and will publicly announce the fix once patches are -available to users.

- - -

How can I stay informed of Android -security announcements?

- -

An important part of sustainably securing a platform, such as, Android is -keeping the user and security community informed of bugs and fixes. We will -publicly announce security bugs when the fixes are available via postings to -the android-security-announce -group on Google Groups. You can subscribe to this group as you would a mailing -list and view the archives here.

- -

For more general discussion of Android platform security, or how to use -security features in your Android application, please subscribe to android-security-discuss. -

- - -

How do I securely use my Android phone?

- -

As an open platform, Android allows users to load software from any -developer onto a device. As with a home PC, the user must be -aware of who is providing the software they are downloading and must decide -whether they want to grant the application the capabilities it requests. -This decision can be informed by the user's judgment of the software -developer's trustworthiness, and where the software came from.

- -

Despite the security protections in Android, it is important -for users to only download and install software from developers they trust. -More details on how Android users can make smart security decisions will be -released when consumer devices become available.

- - -

I think I found malicious software being -distributed for Android. How can I help?

- -

Like any other open platform, it will be possible for unethical developers -to create malicious software, known as malware, for Android. If you -think somebody is trying to spread malware, please let us know at security@android.com. Please include as -much detail about the application as possible, with the location it is -being distributed from and why you suspect it of being malicious software.

- -

The term malicious software is subjective, and we cannot make an -exhaustive definition. Some examples of what the Android Security Team believes -to be malicious software is any application that: -

-

- - -

How will Android-powered devices receive security -fixes?

- -

The manufacturer of each device is responsible for distributing software -upgrades for it, including security fixes. Many devices will update themselves -automatically with software downloaded "over the air", while some devices -require the user to upgrade them manually.

- -

When Android-powered devices are publicly available, this FAQ will provide links how -Open Handset Alliance members release updates.

- -

Can I get a fix directly from the -Android Platform Project?

- -

Android is a mobile platform that will be released as open source and -available for free use by anybody. This means that there will be many -Android-based products available to consumers, and most of them will be created -without the knowledge or participation of the Android Open Source Project. Like -the maintainers of other open source projects, we cannot build and release -patches for the entire ecosystem of products using Android. Instead, we will -work diligently to find and fix flaws as quickly as possible and to distribute -those fixes to the manufacturers of the products.

- -

In addition, We will add security fixes to the open source distribution of -Android and publicly announce the changes on android-security-announce. -

- -

If you are making an Android-powered device and would like to know how you can -properly support your customers by keeping abreast of software updates, please -contact us at info@openhandsetalliance.com.

diff --git a/docs/html/guide/appendix/faq/troubleshooting.jd b/docs/html/guide/appendix/faq/troubleshooting.jd deleted file mode 100644 index 7c703e6..0000000 --- a/docs/html/guide/appendix/faq/troubleshooting.jd +++ /dev/null @@ -1,305 +0,0 @@ -page.title=Troubleshooting -parent.title=FAQs, Tips, and How-to -parent.link=index.html -@jd:body - - -

Here are some tips and tricks for common Android errors. Don't forget to use the - ddms logcat capability to get a deeper view when errors occur. See Debugging for more debugging tips.

- - -

ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".

-

-The "Android Editors" feature of the ADT Plugin requires specific Eclipse components, such as WST. If you -encounter this error message during ADT installation, you need to install the -required Eclipse components and then try the ADT installation again. Follow the steps below to install the required components for the -Android Editors feature, based on the version of Eclipse that you are using.

- - - - - - - -
Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
-
    -
  1. From the dialog where you select the Update sites to visit, select the checkboxes for both the -ADT site, and the Callisto/Europa/Ganymede Discovery Site (you may want to -check Automatically select mirrors at the bottom).
  2. -
  3. Click Finish.
  4. -
  5. In the Next dialog, select the Android Plugins.
  6. -
  7. Now, expand the tree item of the discovery site. It seems that if you -don't do it, it doesn't load the content of the discovery site.
  8. -
  9. On the right, click Select required. This will select all the components -that are required to install the Android plugin (wst, emf, etc...).
  10. -
  11. Click Next, accept the agreement, click Install All, and restart Eclipse.
  12. -
-
-
    -
  1. Select Help > Software Updates...
  2. -
  3. Select the Installed Software tab.
  4. -
  5. Click Update...
  6. -
  7. If an update for ADT is available, select it and click Finish.
  8. -
-
- - -

-

ADB reports "no device" when an emulator is running

-

Try restarting adb by stopping it (adb - kill-server) then any other adb command to restart it.

- -

My new application/activity isn't showing up in the - applications list

- -

I updated my app, but the updates don't seem to be showing up on the device

-

Did you remember to send your .apk file to the device (adb - install)?

- -

I'm getting a "Binary XML file line #2: You must supply a layout_wilih - attribute" error - when I start an application (but I declare a layout_wilih attribute right - there!!!)

- -

My request to (make a call, catch an incoming SMS, -receive a notification, send an intent to an Android application) is being -ignored

-

You might not have permission (or might not have requested permission) to - call this activity or receive this intent. Many standard Android activities, - such as making a call, have a permission assigned to it to prevent arbitrary - applications from sending or receiving requests. See Security and - Permissions for more information on permissions, and - {@link android.Manifest.permission Manifest.permission} for a list of - standard permissions supported by the Android platform. -

-

Help! My project won't build in Eclipse

-

If your project doesn't build, you may notice symptoms such as new -resources added in the res/ sub-folders not showing up in the R class, -the emulator not being started, not being able to run the application, or even seeming to run an old version of the application.

-

To troubleshoot these types of problems, first try:

-
    -
  1. Switch to the DDMS view in Eclipse (if you don't already have it open): -
      -
    1. From the menu select Window > Open Perspective > Other
    2. -
    3. Select DDMS from the list and hit OK
    4. -
    -
  2. -
  3. In the Devices panel (top right panel by default), click on the down triangle - to bring up the panel menu
  4. -
  5. Select Reset ADB from the menu, and then try running the - application again
  6. -
-

If the above still doesn't work, you can try these steps:

-
    -
  1. - Check the console and problems tabs at the bottom of the Eclipse UI -
  2. -
  3. - If there are problems listed in either place, they should give you a clue - what is wrong -
  4. -
  5. - If you aren't sure if the problems are fresh or stale, clear the console - with a right click > Clear, then clean the project -
  6. -
  7. - To clean the project (a good idea with any kind of build error), select - Project > Clean from the eclipse main menu, then select the project you - are working on (or clean all) -
  8. -
-

Eclipse isn't talking to the emulator

-

When communication doesn't seem to be happening between Eclipse and the emulator, symptoms can include: nothing happening when you press run, the emulator hanging waiting -for a debugger to connect, or errors that Eclipse reports about not being able -to find the emulator or shell. By far the most common symptom is that when you press run, the emulator starts (or -is already running), but the application doesn't start.

-

-You may find any of these steps will fix the problem and with practice you -probably can figure out which one you need to do for your particular issue, but -to start with, the safest option is to run through all of them in order:

-
    -
  1. - Quit the emulator if it is running -
  2. -
  3. - Check that any emulator processes are killed (sometimes they can hang, use ps on unix or mac, or task manager in the process view on - windows). -
  4. -
  5. - Quit Eclipse -
  6. -
  7. - From the command line, type: -
    adb kill-server 
    -
  8. -
  9. - Start Eclipse and try again -
  10. -
- -

When I go to preferences in Eclipse and select "Android", I get the following error message: Unsupported major.minor version 49.0.

-

This error is displayed if you are using an older version of the JDK. Please make sure you are using JDK version 5 or 6.

- -

I can't install ApiDemos apps in my IDE because of a signing error

- -

The Android system requires that all applications be signed, as described in - Signing Your Applications. The ApiDemos -applications included with the SDK are preinstalled on the emulator and for that reason have been -compiled and signed with a private key.

- -If you want to modify or run one of the ApiDemos apps from Eclipse/ADT or other IDE, you can do so -so only after you uninstall the preinstalled version of the app from the emulator. If -you try to run an ApiDemos apps from your IDE without removing the preinstalled version first, -you will get errors similar to:

- -
[2008-08-13 15:14:15 - ApiDemos] Re-installation failed due to different application signatures.
-[2008-08-13 15:14:15 - ApiDemos] You must perform a full uninstall of the application. WARNING: ...This will remove the application data!
-[2008-08-13 15:14:15 - ApiDemos] Please execute 'adb uninstall com.android.samples' in a shell.
- -

The error occurs because, in this case, you are attempting to install another copy of ApiDemos -onto the emulator, a copy that is signed with a different certificate (the Android IDE tools will -have signed the app with a debug certificate, where the existing version was already signed with -a private certificate). The system does not allow this type of reinstallation.

- -

To resolve the issue, you need to fully uninstall the preinstalled and then reinstall it using -the adb tool. Here's how to do that:

- -
    -
  1. In a terminal, change to the tools directory of the SDK.
  2. -
  3. If no emulator instance is running, start an emulator using using the command emulator &.
  4. -
  5. Uninstall the preinstalled app using the command adb uninstall com.android.samples.
  6. -
  7. Reinstall the app using the command adb install <path to the ApiDemos.apk>. If you are - working in Eclipse/ADT, you can just compile and run the app in the normal way.
  8. -
- -

Note that if multiple emulator instances are running, you need to direct your uninstall/install -commands to the emulator instance that you are targeting. To do that you can add the --s <serialNumber> to the command, for example:

- -
adb -s emulator-5556 install
- -

For more information about adb, see the Android Debug Bridge -documentation.

- - -

I can't compile my app because the build tools generated an expired debug certificate

- -

If your development machine uses a locale that has a non-Gregorian calendar, you may encounter problems when first trying to compile and run your application. Specifically, you may find that the Android build tools won't compile your application because the debug key is expired.

- -

The problem occurs because the Keytool utility — included in the JDK and used by the Android build tools — fails to properly handle non-Gregorian locales and may create validity dates that are in the past. That is, it may generate a debug key that is already expired, which results in the compile error.

- -

If you encounter this problem, follow these steps to work around it:

- -
    -
  1. First, delete the debug keystore/key already generated by the Android build tools. Specifically, delete the debug.keystore file. On Linux/Mac OSX, the file is stored in ~/.android. On Windows XP, the file is stored in -C:\Documents and Settings\<user>\Local Settings\Application Data\Android. On Windows Vista, the file is stored in -C:\Users\<user>\AppData\Local\Android
  2. -
  3. Next, you can either -
      -
    • Temporarily change your development machine's locale (date and time) to one that uses a Gregorian calendar, for example, United States. Once the locale is changed, use the Android build tools to compile and install your app. The build tools will regenerate a new keystore and debug key with valid dates. Once the new debug key is generated, you can reset your development machine to the original locale.
    • -
    • Alternatively, if you do not want to change your machine's locale settings, you can generate the keystore/key on any machine using the Gregorian calendar, then copy the debug.keystore file from that computer to the proper location on your development machine.
    • -
    -
  4. -
- -

This problem has been verified on Windows and may apply to other platforms.

- -

For general information about signing Android applications, see -Signing Your Applications.

- -

I can't run a JUnit test class in Eclipse/ADT

- -

If you are developing on Eclipse/ADT, you can add JUnit test classes to your application. However, you may get an error when trying to run such a class as a JUnit test:

- -
Error occurred during initialization of VM
-java/lang/NoClassDefFoundError: java/lang/ref/FinalReference
- -

This error occurs because android.jar does not include complete Junit.* class implementations, but includes stub classes only.

- -

To add a JUnit class, you have to set up a JUnit configuration:. - -

    -
  1. In the Package Explorer view, select your project.
  2. -
  3. Open the launch configuration manager. -
      -
    • In Eclipse 3.3 (Europa), select Run > - Open Run Dialog... or Run > - Open Debug Dialog... . -
    • - -
    • In Eclipse 3.4 (Ganymede), select Run > - Run Configurations... or Run > - Debug Configurations... . -
    • -
    -
  4. -
  5. In the configuration manager, right-click the "JUnit" configuration type and select New
  6. -
  7. In the new configuration's Test tab, specify the project and test class, as well as any options for running the test.
  8. -
  9. In the new configuration's Classpath tab, find "Android Library" under Bootstrap Entries and remove it.
  10. -
  11. Still in the Classpath tab, select Bootstrap Entries and click the Advanced button.
  12. -
      -
    1. Choose Add Library and click OK.
    2. -
    3. Select JRE System Library and click Next.
    4. -
    5. Select Workspace Default JRE and click Finish.
    6. -
    -
  13. Select Bootstrap Entries again and click Advanced.
  14. -
      -
    1. Choose Add Library and click OK.
    2. -
    3. Select JUnit 3 and click Finish.
    4. -
    -
-

When configured in this way, your JUnit test class should now run properly.

- diff --git a/docs/html/guide/appendix/g-app-intents.jd b/docs/html/guide/appendix/g-app-intents.jd deleted file mode 100644 index d4f97c8..0000000 --- a/docs/html/guide/appendix/g-app-intents.jd +++ /dev/null @@ -1,112 +0,0 @@ -page.title=Intents List: Invoking Google Applications on Android Devices -@jd:body - - - -

The table below lists the intents that your application can send, to invoke Google applications on Android devices in certain ways. For each action/uri pair, the table describes how the receiving Google application handles the intent.

- -

Note that this list is not comprehensive.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Target ApplicationIntent URIIntent ActionResult
Browserhttp://web_address
- https://web_address
VIEWOpen a browser window to the URL specified.
"" (empty string)
- http://web_address
- https://web_address
WEB_SEARCHOpens the file at the location on the device in the browser.
Dialertel: phone_numberCALL

Calls the entered phone number. Valid telephone numbers as defined - in the IETF RFC 3966 are - accepted. Valid examples include the following:

-
    -
  • tel:2125551212
  • -
  • tel: - (212) 555 1212
  • -
-

The dialer is good at normalizing some kinds of schemes: for example - telephone numbers, so the schema described isn't strictly required - in the {@link android.net.Uri#parse(java.lang.String) - Uri(URI string)} factory. However, if you have not tried a - schema or are unsure whether it can be handled, use the {@link - android.net.Uri#fromParts(java.lang.String, java.lang.String, - java.lang.String) Uri.fromParts(scheme, ssp, fragment)} factory - instead.

-

Note:   This requires your - application to request the following permission in your manifest: <uses-permission - id="android.permission.CALL_PHONE" />

tel:phone_number
- voicemail:

DIAL

Dials (but does not actually initiate the call) the number given - (or the stored voicemail on the phone). Telephone number normalization - described for CALL applies to DIAL as well.

Google Mapsgeo:latitude,longitude
- geo:latitude,longitude?z=zoom
- geo:0,0?q=my+street+address
- geo:0,0?q=business+near+city
-
VIEWOpens the Maps application to the given location or query. The Geo URI scheme - (not fully supported) is currently under - development.

- The z field specifies the zoom level. A zoom level of 1 shows the whole Earth, centered at the - given lat,lng. A zoom level of 2 shows a quarter of the Earth, and so on. The highest - zoom level is 23. A larger zoom level will be clamped to 23. -

Google Streetviewgoogle.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapZoom - VIEWOpens the Street View application to the given location. The URI scheme is - based on the syntax used for Street View panorama information in Google Maps URLs.

- The cbll field is required. The cbp and mz fields are optional.

- - - - - - - -
latlatitude
lnglongitude
yawPanorama center-of-view in degrees clockwise from North.
- Note: The two commas after the yaw parameter are required. They are present - for backwards-compatibility reasons.
pitchPanorama center-of-view in degrees from - -90 (look straight up) to 90 (look straight down.)
zoomPanorama zoom. 1.0 = normal zoom, 2.0 = zoomed in 2x, 3.0 = zoomed in 4x, and so on.
- A zoom of 1.0 is 90 degree horizontal FOV for a nominal landscape mode 4 -x 3 aspect ratio display Android phones in portrait mode will adjust the zoom so -that the vertical FOV is approximately the same as the landscape vertical FOV. -This means that the horizontal FOV of an Android phone in portrait mode is much -narrower than in landscape mode. This is done to minimize the fisheye lens -effect that would be present if a 90 degree horizontal FOV was used in portrait -mode.
mapZoomThe map zoom of the map location associated with this panorama. This value is passed on to the - Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the z paramaeter in - the geo: intent.
-

-

diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd deleted file mode 100644 index ef81631..0000000 --- a/docs/html/guide/appendix/glossary.jd +++ /dev/null @@ -1,293 +0,0 @@ -page.title=Glossary -@jd:body - -

The list below defines some of the basic terminology of the Android platform.

-
-
.apk file
Android application package file. Each - Android application is compiled and packaged in a single file that - includes all of the application's code (.dex files), resources, assets, - and manifest file. The application package file can have any name but - must use the .apk extension. For example: - myExampleAppname.apk. For convenience, an application package - file is often referred to as an ".apk". -

Related: Application.

-
- -
.dex file
-
Compiled Android application code file. -

Android programs are compiled into .dex (Dalvik Executable) files, which - are in turn zipped into a single .apk file on the device. .dex files can - be created by automatically translating compiled applications written in - the Java programming language.

- -
Action
-
A description of something that an Intent sender wants done. An action is - a string value assigned to an Intent. Action strings can be defined by Android - or by a third-party developer. For example, android.intent.action.VIEW - for a Web URL, or com.example.rumbler.SHAKE_PHONE for a custom application - to vibrate the phone. -

Related: Intent.

-
- -
Activity
-
A single screen in an application, with supporting Java code, derived - from the {@link android.app.Activity} class. Most commonly, an activity is - visibly represented by a full screen window that can receive and handle UI - events and perform complex tasks, because of the Window it uses to render - its window. Though an Activity is typically full screen, it can also be - floating or transparent.
- -
adb
-
Android Debug Bridge, a command-line debugging application included with the - SDK. It provides tools to browse the device, copy tools on the device, and - forward ports for debugging. If you are developing in Eclipse using the - ADT Plugin, adb is integrated into your development environment. See - Android Debug Bridge - for more information.
- -
Application
-
From a component perspective, an Android application consists of one - or more activities, services, listeners, and intent receivers. From a - source file perspective, an Android application consists of code, - resources, assets, and a single manifest. During compilation, these files - are packaged in a single file called an application package file (.apk). -

Related: .apk, Activity

- -
Canvas
-
A drawing surface that handles compositing of the actual bits against - a Bitmap or Surface object. It has methods for standard computer drawing - of bitmaps, lines, circles, rectangles, text, and so on, and is bound to a - Bitmap or Surface. Canvas is the simplest, easiest way to draw 2D objects - on the screen. However, it does not support hardware acceleration, as - OpenGL ES does. The base class is {@link android.graphics.Canvas}. -

Related: Drawable, OpenGL - ES.

- -
Content Provider
-
A data-abstraction layer that you can use to safely expose your - application's data to other applications. A content provider is built on - the {@link android.content.ContentProvider} class, which handles content - query strings of a specific format to return data in a specific format. - See - Content Providers topic for more information. -

Related: URI Usage in Android

- -
Dalvik
-
The Android platform's virtual machine. The Dalvik VM is an - interpreter-only virtual machine that executes files in the Dalvik - Executable (.dex) format, a format that is optimized for efficient storage - and memory-mappable execution. The virtual machine is register-based, and - it can run classes compiled by a Java language compiler that have been - transformed into its native format using the included "dx" tool. - The VM runs on top of Posix-compliant operating systems, which it relies - on for underlying functionality (such as threading and low level memory - management). The Dalvik core class library is intended to provide a - familiar development base for those used to programming with Java Standard - Edition, but it is geared specifically to the needs of a small mobile - device.
- -
DDMS
-
Dalvik Debug Monitor Service, a GUI debugging application included - with the SDK. It provides screen capture, log dump, and process - examination capabilities. If you are developing in Eclipse using the ADT - Plugin, DDMS is integrated into your development environment. See Dalvik Debug Monitor - Server to learn more about the program.
- -
Dialog
A floating window that that acts as a lightweight - form. A dialog can have button controls only and is intended to perform a - simple action (such as button choice) and perhaps return a value. A dialog - is not intended to persist in the history stack, contain complex layout, - or perform complex actions. Android provides a default simple dialog for - you with optional buttons, though you can define your own dialog layout. - The base class for dialogs is {@link android.app.Dialog Dialog}. -

Related: Activity.

- -
Drawable
-
A compiled visual resource that can be used as a background, title, or - other part of the screen. A drawable is typically loaded into another UI - element, for example as a background image. A drawable is not able to - receive events, but does assign various other properties such as "state" - and scheduling, to enable subclasses such as animation objects or image - libraries. Many drawable objects are loaded from drawable resource files - — xml or bitmap files that describe the image. Drawable resources - are compiled into subclasses of {@link android.graphics.drawable}. For - more information about drawables and other resources, see Resources. -

Related: Resources, Canvas -

- -
Intent
-
An message object that you can use to launch or communicate with other - applications/activities asynchronously. An Intent object is an instance of - {@link android.content.Intent}. It includes several criteria fields that you can - supply, to determine what application/activity receives the Intent and - what the receiver does when handling the Intent. Available criteria include - include the desired action, a category, a data string, the MIME type of - the data, a handling class, and others. An application sends - an Intent to the Android system, rather than sending it directly to - another application/activity. The application can send the Intent to a - single target application or it can send it as a broadcast, which can in - turn be handled by multiple applications sequentially. The Android system - is responsible for resolving the best-available receiver for each Intent, - based on the criteria supplied in the Intent and the Intent Filters - defined by other applications. For more information, see Intents and - Intent Filters. -

Related: Intent Filter, Broadcast Receiver.

- -
Intent Filter
-
A filter object that an application declares in its manifest file, to - tell the system what types of Intents each of its components is willing to - accept and with what criteria. Through an intent filter, an application - can express interest in specific data types, Intent actions, URI formats, - and so on. When resolving an Intent, the system evaluates all of the - available intent filters in all applications and passes the Intent to the - application/activity that best matches the Intent and criteria. For more - information, see Intents and - Intent Filters. -

Related: Intent, Broadcast Receiver.

- -
Broadcast Receiver
-
An application class that listens for Intents that are broadcast, - rather than being sent to a single target application/activity. The system - delivers a broadcast Intent to all interested broadcast receivers, which - handle the Intent sequentially. -

Related: Intent, Intent - Filter.

- -
Layout Resource
-
An XML file that describes the layout of an Activity screen. -

Related: Resources

- -
Manifest File
-
An XML file that each application must define, to describe the - application's package name, version, components (activities, intent - filters, services), imported libraries, and describes the various - activies, and so on. See The - AndroidManifest.xml File for complete information.
- -
Nine-patch / 9-patch / Ninepatch image
-
A resizeable bitmap resource that can be used for backgrounds or other - images on the device. See - Nine-Patch Stretchable Image for more information. -

Related: Resources.

- -
OpenGL ES
-
Android provides OpenGL ES libraries that you can use for fast, - complex 3D images. It is harder to use than a Canvas object, but - better for 3D objects. The {@link android.opengl} and - {@link javax.microedition.khronos.opengles} packages expose - OpenGL ES functionality. -

Related: Canvas, Surface

- -
Resources
-
Nonprogrammatic application components that are external to the - compiled application code, but which can be loaded from application code - using a well-known reference format. Android supports a variety of - resource types, but a typical application's resources would consist of UI - strings, UI layout components, graphics or other media files, and so on. - An application uses resources to efficiently support localization and - varied device profiles and states. For example, an application would - include a separate set of resources for each supported local or device - type, and it could include layout resources that are specific to the - current screen orientation (landscape or portrait). For more information - about resources, see Resources and - Assets. The resources of an application are always stored in the - res/* subfolders of the project.
- -
Service
-
An object of class {@link android.app.Service} that runs in the - background (without any UI presence) to perform various persistent - actions, such as playing music or monitoring network activity. -

Related: Activity

- -
Surface
-
An object of type {@link android.view.Surface} representing a block of - memory that gets composited to the screen. A Surface holds a Canvas object - for drawing, and provides various helper methods to draw layers and resize - the surface. You should not use this class directly; use - {@link android.view.SurfaceView} instead. -

Related: Canvas

- -
SurfaceView
-
A View object that wraps a Surface for drawing, and exposes methods to - specify its size and format dynamically. A SurfaceView provides a way to - draw independently of the UI thread for resource-intensive operations - (such as games or camera previews), but it uses extra memory as a result. - SurfaceView supports both Canvas and OpenGL ES graphics. The base class is - {@link android.view.SurfaceView}. -

Related: Surface

- -
Theme
-
A set of properties (text size, background color, and so on) bundled - together to define various default display settings. Android provides a - few standard themes, listed in {@link android.R.style} (starting with - "Theme_").
- -
URIs in Android
-
Android uses URI strings as the basis for requesting data in a content - provider (such as to retrieve a list of contacts) and for requesting - actions in an Intent (such as opening a Web page in a browser). The URI - scheme and format is specialized according to the type of use, and an - application can handle specific URI schemes and strings in any way it - wants. Some URI schemes are reserved by system components. For example, - requests for data from a content provider must use the - content://. In an Intent, a URI using an http:// - scheme will be handled by the browser.
- -
View
-
An object that draws to a rectangular area on the screen and handles - click, keystroke, and other interaction events. A View is a base class for - most layout components of an Activity or Dialog screen (text boxes, - windows, and so on). It receives calls from its parent object (see - viewgroup, below)to draw itself, and informs its parent object about where - and how big it would like to be (which may or may not be respected by the - parent). For more information, see {@link android.view.View}. -

Related: Viewgroup, Widget -

- -
Viewgroup
-
A container object that groups a set of child Views. The viewgroup is - responsible for deciding where child views are positioned and how large - they can be, as well as for calling each to draw itself when appropriate. - Some viewgroups are invisible and are for layout only, while others have - an intrinsic UI (for instance, a scrolling list box). Viewgroups are all - in the {@link android.widget widget} package, but extend - {@link android.view.ViewGroup ViewGroup}. -

Related: View

- -
Widget
-
One of a set of fully implemented View subclasses that render form - elements and other UI components, such as a text box or popup menu. - Because a widget is fully implemented, it handles measuring and drawing - itself and responding to screen events. Widgets are all in the - {@link android.widget} package.
- - - -
Window
-
In an Android application, an object derived from the abstract class - {@link android.view.Window} that specifies the elements of a generic - window, such as the look and feel (title bar text, location and content of - menus, and so on). Dialog and Activity use an implementation of this class - to render a window. You do not need to implement this class or use windows - in your application.
- - -
\ No newline at end of file diff --git a/docs/html/guide/appendix/index.jd b/docs/html/guide/appendix/index.jd deleted file mode 100644 index 6b25e34..0000000 --- a/docs/html/guide/appendix/index.jd +++ /dev/null @@ -1,13 +0,0 @@ -page.title=Appendix -@jd:body - -
-
Supported Android Media Formats
-
A list of media codecs included in the Android platform.
-
Intents List: Invoking Google Applications on Android Devices
-
Intents you can send to invoke Google applications on Android devices.
-
FAQs, Tips, and How-to
-
How to get things done in Android.
-
Glossary
-
Glossary of Android terminology.
-
diff --git a/docs/html/guide/appendix/media-formats.jd b/docs/html/guide/appendix/media-formats.jd deleted file mode 100644 index 5419ad6..0000000 --- a/docs/html/guide/appendix/media-formats.jd +++ /dev/null @@ -1,197 +0,0 @@ -page.title=Android Supported Media Formats -@jd:body - -

The Core Media Formats table below describes the media format support built into the Android platform. Note that any given mobile device may provide support for additional formats or file types not listed here.

-

For your convenience, the table T-Mobile G1 Media Formats describes the additional media formats supported by the T-Mobile G1 device.

- - -

Core Media Formats

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeFormatEncoderDecoderDetailsFile Type(s) Supported
AudioAAC LC/LTP XMono/Stereo content in any combination of standard bit rates up to 160 kbps and sampling rates from 8 to 48kHz3GPP (.3gp) and MPEG-4 (.mp4, .m4a). No support for raw AAC (.aac)
HE-AACv1 (AAC+) X
HE-AACv2 (enhanced AAC+) X
AMR-NBXX4.75 to 12.2 kbps sampled @ 8kHz3GPP (.3gp) -
AMR-WB X9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz3GPP (.3gp)
MP3 XMono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR) -MP3 (.mp3)
MIDI XMIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody Type 0 and 1 (.mid, .xmf, .mxmf). Also RTTTL/RTX (.rtttl, .rtx), OTA (.ota), and iMelody (.imy)
Ogg Vorbis X Ogg (.ogg)
PCM/WAVE X8- and 16-bit linear PCM (rates up to limit of hardware)WAVE (.wav)
ImageJPEGXXbase+progressiveJPEG (.jpg)
GIF X GIF (.gif)
PNG X PNG (.png)
BMP X BMP (.bmp)
VideoH.263XX 3GPP (.3gp)
H.264XX 3GPP (.3gp) and MPEG-4 (.mp4)
MPEG4 SP   3GPP (.3gp)
- -

T-Mobile G1 Media Formats

- -

In addition to the core media formats supported in the Android platform, the T-Mobile G1 also supports the formats listed below.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeFormatEncoderDecoderDetailsFile Type(s) Supported
AudioWMA XSupports WMA standard L1-L3: -
    -
  • L1: 64 kbps - 161 kbps @ 44.1kHz
  • -
  • L2: <=161 kbps <=48 kHz
  • -
  • L3: <385 kbps <=48 kHz
  • -
-Mono and stereo profiles with 16-bits per sample. Decoder does not support WMA Pro, Lossless, or Speech codecs. -
Windows Media Audio (.wma)
VideoWMV XVersions 7, 8 and 9. Simple profile onlyWindows Media Video (.wmv)
- - -

Note that Windows Media codecs are not part of the Android platform and require special licensing from Microsoft or an authorized developer such as Packet Video.

diff --git a/docs/html/guide/basics/appmodel.jd b/docs/html/guide/basics/appmodel.jd deleted file mode 100644 index 323fc9b..0000000 --- a/docs/html/guide/basics/appmodel.jd +++ /dev/null @@ -1,261 +0,0 @@ -page.title=Application Model -@jd:body -

Android Application Model: Applications, Tasks, Processes, and Threads

- -

In most operating systems, there is a strong 1-to-1 correlation between -the executable image (such as the .exe on Windows) that an application lives in, -the process it runs in, and the icon and application the user interacts with. -In Android these associations are much more fluid, and it is important to -understand how the various pieces can be put together.

- -

Because of the flexible nature of Android applications, there is some -basic terminology that needs to be understood when implementing the -various pieces of an application:

- - - -

Tasks

- -

A key point here is: when the user sees as an "application," what -they are actually dealing with is a task. If you just create a .apk -with a number of activities, one of which is a top-level entry point (via -an {@link android.R.styleable#AndroidManifestIntentFilter intent-filter} for -the action android.intent.action.MAIN and -category android.intent.category.LAUNCHER), then there will indeed -be one task created for your .apk, and any activities you start from there -will also run as part of that task.

- -

A task, then, from the user's perspective your application; and from the -application developer's perspective it is one or more activities the user -has traversed through in that task and not yet closed, or an activity stack. -A new task is created by -starting an activity Intent with the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK -Intent.FLAG_ACTIVITY_NEW_TASK} flag; this Intent will be used as the root Intent of -the task, defining what task it is. Any activity started without this flag -will run in the same task as the activity that is starting it (unless that -activity has requested a special launch mode, as discussed later). Tasks can -be re-ordered: if you use FLAG_ACTIVITY_NEW_TASK but there is already a task -running for that Intent, the current task's activity stack will be brought -to the foreground instead of starting a new task.

- -

FLAG_ACTIVITY_NEW_TASK must only be used with care: using it says that, -from the user's perspective, a new application starts at this point. If this -is not the behavior you desire, you should not be creating a new task. In -addition, you should only use the new task flag if it is possible for the user -to navigate from home back to where they are and launch the same Intent as a -new task. Otherwise, if the user presses HOME instead of BACK from the task -you have launched, your task and its activities will be ordered behind the -home screen without a way to return to them.

- -

Task Affinities

- -

In some cases Android needs to know which task an activity belongs to even when -it is not being launched in to a specific task. This is accomplished through -task affinities, which provide a unique static name for the task that one or more -activities are intended to run in. The default task affinity for an activity -is the name of the .apk package name the activity is implemented in. This -provides the normally expected behavior, where all of the activities in a -particular .apk are part of a single application to the user.

- -

When starting a new activity without the -{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK -Intent.FLAG_ACTIVITY_NEW_TASK} flag, task affinities have no impact on the -task the new activity will run in: it will always run in the task of the -activity that is starting it. However, if the NEW_TASK flag is being used, -then the affinity will be used to determine if a task already exists with -the same affinity. If so, that task will be brought to the front and the -new activity launched at the top of that task.

- -

This behavior is most useful for situations where you must use the -NEW_TASK flag, in particular launching activities from status bar notifications -or home screen shortcuts. The result is that, when the user launches your -application this way, its current task state will be brought to the foreground, -and the activity they now want to look at placed on top of it.

- -

You can assign your own task affinities in your manifest's -{@link android.R.styleable#AndroidManifestApplication application} tag for -all activities in the .apk, or the -{@link android.R.styleable#AndroidManifestActivity activity} tag of -individual activities. Some examples of how this can be used are:

- - -
  • If you are replacing a notification, shortcut, or other such "inner" -activity of an application that can be launched from outside of it, you may -need to explicitly set the taskAffinity of your replacement activity to be -the same as the application you are replacing. For example, if you are -replacing the contacts details view (which the user can make and invoke -shortcuts to), you would want to set the taskAffinity to -"com.android.contacts".
  • - - -

    Launch Modes and Launch Flags

    - -

    The main way you control how activities interact with tasks is through -the activity's -{@link android.R.styleable#AndroidManifestActivity_launchMode launchMode} -attribute and the {@link android.content.Intent#setFlags flags} associated -with an Intent. These two parameters can work together in various ways -to control the outcome of the activity launch, as described in their -associated documentation. Here we will look at some common use cases and -combinations of these parameters.

    - -

    The most common launch mode you will use (besides the default -standard mode) is singleTop. This does not have -an impact on tasks; it just avoids starting the same activity multiple times -on the top of a stack. - -

    The singleTask launch mode has a major -impact on tasks: it causes the activity to always be started in -a new task (or its existing task to be brought to the foreground). Using -this mode requires a lot of care in how you interact with the rest of the -system, as it impacts every path in to the activity. It should only be used -with activities that are front doors to the application (that is, which -support the MAIN action and LAUNCHER category).

    - -

    The singleInstance launch mode is even more specialized, and -should only be used in applications that are implemented entirely as one -activity.

    - -

    A situation you will often run in to is when another entity (such as the -{@link android.app.SearchManager} or {@link android.app.NotificationManager}) -starts one of your activities. In this case, the -{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK -Intent.FLAG_ACTIVITY_NEW_TASK} flag must be used, because the activity is -being started outside of a task (and the application/task may not even -exist). As described previously, the standard behavior in this situation -is to bring to the foreground the current task matching the new activity's -affinity and start the new activity at the top of it. There are, however, -other types of behavior that you can implement.

    - -

    One common approach is to also use the -{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP -Intent.FLAG_ACTIVITY_CLEAR_TOP} flag in conjunction with NEW_TASK. By doing so, -if your task is already running, then it will be brought to the foreground, -all of the activities on its stack cleared except the root activity, and the -root activity's {@link android.app.Activity#onNewIntent} called with the -Intent being started. Note that the activity often also use the singleTop -or singleTask launch mode when using this approach, so that -the current instance is given the new intent instead of requiring that it -be destroyed and a new instance started.

    - -

    Another approach you can take is to set the notification activity's -android:taskAffinity to the empty string "" (indicating no affinity) -and setting the -{@link android.R.styleable#AndroidManifestActivity_noHistory -android:noHistory} and -{@link android.R.styleable#AndroidManifestActivity_excludeFromRecents -android:excludeFromRecents} attributes. -This approach is useful if you would like the notification -to take the user to a separate activity describing it, rather than return -to the application's task. By specifying these attributes, the activity will -be finished whether the user leaves it with BACK or HOME and it will not -show up in the recent tasks list; if the noHistory attribute -isn't specified, pressing HOME will result in the activity and its task -remaining in the system, possibly with no way to return to it.

    - -

    Be sure to read the documentation on the -{@link android.R.styleable#AndroidManifestActivity_launchMode launchMode attribute} -and the {@link android.content.Intent#setFlags Intent flags} for the details -on these options.

    - -

    Processes

    - -

    In Android, processes are entirely an implementation detail of applications -and not something the user is normally aware of. Their main uses are simply:

    - - - -

    As described previously, the -{@link android.R.styleable#AndroidManifestApplication_process process} attribute -is used to control the process that particular application components run in. -Note that this attribute can not be used to violate security of the system: if -two .apks that are not sharing the same user ID try to run in the same process, -this will not be allowed and different distinct processes will be created for -each of them.

    - -

    See the security document for -more information on these security restrictions.

    - -

    Threads

    - -

    Every process has one or more threads running in it. In most situations, Android -avoids creating additional threads in a process, keeping an application -single-threaded unless it creates its own threads. An important repercussion -of this is that all calls to {@link android.app.Activity}, -{@link android.content.BroadcastReceiver}, and {@link android.app.Service} -instances are made only from the main thread of the process they are running in.

    - -

    Note that a new thread is not created for each -Activity, BroadcastReceiver, Service, or ContentProvider instance: -these application components are instantiated in the desired process (all in the -same process unless otherwise specified), in the main thread of that process. -This means that none of these components (including services) should perform -long or blocking operations (such as networking calls or computation loops) -when called by the system, since this will block -all other components in the process. You can use the standard library -{@link java.lang.Thread} class or Android's {@link android.os.HandlerThread} -convenience class to perform long operations on another thread.

    - -

    There are a few important exceptions to this threading rule:

    - - diff --git a/docs/html/guide/basics/building-blocks.jd b/docs/html/guide/basics/building-blocks.jd deleted file mode 100644 index b8a609e..0000000 --- a/docs/html/guide/basics/building-blocks.jd +++ /dev/null @@ -1,76 +0,0 @@ -page.title=Building Blocks -@jd:body -

    Android Building Blocks

    - -

    You can think of an Android application as a collection of components, of -various kinds. These components are for the most part quite loosely coupled, -to the degree where you can accurately describe them as a federation of -components rather than a single cohesive application.

    - -

    Generally, these components all run in the same system process. It's -possible (and quite common) to create multiple threads within that process, -and it's also possible to create completely separate child processes if you -need to. Such cases are pretty uncommon though, because Android tries very -hard to make processes transparent to your code.

    - -

    These are the most important parts of the Android APIs:

    - -
    -
    AndroidManifest.xml
    -
    The AndroidManifest.xml file is the control file that tells the system - what to do with all the top-level components (specifically activities, - services, intent receivers, and content providers described below) - you've created. For instance, this is the - "glue" that actually specifies which Intents your Activities receive.
    - -
    {@link android.app.Activity Activities}
    -
    An Activity is, fundamentally, an object that has a life cycle. An - Activity is a chunk of code that does some work; if necessary, that work - can include displaying a UI to the user. It doesn't have to, though - some - Activities never display UIs. Typically, you'll designate one of your - application's Activities as the entry point to your application.
    - - -
    {@link android.view.View Views}
    -
    A View is an object that knows how to draw itself to the screen. - Android user interfaces are comprised of trees of Views. If you want to - perform some custom graphical technique (as you might if you're writing a - game, or building some unusual new user interface widget) then you'd - create a View.
    - - -
    {@link android.content.Intent Intents}
    -
    An Intent is a simple message object that represents an "intention" to - do something. For example, if your application wants to display a web - page, it expresses its "Intent" to view the URI by creating an Intent - instance and handing it off to the system. The system locates some other - piece of code (in this case, the Browser) that knows how to handle that - Intent, and runs it. Intents can also be used to broadcast interesting - events (such as a notification) system-wide.
    - - -
    {@link android.app.Service Services}
    -
    A Service is a body of code that runs in the background. It can run in - its own process, or in the context of another application's process, - depending on its needs. Other components "bind" to a Service and invoke - methods on it via remote procedure calls. An example of a Service is a - media player; even when the user quits the media-selection UI, she - probably still intends for her music to keep playing. A Service keeps the - music going even when the UI has completed.
    - - -
    {@link android.app.NotificationManager Notifications}
    -
    A Notification is a small icon that appears in the status bar. Users - can interact with this icon to receive information. The most well-known - notifications are SMS messages, call history, and voicemail, but - applications can create their own. Notifications are the - strongly-preferred mechanism for alerting the user of something that needs - their attention.
    - -
    {@link android.content.ContentProvider ContentProviders}
    -
    A ContentProvider is a data storehouse that provides access to data on - the device; the classic example is the ContentProvider that's used to - access the user's list of contacts. Your application can access data that - other applications have exposed via a ContentProvider, and you can also - define your own ContentProviders to expose data of your own.
    -
    diff --git a/docs/html/guide/basics/fixme-gs-core-packages.jd b/docs/html/guide/basics/fixme-gs-core-packages.jd deleted file mode 100644 index 5281990..0000000 --- a/docs/html/guide/basics/fixme-gs-core-packages.jd +++ /dev/null @@ -1,92 +0,0 @@ -page.title=Getting Started -@jd:body -

    Getting Started with Android

    - -

    To get started with Android, please read the following sections first:

    -
    -
    Installing the SDK and - Plugin
    -
    How to install the Android SDK and Eclipse plugin.
    -
    Developing and Debugging
    -
    An introduction to developing and debugging Android applications in Eclipse, - plus information on using other IDEs.
    -
    Hello Android
    -
    Writing your first Android Application, the ever popular Hello World, - Android style.
    -
    Anatomy of an App
    -
    A guide to the structure and architecture of an Android - Application. This guide will help you understand the pieces that make up - an Android app.
    -
    Notepad Tutorial
    -
    This tutorial document will lead you through - constructing a real Android Application: A notepad which can create, edit - and delete notes, and covers many of the basic concepts with practical - examples.
    -
    Development Tools
    -
    The - command line tools included with the SDK, what they do, and how to use - them.
    -
    Application Model
    -
    A guide to Applications, Tasks, Processes, and Threads. - These are the elements that define the way your application is run by the - system and presented to the user.
    -
    Application Life Cycle
    -
    The important life-cycle details for - Applications and the Activities running inside of them.
    - -
    - -

    Other Introductory Material

    -

    After reading the sections above, the following Getting Started information is also very useful:

    - - -

    Core Packages

    -

    These are the basic packages that make up the Android SDK for writing -applications. The packages are organized as layers, listed here from -lowest-level to highest.

    - -
    -
    {@link android.util}
    -
    contains various low-level utility classes, such - as specialized container classes, XML utilities, etc.
    -
    {@link android.os}
    -
    provides basic operating system services, message - passing, and inter-process communication.
    -
    {@link android.graphics}
    is the core rendering package.
    -
    {@link android.text}, {@link android.text.method}, {@link - android.text.style}, and {@link android.text.util}
    -
    supply a rich set of - text processing tools, supporting rich text, input methods, etc.
    -
    {@link android.database}
    -
    contains low-level APIs for working with - databases.
    -
    {@link android.content}
    -
    provides various services for accessing data - on the device: applications installed on the device and their associated - resources, and content providers for persistent dynamic data.
    -
    {@link android.view}
    -
    is the core user-interface framework.
    -
    {@link android.widget}
    -
    supplies standard user interface elements - (lists, buttons, layout managers, etc) built from the view package.
    -
    {@link android.app}
    -
    provides the high-level application model, - implemented using Activities.
    -
    - -

    Other Notable Packages

    - -

    These packages provide additional domain-specific features of the Android -platform. They are not necessary for basic application development.

    - -
    -
    {@link android.provider}
    -
    contains definitions for various standard - content providers included with the platform.
    -
    {@link android.telephony}
    -
    provides APIs for interacting with the - device's phone stack.
    -
    {@link android.webkit}
    -
    includes various APIs for working with - web-based content.
    -
    diff --git a/docs/html/guide/basics/index.html b/docs/html/guide/basics/index.html deleted file mode 100644 index 4881acf..0000000 --- a/docs/html/guide/basics/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -click here if you are not redirected. - - \ No newline at end of file diff --git a/docs/html/guide/basics/what-is-android.jd b/docs/html/guide/basics/what-is-android.jd deleted file mode 100644 index b75321b..0000000 --- a/docs/html/guide/basics/what-is-android.jd +++ /dev/null @@ -1,135 +0,0 @@ -page.title=What is Android? -@jd:body - -

    Android is a software stack for mobile devices that includes an operating -system, middleware and key applications. The Android SDK -provides the tools and APIs necessary to begin developing applications on the -Android platform using the Java programming language.

    - -

    Features

    - - - - -

    Android Architecture

    - -

    The following diagram shows the major components of the Android operating -system. Each section is described in more detail below.

    - -

    Android System Architecture

    - - -

    Applications

    - -

    Android will ship with a set of core applications including an email -client, SMS program, calendar, maps, browser, contacts, and -others. All applications are written using the Java programming language.

    - - -

    Application Framework

    - -

    Developers have full access to the same framework APIs used by the core -applications. The application architecture is designed to simplify the reuse -of components; any application can publish its capabilities and any other -application may then make use of those capabilities (subject to security -constraints enforced by the framework). This same mechanism allows components -to be replaced by the user.

    - -

    Underlying all applications is a set of services and systems, including: -

    - -

    For more details and a walkthrough of an application, see the Notepad Tutorial.

    - - -

    Libraries

    - -

    Android includes a set of C/C++ libraries used by various components of the -Android system. These capabilities are exposed to developers through the -Android application framework. Some of the core libraries are listed below:

    - - - - -

    Android Runtime

    - -

    Android includes a set of core libraries that provides most of -the functionality available in the core libraries of the Java programming -language.

    - -

    Every Android application runs in its own process, with its own instance of -the Dalvik virtual machine. Dalvik has been written so that a device can run -multiple VMs efficiently. The Dalvik VM executes files in the Dalvik -Executable (.dex) format which is optimized for minimal memory -footprint. The VM is register-based, and runs classes -compiled by a Java language compiler that have been transformed into the .dex -format by the included "dx" tool.

    - -

    The Dalvik VM relies on the Linux kernel for underlying functionality such -as threading and low-level memory management.

    - - - -

    Linux Kernel

    - -

    Android relies on Linux version 2.6 for core system services such as -security, memory management, process management, network stack, and driver -model. The kernel also acts as an abstraction layer between the hardware and -the rest of the software stack.

    diff --git a/docs/html/guide/developing/app-signing.jd b/docs/html/guide/developing/app-signing.jd deleted file mode 100644 index 582dfb2..0000000 --- a/docs/html/guide/developing/app-signing.jd +++ /dev/null @@ -1,428 +0,0 @@ -page.title=Signing Your Applications -@jd:body - -

    The Android system requires that all installed applications be digitally -signed with a certificate whose private key is held by the application's -developer. The system uses the certificate as a means of identifying the author of -an application and establishing trust relationships between applications, rather -than for controlling which applications the user can install. The certificate -does not need to be signed by a certificate authority: it is perfectly -allowable, and typical, for Android applications to use self-signed -certificates.

    - -

    The important points to understand about signing Android applications are:

    - - - -

    The Android system will not install or run an application that is not signed appropriately. This -applies wherever the Android system is run, whether on an actual device or on the emulator. -For this reason, you must set up signing for your application before you will be able to -run or debug it on an emulator or device.

    - -

    The Android SDK tools assist you in signing your applications when debugging. Both the ADT Plugin -for Eclipse and the Ant build tool offer two signing modes — debug mode and release mode. - -

    - -

    Signing Strategies

    - -

    Some aspects of application signing may affect how you approach the development -of your application, especially if you are planning to release multiple -applications.

    - -

    In general, the recommended strategy for all developers is to sign -all of your applications with the same certificate, throughout the expected -lifespan of your applications. There are several reasons why you should do so:

    - - - -

    Another important consideration in determining your signing strategy is -how to set the validity period of the key that you will use to sign your -applications.

    - - - -

    As you design your application, keep these points in mind and make sure to -use a suitable certificate to sign your applications.

    - -

    Basic Setup for Signing

    - -

    To support the generation of a keystore and debug key, you should first make sure that -Keytool is available to the SDK build -tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure -that your JAVA_HOME environment variable is set and that it references a suitable JDK. -Alternatively, you can add the JDK version of Keytool to your PATH variable.

    - -

    If you are developing on a version of Linux that originally came with GNU Compiler for -Java, make sure that the system is using the JDK version of Keytool, rather than the gcj -version. If Keytool is already in your PATH, it might be pointing to a symlink at -/usr/bin/keytool. In this case, check the symlink target to make sure that it points -to the Keytool in the JDK.

    - -

    If you will release your application to the public, you will also need to have -the Jarsigner tool available on your machine. Both Jarsigner and Keytool are included -in the JDK.

    - -

    Signing in Debug Mode

    - -

    The Android build tools provide a debug signing mode that makes it easier for you -to develop and debug your application, while still meeting the Android system -requirement for signing your .apk when it is installed in the emulator or a device.

    - -

    If you are developing in Eclipse/ADT and have set up Keytool as described -above, signing in debug mode is enabled by default. When you run or debug your -application, ADT signs the .apk for you and installs it on the emulator. No -specific action on your part is needed, provided ADT has access to Keytool.

    - -

    If you use Ant to build your .apk files, debug signing mode -is enabled by default, assuming that you are using a build.xml file generated by the -activitycreator tool included in the latest SDK. When you run Ant against build.xml to -compile your app, the build script generates a keystore/key and signs the .apk for you. -No specific action on your part is needed.

    - -

    Note that you can not release your application to the public if it is signed only with -the debug key.

    - -

    Signing for Public Release

    - -

    When your application is ready for release to other users, you must:

    -
      -
    1. Compile the application in release mode
    2. -
    3. Obtain a suitable private key, and then
    4. -
    5. Sign the application with your private key
    6. -
    7. Secure your private key
    8. -
    - -

    The sections below provide information about these steps.

    - -

    Compiling for Release

    - -

    To prepare your application for release, you must first compile it in release mode. -In release mode, the Android build tools compile your application as usual, -but without signing it with the debug key.

    - -

    If you are developing in Eclipse/ADT, right-click the project in the Package -pane and select Android Tools > Export Application -Package. You can then specify the file location for the unsigned .apk. -Alternatively, you can follow the "Exporting the unsigned .apk" -link in the Manifest Editor overview page.

    - -

    If you are using Ant, all you need to do is specify the build target -"release" in the Ant command. For example, if you are running Ant from the -directory containing your build.xml file, the command would look like this:

    - -
    $ ant release
    - -

    The build script compiles the application .apk without signing it. - -

    Note that you can not release your application unsigned, or signed with the debug key.

    - -

    Obtaining a Suitable Private Key

    - -

    In preparation for signing your application, you must first ensure that -you have a suitable private key with which to sign. A suitable private -key is one that:

    - - - -

    The key may be self-signed. If you do not have a suitable key, you must -generate one using Keytool. Make sure that you have Keytool available, as described -in Basic Setup.

    - -

    To generate a self-signed key with Keytool, use the keytool -command and pass any of the options listed below (and any others, as -needed).

    - -

    Before you run Keytool, make sure to read Securing Your Key for a discussion of how to keep your -key secure and why doing so is critically important to you and to users. In -particular, when you are generating your key, you should select strong -passwords for both the keystore and key.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Keytool OptionDescription
    -genkeyGenerate a key pair (public and private -keys)
    -vEnable verbose output.
    -keystore <keystore-name>.keystoreA name -for the keystore containing the private key.
    -storepass <password>

    A password for the -keystore.

    As a security precaution, do not include this option -in your command line unless you are working at a secure computer. -If not supplied, Keytool prompts you to enter the password. In this -way, your password is not stored in your shell history.

    -alias <alias_name>An alias for the key.
    -keyalg <alg>The encryption algorithm to use -when generating the key.
    -dname <name>

    A Distinguished Name that describes -who created the key. The value is used as the issuer and subject fields in the -self-signed certificate.

    Note that you do not need to specify this option -in the command line. If not supplied, Jarsigner prompts you to enter each -of the Distinguished Name fields (CN, OU, and so on).

    -validity <valdays>

    The validity period for the -key, in days.

    Note: A value of 9500 or greater is recommended.

    -keypass <password>

    The password for the key.

    -

    As a security precaution, do not include this option -in your command line unless you are working at a secure computer. -If not supplied, Keytool prompts you to enter the password. In this -way, your password is not stored in your shell history.

    - - -

    Here's an example of a Keytool command that generates a private key:

    - -
    $ keytool -genkey -v -keystore my-release-key.keystore 
    --alias alias_name -keyalg RSA -validity 9500
    - -

    Running the example command above, Keytool prompts you to provide -passwords for the keystore and key, and to provide the Distinguished -Name fields for your key. It then generates the keystore as a file called -my-release-key.keystore. The keystore and key are -protected by the passwords you entered. The keystore contains -a single key, valid for 9500 days. The alias is a name that you — -will use later, to refer to this keystore when signing your application.

    - -

    For more information about Keytool, see the documentation at - -http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security

    - -

    Signing Your Application

    - -

    When you are ready to actually sign your .apk for release, you can do so -using the Jarsigner tool. Make sure that you have Jarsigner available on your -machine, as described in Basic Setup. Also, make sure that -the keystore containing your private key is available.

    - -

    To sign your application, you run Jarsigner, referencing both the -application's .apk and the keystore containing the private key with which to -sign the .apk. The table below shows the options you could use.

    - - - - - - - - - - - - - - - - - - -
    Jarsigner OptionDescription
    -keystore <keystore-name>.keystoreThe name of -the keystore containing your private key.
    -verboseEnable verbose output.
    -storepass <password>

    The password for the -keystore.

    As a security precaution, do not include this option -in your command line unless you are working at a secure computer. -If not supplied, Jarsigner prompts you to enter the password. In this -way, your password is not stored in your shell history.

    -keypass <password>

    The password for the private -key.

    As a security precaution, do not include this option -in your command line unless you are working at a secure computer. -If not supplied, Jarsigner prompts you to enter the password. In this -way, your password is not stored in your shell history.

    - -

    Here's how you would use Jarsigner to sign an application package called -my_application.apk, using the example keystore created above. -

    - -
    $ jarsigner -verbose -keystore my-release-key.keystore 
    -my_application.apk alias_name
    - -

    Running the example command above, Jarsigner prompts you to provide -passwords for the keystore and key. It then modifies the APK -in-place, meaning the .apk is now signed. Note that you can sign an -APK multiple times with different keys.

    - -

    To verify that your .apk is signed, you can use a command like this:

    - -
    $ jarsigner -verify my_signed.apk
    - -

    If the .apk is signed properly, Jarsigner prints "jar verified". -If you want more details, you can try one of these commands:

    - -
    $ jarsigner -verify -verbose my_application.apk
    - -

    or

    - -
    $ jarsigner -verify -verbose -certs my_application.apk
    - -

    The command above, with the -certs option added, will show you the -"CN=" line that describes who created the key.

    - -

    Note: if you see "CN=Android Debug", this means the .apk was -signed with the debug key generated by the Android SDK. If you intend to release -your application, you must sign it with your private key instead of the debug -key.

    - -

    For more information about Jarsigner, see the documentation at - -http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security

    - -

    Securing Your Private Key

    - -

    Maintaining the security of your private key is of critical importance, both -to you and to the user. If you allow someone to use your key, or if you leave -your keystore and passwords in an unsecured location such that a third-party -could find and use them, your authoring identity and the trust of the user -are compromised.

    - -

    If a third party should manage to take your key without your knowledge or -permission, that person could sign and distribute applications that maliciously -replace your authentic applications or corrupt them. Such a person could also -sign and distribute applications under your identity that attack other -applications or the system itself, or corrupt or steal user data.

    - -

    Your reputation as a developer entity depends on your securing your private -key properly, at all times, until the key is expired. Here are some tips for -keeping your key secure:

    - - - -

    In general, if you follow common-sense precautions when generating, using, -and storing your key, it will remain secure.

    - -

    Expiry of the Debug Certificate

    - -

    The self-signed certificate used to sign your application in debug mode (the default on -Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.

    - -

    When the certificate expires, you will get a build error. On Ant builds, the error -looks like this:

    - -
    debug:
    -[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
    -[exec] Debug Certificate expired on 8/4/08 3:43 PM
    - -

    In Eclipse/ADT, you will see a similar error in the Android console.

    - -

    To fix this problem, simply delete the debug.keystore file. On Linux/Mac OSX, -the file is stored in ~/.android. OOn Windows XP, the file is stored in -C:\Documents and Settings\<user>\Local Settings\Application Data\Android. -On Windows Vista, the file is stored in -C:\Users\<user>\AppData\Local\Android.

    - -

    The next time you build, the build tools will regenerate a new keystore and debug key.

    - -

    Note that, if your development machine is using a non-Gregorian locale, the build -tools may erroneously generate an already-expired debug certificate, so that you get an -error when trying to compile your application. For workaround information, see the -troubleshooting topic -I can't compile my app because the build tools generated an expired debug -certificate.

    \ No newline at end of file diff --git a/docs/html/guide/developing/debug-tasks.jd b/docs/html/guide/developing/debug-tasks.jd deleted file mode 100644 index 6b7c27a..0000000 --- a/docs/html/guide/developing/debug-tasks.jd +++ /dev/null @@ -1,207 +0,0 @@ -page.title=Debugging Tasks -@jd:body - - - -

    This document offers some helpful guidance to debugging applications on Android. - - -

    Tools

    -

    The Android SDK includes a fairly extensive set of tools to help you debug your programs:

    - - -

    Also, see the Troubleshooting section - of the doc to figure out why your application isn't appearing on the emulator, - or why it's not starting.

    - - -

    Debug and Test Settings

    - -

    With the Dev Tools application, you can turn on a number of settings that will make it easier to test - and debug your applications. To get to the development settings page on the emulator, launch the - Dev Tools application and open Development Settings. - This will open the development settings page with the following options (among - others):

    - -

    These settings will be remembered across emulator restarts.

    - -

    Top Debugging Tips

    - -
    -
    Quick stack dump
    -
    To obtain a stack dump from emulator, you can log -in with adb shell, use "ps" to find the process you -want, and then "kill -3 ". The stack trace appears in the log file. -
    - -
    Displaying useful info on the emulator screen
    -
    The device can display useful information such as CPU usage or highlights -around redrawn areas. Turn these features on and off in the developer settings -window as described in Setting debug and test -configurations on the emulator. -
    - -
    Getting system state information from the emulator (dumpstate)
    -
    You can access dumpstate information from the Dalvik Debug Monitor Service -tool. See dumpsys and -dumpstate on the adb topic page.
    - -
    Getting application state information from the emulator (dumpsys)
    -
    You can access dumpsys information from the Dalvik Debug Monitor Service -tool. See dumpsys and -dumpstate on the adb topic page.
    - -
    Getting wireless connectivity information
    -
    You can get information about wireless connectivity using the Dalvik Debug -Monitor Service tool. From the Device menu, select "Dump -radio state".
    - -
    Logging Trace Data
    -
    You can log method calls and other tracing data in an activity by calling -android.os.Debug.startMethodTracing(). See Running the Traceview Debugging -Program for details.
    - -
    Logging Radio Data
    -
    By default, radio information is not logged to the system (it is a lot of -data). However, you can enable radio logging using the following commands: - -
    -adb shell
    -logcat -b radio
    -
    -
    - -
    Running adb
    -
    Android ships with a tool called adb that provides various capabilities, including -moving and syncing files to the emulator, forwarding ports, and running a UNIX -shell on the emulator. See Using adb for details.
    - -
    Getting screen captures from the emulator
    -
    Dalvik Debug Monitor Server (DDMS) can capture screenshots from the emulator.
    - - - - -
    Using debugging helper classes
    - -
    Android provides debug helper classes such as {@link android.util.Log - util.Log} and {@link android.os.Debug} for your convenience.
    -
    - -

    Configuring Your IDE to Attach to the Debugging Port

    - -

    DDMS will assign a specific debugging port to every virtual machine that it - finds on the emulator. You must either attach your IDE to that - port (listed on the Info tab for that VM), or you can use a default port 8700 - to connect to whatever application is currently selected on the list of discovered - virtual machines.

    -

    Your IDE should attach to your application running on the emulator, showing you - its threads and allowing you to suspend them, inspect their state, and set breakpoints. - If you selected "Wait for debugger" in the Development settings panel - the application will run when Eclipse connects, so you will need to set any breakpoints - you want before connecting.

    -

    Changing either the application being debugged or the "Wait for debugger" - option causes the system to kill the selected application if it is currently - running. You can use this to kill your application if it is in a bad state - by simply going to the settings and toggling the checkbox.

    diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd deleted file mode 100644 index 35c0a1a..0000000 --- a/docs/html/guide/developing/device.jd +++ /dev/null @@ -1,163 +0,0 @@ -page.title=Developing on a Device -@jd:body - - - -

    When building mobile applications, it's vital to test them on real -devices prior to releasing them to users. This page covers what you need to know, -including the types of devices that you can use, and how to set one up for -developing and debugging.

    - - -

    Available Devices

    -

    While developers can use regular -consumer devices purchased at retail to test and use their apps, some developers -may choose not to use a retail device, preferring an unlocked or no-contract -device. Here are some options for obtaining devices capable of testing your applications.

    - - -

    T-Mobile G1

    - -

    The T-Mobile G1 device makes an excellent development device. You can write -applications in the SDK and install them on the G1, then run them as users -would, using the same hardware, system, and network.

    - -

    For more information about obtaining a G1, visit the T-Mobile G1 site.

    - - -

    Android Dev Phone 1

    - - -

    The Android Dev Phone 1 is a SIM-unlocked and hardware-unlocked device that -is designed for advanced developers. The device ships with a system image that -is fully compatible with Android 1.0, so you can rely on it when developing your -applications. You can use any SIM in the device and can flash custom Android -builds that will work with the unlocked bootloader. Unlike the bootloader on -retail devices, the bootloader on the Android Dev Phone 1 does not enforce -signed system images. The Android Dev Phone 1 should also appeal to developers -who live outside of T-Mobile geographies.

    - -

    To purchase an Android Dev Phone 1 device, you must first register as an -Android developer on the Android Market site, if you haven't done so already. -Once you've logged into your developer account on Android Market, you can -purchase the device by following the link to "Development phones." To accommodate demand, -there is a limit of 1 device per developer account, for now.

    - -

    The device currently costs $399 (USD) (including free shipping in the US), -and is available for purchase in 18 international markets, including the -US, UK, Germany, Japan, India, Canada, France, Taiwan, Spain, Australia, -Singapore, Switzerland, Netherlands, Austria, Sweden, Finland, Poland, and -Hungary. We will continue to expand this program into new geographies over -time. Check this page for updated information.

    - -

    Note that Android Dev Phone 1 devices are not intended for -non-developer end-users. Because the device can be configured with system -software not provided by or supported by Google or any other company, end-users -operate these devices at their own risk.

    - -

    For full device specs and more information about obtaining an Android Dev -Phone 1 device, see the Android -Market site.

    - - -

    Setting up a Device for Development

    - -

    With a T-mobile G1 or Android Dev Phone 1, you can develop and debug your Android applications just as you -would on the emulator. There are just a few things to do before you can start.

    -
      -
    1. Declare your application as "debuggable" in your Android Manifest. -

      In Eclipse, you can do this from the Application tab when viewing the Manifest - (on the right side, set Debuggable to true). Otherwise, in the AndroidManifest.xml - - file, add android:debuggable="true" to the <application> element.

      -
    2. -
    3. Turn on "USB Debugging" on your device. -

      On the device, go to the home screen, press MENU, select Applications > Development, - then enable USB debugging.

      - -
    4. -
    5. Setup your system to detect your device. -
        -
      • If you're developing on 32-bit Windows, you need to install the 32-bit USB driver for adb. - The USB driver is included in the SDK package. To install it, follow these steps:

        -
          -
        1. Connect your Android device via USB. When the Found New Hardware Wizard appears, - you'll be asked if you'd like Windows Update to search for software. Select No, not this - time and click Next.
        2. - -
        3. Select Install from a list or specified location and click Next.
        4. -
        5. Select Search for the best driver in these locations. Browse to the usb_driver/x86 in the SDK package (<sdk>\usb_driver\x86).
        6. -
        7. Click Finish. The system should install the driver files as necessary. Your machine may require a reboot.
        8. -
        -
      • -
      • If you're developing on 64-bit Windows Vista, you need to install the 64-bit USB driver for adb. - The USB driver is included in the SDK package. To install it, follow these steps:

        -
          -
        1. Connect your Android device via USB. When the Found New Hardware Wizard appears, - you'll be asked if you'd like Windows Update to search for software. Select No, not this - time and click Next.
        2. - -
        3. Select Install from a list or specified location and click Next.
        4. -
        5. Select Search for the best driver in these locations. Browse to the usb_driver/amd64 in the SDK package (<sdk>\usb_driver\amd64).
        6. -
        7. Click Finish. The system should install the driver files as necessary. Your machine may require a reboot.
        8. -
        -
      • -
      • If you're developing on Mac OS X, it just works. Skip this step.
      • -
      • If you're developing on Ubuntu Linux, you need to add a rules file: -
          -
        1. Login as root and create this file: /etc/udev/rules.d/50-android.rules. -

          For Gusty/Hardy, edit the file to read:
          - SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

          - -

          For Dapper, edit the file to read:
          - SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"

          -
        2. -
        3. Now execute:
          - chmod a+rx /etc/udev/rules.d/50-android.rules -
        4. -
        - -
      • -
      -
    6. -
    -

    You can verify that your device is connected by executing adb devices from your -SDK tools/ directory. If connected, you'll see the device name listed as a "device."

    -

    If using Eclipse, select run or debug as usual. You will be presented -with a Device Chooser dialog that lists the available emulator(s) and connected device(s). -Select the device to install and run the application there.

    - -

    If using the Android Debug Bridge (adb), -you can issue commands with the -d flag to target your connected device.

    diff --git a/docs/html/guide/developing/eclipse-adt.jd b/docs/html/guide/developing/eclipse-adt.jd deleted file mode 100644 index 8c482ee..0000000 --- a/docs/html/guide/developing/eclipse-adt.jd +++ /dev/null @@ -1,193 +0,0 @@ -page.title=In Eclipse, with ADT -@jd:body - -

    The Android Development Tools (ADT) plugin for Eclipse adds powerful extensions to the Eclipse integrated development environment. It allows you to create and debug Android applications easier and faster. If you use Eclipse, the ADT plugin gives you an incredible boost in developing Android applications:

    - - - -

    To begin developing Android applications in the Eclipse IDE with ADT, you first need to download the Eclipse IDE and then download and install the ADT plugin. To do so, follow the steps given in Installing the ADT Plugin, in the installation documentation included with your SDK package.

    - -

    Once you've installed the ADT plugin, you begin by creating an Android -project and then set up a launch configuration. After that, you can write, run, and debug -your application.

    - -

    The sections below provide instructions assuming that you have installed the ADT plugin -in your Eclipse environment. If you haven't installed the ADT plugin, you should do that -before using the instructions below.

    - - - -

    Creating an Android Project

    - -

    The ADT plugin provides a New Project Wizard that you can use to quickly create an -Eclipse project for new or existing code. To create the project, follow these steps:

    - - - -
      -
    1. Select File > New > Project
    2. -
    3. Select Android > Android Project, and press Next
    4. -
    5. Select the contents for the project: -
        -
      • Select Create new project in workspace to start a project for new code. -

        Enter the project name, the base package name, the name of a single Activity class to create as a stub .java file, and a name to use for your application.

      • -
      • Select Create project from existing source to start a project from existing code. Use this option if you want to build and run any of the sample applications included with the SDK. The sample applications are located in the samples/ directory in the SDK. -

        Browse to the directory containing the existing source code and click OK. If the directory contains a valid Android manifest file, the ADT plugin fills in the package, activity, and application names for you.

        -
      • -
      -
    6. -
    7. Press Finish.
    8. -
    - -

    The ADT plugin creates the these folders and - files for you as appropriate for the type of project:

    - - - - - - - -

    Creating a Launch Configuration

    - -

    Before you can run and debug your application in Eclipse, you must create a launch configuration for it. A launch configuration specifies the project to launch, the Activity to start, the emulator options to use, and so on.

    - -

    To create a launch configuration for the application, follow these steps as appropriate for your Eclipse version:

    - -
      - -
    1. Open the launch configuration manager. -
        -
      • In Eclipse 3.3 (Europa), select Run > - Open Run Dialog... or Run > - Open Debug Dialog... as appropriate. -
      • -
      • In Eclipse 3.4 (Ganymede), select Run > - Run Configurations... or Run > - Debug Configurations... as appropriate. -
      • -
      -
    2. -
    3. In the project type list on the left, locate the Android Application item and double-click it (or right-click > New), to create a new launch configuration.
    4. -
    5. Enter a name for your configuration.
    6. -
    7. On the Android tab, browse for the project and Activity to start.
    8. -
    9. On the Target tab, set the desired screen and network properties, as well as any other emulator startup options.
    10. -
    11. You can set additional options on the Common tab as desired.
    12. -
    13. Press Apply to save the launch configuration, or press Run or Debug (as appropriate).
    14. - -
    - - -

    Setting Up Application Signing

    - -

    As you begin developing Android applications, you should understand that all -Android applications must be digitally signed before the system will install -them on the emulator or an actual device.

    - -

    The ADT plugin helps you get started quickly by signing your .apk files with -a debug key, prior to installing them on the emulator. This means that you can -compile your application and install it on the emulator without having to -generate your own private key. However, please note that if you intend to -publish your application, you must sign the application with your own -private key, rather than the debug key generated by the SDK tools.

    - -

    To sign your applications, the ADT plugin requires the Keytool utility -included in the JDK. To set up your development environment for -signing, you need to make sure that Keytool is available on your -machine that the ADT plugin knows how to find it.

    - -

    In most cases, you can tell the SDK build tools how to find Keytool by making -sure that your JAVA_HOME environment variable is set and that it references a -suitable JDK. Alternatively, you can add the JDK version of Keytool to your -PATH variable.

    - -

    If you are developing on a version of Linux that originally came with Gnu -Compiler for Java, make sure that the system is using the JDK version of -Keytool, rather than the gcj version. If keytool is already in your PATH, it -might be pointing to a symlink at /usr/bin/keytool. In this case, check the -symlink target to make sure that it points to the keytool in the JDK.

    - -

    In all cases, please read and understand Signing Your -Applications, which provides an overview of application signing on Android -and what it means to you as an Android application developer.

    - - - - -

    Running and Debugging an Application

    - -

    Once you've set up the project and launch configuration for your application, you can run or debug it as described below.

    - -From the Eclipse main menu, select Run > Run or Run > Debug as appropriate, to run or debug the active launch configuration. - -

    Note that the active launch configuration is the one most recently selected in the Run configuration manager. It does not necessarily correspond to the application that is selected in the Eclipse Navigation pane (if any).

    - -

    To set or change the active launch configuration, use the launch configuration manager. See Creating a Launch Configuration for information about how to access the launch configuration manager..

    - -

    Running or debugging the application triggers these actions:

    - - - -

    Eclipse Tips

    -

    Executing arbitrary Java expressions in Eclipse

    -

    You can execute arbitrary code when paused at a breakpoint in Eclipse. For example, - when in a function with a String argument called "zip", you can get - information about packages and call class methods. You can also invoke arbitrary - static methods: for example, entering android.os.Debug.startMethodTracing() will - start dmTrace.

    -

    Open a code execution window, select Window>Show - View>Display from the main menu to open the - Display window, a simple text editor. Type your expression, highlight the - text, and click the 'J' icon (or CTRL + SHIFT + D) to run your - code. The code runs in the context of the selected thread, which must be - stopped at a breakpoint or single-step point. (If you suspend the thread - manually, you have to single-step once; this doesn't work if the thread is - in Object.wait().)

    -

    If you are currently paused on a breakpoint, you can simply highlight and execute - a piece of source code by pressing CTRL + SHIFT + D.

    -

    You can highlight a block of text within the same scope by pressing ALT +SHIFT - + UP ARROW to select larger and larger enclosing blocks, or DOWN ARROW to select - smaller blocks.

    -

    Here are a few sample inputs and responses in Eclipse using the Display window.

    - - - - - - - - - - - - - - - - - -
    InputResponse
    zip(java.lang.String) /work/device/out/linux-x86-debug/android/app/android_sdk.zip
    zip.endsWith(".zip")(boolean) true
    zip.endsWith(".jar")(boolean) false
    -

    You can also execute arbitrary code when not debugging by using a scrapbook page. - Search the Eclipse documentation for "scrapbook".

    - -

    Running DDMS Manually

    - -

    Although the recommended way to debug is to use the ADT plugin, you can manually run DDMS and configure Eclipse to debug on port 8700. (Note: Be sure that you have first started DDMS).

    diff --git a/docs/html/guide/developing/index.html b/docs/html/guide/developing/index.html deleted file mode 100644 index 4881acf..0000000 --- a/docs/html/guide/developing/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -click here if you are not redirected. - - \ No newline at end of file diff --git a/docs/html/guide/developing/other-ide.jd b/docs/html/guide/developing/other-ide.jd deleted file mode 100644 index 7bcb509..0000000 --- a/docs/html/guide/developing/other-ide.jd +++ /dev/null @@ -1,167 +0,0 @@ -page.title=In Other IDEs -@jd:body - -

    The recommended way to develop an Android application is to use - Eclipse with the Android - Development Tools (ADT) plugin, provided in the SDK. The ADT plugin - provides editing, building,and debugging functionality integrated right into the IDE.

    - -

    However, if you'd rather develop your application in another IDE, such as IntelliJ, - or use Eclipse without the ADT plugin, you can do that instead. The SDK - provides the tools you need to set up, build, and debug your application. -

    - - -

    Creating an Android Project

    - -

    The Android SDK includes activityCreator, a program that generates a number of stub files for your project, as well as a build file. You can use the program to create an Android project for new code or from existing code, such as the sample applications included in the SDK. For Linux and Mac, the SDK provides activitycreator and for Windows, activityCreator.bat, a batch script. Regardless of platform, you can use activitycreator in the same way.

    - -

    To run activityCreator and create an Android project, follow these steps:

    - -
      -
    1. In the command line, change to the tools/ directory of the SDK and create a new directory for your project files. If you are creating a project from existing code, change to the root folder of your application instead.
    2. - -
    3. Run activityCreator. In the command, you must specify a fully-qualified class name as an argument. If you are creating a project for new code, the class represents the name of a stub class that the script will create. If you are creating a project from existing code, you must specify the name of one Activity class in the package. Command options for the script include: -

        -
      • --out <folder> which sets the output directory. By default, the output directory is the current directory. If you created a new directory for your project files, use this option to point to it.
      • -
      • --ide intellij, which generates IntelliJ IDEA project files in the newly created project
      • -
      -
    4. -
    - -

    Here's an example:

    -
    -~/android_linux_sdk/tools $ ./activityCreator.py --out myproject your.package.name.ActivityName
    -package: your.package.name
    -out_dir: myproject
    -activity_name: ActivityName
    -~/android_linux_sdk/tools $ 
    - -

    The activityCreator script generates the following files and directories (but will not overwrite existing ones):

    - - - -

    You can now move your folder wherever you want for development, but keep in mind - that you'll have to use the adb program in the tools/ folder to - send files to the emulator, so you'll need access between your solution and - the tools/ folder.

    - -

    Also, you should refrain from moving the - location of the SDK directory, since this will break the build scripts (they - will need to be manually updated to reflect the new SDK location before they will - work again).

    - -

    Building the Application with Ant

    -

    Use the Ant build.xml file generated by - activityCreator to build your application.

    -
      -
    1. If you don't have it, you can obtain Ant from the - Apache Ant home page. Install it and make - sure it is on your executable path.
    2. -
    3. Before calling Ant, you need to declare the JAVA_HOME environment variable to specify the path to where the JDK is installed. -

      Note: When installing JDK on Windows, the default is to install in the "Program Files" directory. This location will cause ant to fail, because of the space. To fix the problem, you can specify the JAVA_HOME variable like this: set JAVA_HOME=c:\Prora~1\Java\. The easiest solution, however, is to install JDK in a non-space directory, for example: c:\java\jdk1.6.0_02.

      -
    4. - - -
    5. If you have not done so already, follow the instructions for Creating a - New Project above to set up the project.
    6. -
    7. You can now run the Ant build file by simply typing ant in the same folder - as the build.xml file for your project. Each time you change - a source file or resource, you should run ant again and it will package up the - latest version of the application for you to deploy.
    8. -
    - -

    Setting Up Application Signing

    - -

    As you begin developing Android applications, you should understand that all -Android applications must be digitally signed before the system will install -them on the emulator or an actual device.

    - -

    The Android build tools help you get started quickly by signing your .apk -files with a debug key, prior to installing them on the emulator. This means -that you can compile your application and install it on the emulator without -having to generate your own private key. However, please note that if you intend -to publish your application, you must sign the application with your -own private key, rather than the debug key generated by the SDK tools.

    - -

    To sign your applications, the ADT plugin requires the Keytool utility -included in the JDK. To set up your development environment for -signing, all you need to do is make sure that Keytool is available on your -machine that the build tools know how to find it.

    - -

    In most cases, you can tell the SDK build tools how to find Keytool by making -sure that -your JAVA_HOME environment variable is set and that it references a suitable -JDK. Alternatively, -you can add the JDK version of Keytool to your PATH variable.

    - -

    If you are developing on a version of Linux that originally came with Gnu -Compiler for Java, -make sure that the system is using the JDK version of Keytool, rather than the -gcj version. -If keytool is already in your PATH, it might be pointing to a symlink at -/usr/bin/keytool. -In this case, check the symlink target to make sure that it points to the -keytool in the JDK.

    - -

    In all cases, please read and understand Signing Your -Applications, which provides an overview of application signing on Android -and what it means to you as an Android application developer.

    - - -

    Running an Android Application

    -

    To run a compiled - application, you will upload the .apk file to the /data/app/ directory - in the emulator using the adb tool as described here:

    -
      -
    1. Start the emulator (run <your_sdk_dir>/tools/emulator from the command line)
    2. -
    3. On the emulator, navigate to the home screen (it is best not to have that - application running when you reinstall it on the emulator; press the Home key - to navigate away from that application).
    4. -
    5. Run adb install myproject/bin/<appname>.apk to upload - the executable. So, for example, to install the Lunar Lander sample, navigate - in the command line to <your_sdk_dir>/sample/LunarLander and type ../../tools/adb install bin/LunarLander.apk
    6. -
    7. In the emulator, open the list of available applications, and scroll down to - select and start your application.
    8. -
    -

    Note: When you install an Activity for the - first time, you might have to restart the emulator before it shows up in the - application launcher, or other applications can call it. This is because - the package manager usually only examines manifests completely on emulator - startup.

    - -

    Attaching a Debugger to Your Application

    -

    This section describes how to display debug information on the screen (such - as CPU usage), as well as how to hook up your IDE to debug running applications - on the emulator.

    - -

    Attaching a debugger is automated using the Eclipse plugin, - but you can configure other IDEs to listen on a debugging port to receive debugging - information.

    -
      -
    1. Start the Dalvik Debug Monitor Server (DDMS) - tool , which - acts as a port forwarding service between your IDE and the emulator.
    2. -
    3. Set - optional debugging configurations on - your emulator, such as blocking application startup for an activity - until a debugger is attached. Note that many of these debugging options - can be used without DDMS, such as displaying CPU usage or screen refresh - rate on the emulator.
    4. -
    5. Configure your IDE to attach to port 8700 for debugging. We - include information on - how to set up Eclipse to debug your project.
    6. - -
    diff --git a/docs/html/guide/developing/tools/aapt.jd b/docs/html/guide/developing/tools/aapt.jd deleted file mode 100644 index 40a209d..0000000 --- a/docs/html/guide/developing/tools/aapt.jd +++ /dev/null @@ -1,20 +0,0 @@ -page.title=Using aapt -@jd:body - -

    aapt stands for Android Asset Packaging Tool and is included in the tools/ directory of the SDK. This tool allows you to view, create, and update Zip-compatible archives (zip, jar, apk). It can also compile resources into binary assets. -

    -

    -Though you probably won't often use aapt directly, build scripts and IDE plugins can utilize this tool to package the apk file that constitutes an Android application. -

    -

    -For more usage details, open a terminal, go to the tools/ directory, and run the command: -

    - - diff --git a/docs/html/guide/developing/tools/adb.jd b/docs/html/guide/developing/tools/adb.jd deleted file mode 100644 index b111047..0000000 --- a/docs/html/guide/developing/tools/adb.jd +++ /dev/null @@ -1,699 +0,0 @@ -page.title=Android Debug Bridge -@jd:body - -
    -
    -

    ADB quickview

    -
      -
    • Manage the state of an emulator or device
    • -
    • Run shell commands on a device
    • -
    • Manage port forwarding on an emulator or device
    • -
    • Copy files to/from an emulator or device
    • -
    - -

    In this document

    -
      -
    1. Issuing ADB Commands
    2. -
    3. Querying for Emulator/Device Instances
    4. -
    5. Directing Commands to a Specific Emulator/Device Instance
    6. -
    7. Installing an Application
    8. -
    9. Forwarding Ports
    10. -
    11. Copying Files to or from an Emulator/Device Instance
    12. -
    13. Listing of adb Commands
    14. -
    15. Issuing Shell Commands
    16. -
    17. Enabling logcat Logging
    18. -
    19. Stopping the adb Server
    20. -
    - -

    See also

    -
      -
    1. Emulator
    2. -
    - -
    -
    - - -

    Android Debug Bridge (adb) is a versatile tool lets you manage the state of an emulator instance or Android-powered device. It is a client-server program that includes three components:

    - - - -

    When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server.

    - -

    The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:

    - -
    -Emulator 1, console: 5554
    -Emulator 1, adb: 5555
    -Emulator 2, console: 5556
    -Emulator 2, adb: 5557 ... -
    - -

    As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

    - -

    Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).

    - -

    The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a trasparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.

    - - - -

    Issuing adb Commands

    - -

    You can issue adb commands from a command line on your development machine or from a script. The usage is:

    - -
    adb [-d|-e|-s <serialNumber>] <command> 
    - -

    When you issue a command, the program invokes an adb client. The client is not specifically associated with any emulator instance, so if multiple emulators/devices are running, you need to use the -d option to specify the target instance to which the command should be directed. For more information about using this option, see Directing Commands to a Specific Emulator/Device Instance.

    - - - -

    Querying for Emulator/Device Instances

    - -

    Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the devices command:

    - -
    adb devices
    - -

    In response, adb prints this status information for each instance:

    - - - -

    The output for each instance is formatted like this:

    - -
    [serialNumber] [state]
    - -

    Here's an example showing the devices command and its output:

    - -
    $ adb devices
    -List of devices attached 
    -emulator-5554  device
    -emulator-5556  device
    -emulator-5558  device
    - -

    If there is no emulator/device running, adb returns no device.

    - - - - -

    Directing Commands to a Specific Emulator/Device Instance

    - -

    If multiple emulator/device instances are running, you need to specify a target instance when issuing adb commands. To so so, use the -s option in the commands. The usage for the -s option is:

    - -
    adb -s <serialNumber> <command> 
    - -

    As shown, you specify the target instance for a command using its adb-assigned serial number. You can use the devices command to obtain the serial numbers of running emulator/device instances.

    - -

    Here is an example:

    - -
    adb -s emulator-5556 install helloWorld.apk
    - -

    Note that, if you issue a command without specifying a target emulator/device instance using -s, adb generates an error. - - - -

    Installing an Application

    -

    You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the install command. With the command, you must specify the path to the .apk file that you want to install:

    - -
    adb install <path_to_apk>
    - -

    For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt).

    - -

    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.

    - - - - -

    Forwarding Ports

    - -

    You can use the forward command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:

    -
    adb forward tcp:6100 tcp:7100
    -

    You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:

    -
    adb forward tcp:6100 local:logd 
    - - - -

    Copying Files to or from an Emulator/Device Instance

    - -

    You can use the adb commands pull and push to copy files to and from an emulator/device instance's data file. Unlike the install command, which only copies an .apk file to a specific location, the pull and push commands let you copy arbitrary directories and files to any location in an emulator/device instance.

    - -

    To copy a file or directory (recursively) from the emulator or device, use

    -
    adb pull <remote> <local>
    - -

    To copy a file or directory (recursively) to the emulator or device, use

    -
    adb push <local> <remote>
    - -

    In the commands, <local> and <remote> refer to the paths to the target files/directory on your development machine (local) and on the emulator/device instance (remote).

    - -

    Here's an example:

    -
    adb push foo.txt /sdcard/foo.txt
    - - - -

    Listing of adb Commands

    - -

    The table below lists all of the supported adb commands and explains their meaning and usage.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CategoryCommandDescriptionComments
    Options-dDirect an adb command to the only attached USB device.Returns an error if more than one USB device is attached.
    -eDirect an adb command to the only running emulator instance.Returns an error if more than one emulator instance is running.
    -s <serialNumber>Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").If not specified, adb generates an error.
    GeneraldevicesPrints a list of all attached emulator/device instances.See Querying for Emulator/Device Instances for more information.
    helpPrints a list of supported adb commands. 
    versionPrints the adb version number.  
    Debuglogcat [<option>] [<filter-specs>]Prints log data to the screen.  
    bugreportPrints dumpsys, dumpstate, and logcat data to the screen, for the purposes of bug reporting.  
    jdwpPrints a list of available JDWP processes on a given device. You can use the forward jdwp:<pid> port-forwarding specification to connect to a specific JDWP process. For example:
    - adb forward tcp:8000 jdwp:472
    - jdb -attach localhost:8000

    -
    Datainstall <path-to-apk>Pushes an Android application (specified as a full path to an .apk file) to the data file of an emulator/device.  
    pull <remote> <local>Copies a specified file from an emulator/device instance to your development computer.  
    push <local> <remote>Copies a specified file from your development computer to an emulator/device instance.  
    Ports and Networkingforward <local> <remote>Forwards socket connections from a specified local port to a specified remote port on the emulator/device instance. Port specifications can use these schemes: -
    • tcp:<portnum>
    • -
    • local:<UNIX domain socket name>
    • -
    • dev:<character device name>
    • -
    • jdwp:<pid>
    -
    ppp <tty> [parm]...Run PPP over USB. -
      -
    • <tty> — the tty for PPP stream. For example dev:/dev/omap_csmi_ttyl.
    • -
    • [parm]... &mdash zero or more PPP/PPPD options, such as defaultroute, local, notty, etc.
    - -

    Note that you should not automatically start a PDP connection.

    Scriptingget-serialnoPrints the adb instance serial number string.See Querying for Emulator/Device Instances for more information.
    get-statePrints the adb state of an emulator/device instance.
    wait-for-deviceBlocks execution until the device is online — that is, until the instance state is device.You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example: -
    adb wait-for-device shell getprop
    - -Note that this command does not cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the install requires the Android package manager, which is available only after the system is fully booted. A command such as - -
    adb wait-for-device install <app>.apk
    - -would issue the install command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error.
    Serverstart-serverChecks whether the adb server process is running and starts it, if not. 
    kill-serverTerminates the adb server process. 
    ShellshellStarts a remote shell in the target emulator/device instance.See Issuing Shell Commands for more information.
    shell [<shellCommand>]Issues a shell command in the target emulator/device instance and then exits the remote shell.
    - - - - -

    Issuing Shell Commands

    - -

    Adb provides an ash shell that you can use to run a variety of commands on an emulator -or device. The command binaries are stored in the file system of the emulator or device, -in this location:

    - -
    /system/bin/...
    - -

    You can use the shell command to issue commands, with or without entering the adb remote shell on the emulator/device.

    - -

    To issue a single command without entering a remote shell, use the shell command like this:

    - -
    adb [-d|-e|-s {<serialNumber>}] shell <shellCommand>
    - -

    To drop into a remote shell on a emulator/device instance, use the shell command like this:

    - -
    adb [-d|-e|-s {<serialNumber>}] shell
    - -

    When you are ready to exit the remote shell, use CTRL+D or exit to end the shell session.

    - -

    The sections below provide more information about shell commands that you can use.

    - - - -

    Examining sqlite3 Databases from a Remote Shell

    - -

    From an adb remote shell, you can use the -sqlite3 command-line program to -manage SQLite databases created by Android applications. The -sqlite3 tool includes many useful commands, such as -.dump to print out the contents of a table and -.schema to print the SQL CREATE statement for an existing table. -The tool also gives you the ability to execute SQLite commands on the fly.

    - -

    To use sqlite3, enter a remote shell on the emulator instance, as described above, then invoke the tool using the sqlite3 command. Optionally, when invoking sqlite3 you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder /data/data/<package_name>/databases/.

    - -

    Here's an example:

    - -
    $ adb -s emulator-5554 shell
    -# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
    -SQLite version 3.3.12
    -Enter ".help" for instructions
    -.... enter commands, then quit...
    -sqlite> .exit 
    - -

    Once you've invoked sqlite3, you can issue sqlite3 commands in the shell. To exit and return to the adb remote shell, use exit or CTRL+D. - - - - -

    UI/Application Exerciser Monkey

    - -

    The Monkey is a program that runs on your emulator or device and generates pseudo-random -streams of user events such as clicks, touches, or gestures, as well as a number of system-level -events. You can use the Monkey to stress-test applications that you are developing, -in a random yet repeatable manner.

    - -

    The simplest way to use the monkey is with the following command, which will launch your -application and send 500 pseudo-random events to it.

    - -
    $ adb shell monkey -v -p your.package.name 500
    - -

    For more information about command options for Monkey, see the complete -UI/Application Exerciser Monkey documentation page.

    - - - - -

    Other Shell Commands

    - -

    The table below lists several of the adb shell commands available. For a complete list of commands and programs, start an emulator instance and use the adb -help command.

    - -
    adb shell ls /system/bin
    - -

    Help is available for most of the commands.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Shell CommandDescriptionComments
    dumpsysDumps system data to the screen.The Dalvik Debug Monitor Service (DDMS) tool offers integrated debug environment that you may find easier to use.
    dumpstateDumps state to a file.
    logcat [<option>]... [<filter-spec>]...Enables radio logging and prints output to the screen.
    dmesgPrints kernel debugging messages to the screen.
    startStarts (restarts) an emulator/device instance. 
    stopStops execution of an emulator/device instance. 
    - - - -

    Enabling logcat Logging

    - -

    The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the logcat command.

    - - - -

    Using logcat Commands

    - -

    You can use the logcat command to view and follow the contents of the system's log buffers. The general usage is:

    - -
    [adb] logcat [<option>] ... [<filter-spec>] ...
    - -

    The sections below explain filter specifications and the command options. See Listing of logcat Command Options for a summary of options.

    - -

    You can use the logcat command from your development computer or from a remote adb shell in an emulator/device instance. To view log output in your development computer, you use

    - -
    $ adb logcat
    - -

    and from a remote adb shell you use

    - -
    # logcat
    - - - -

    Filtering Log Output

    - -

    Every Android log message has a tag and a priority associated with it.

    - - - -

    You can obtain a list of tags used in the system, together with priorities, by running logcat and observing the first two columns -of each message, given as <priority>/<tag>.

    - -

    Here's an example of logcat output that shows that the message relates to priority level "I" and tag "ActivityManager":

    - -
    I/ActivityManager(  585): Starting activity: Intent { action=android.intent.action...}
    - -

    To reduce the log output to a manageable level, you can restrict log output using filter expressions. Filter expressions let you indicate to the system the tags-priority combinations that you are interested in — the system suppresses other messages for the specified tags.

    - -

    A filter expression follows this format tag:priority ..., where tag indicates the tag of interest and priority indicates the minimum level of priority to report for that tag. Messages for that tag at or above the specified priority are written to the log. You can supply any number of tag:priority specifications in a single filter expression. The series of specifications is whitespace-delimited.

    - -

    Here's an example of a filter expression that suppresses all log messages except those with the tag "ActivityManager", at priority "Info" or above, and all log messages with tag "MyApp", with priority "Debug" or above:

    - -
    adb logcat ActivityManager:I MyApp:D *:S
    - -

    The final element in the above expression, *:S, sets the priority level for all tags to "silent", thus ensuring only log messages with "View" and "MyApp" are displayed. Using *:S is an excellent way to ensure that log output is restricted to the filters that you have explicitly specified — it lets your filters serve as a "whitelist" for log output.

    - -

    The following filter expression displays all log messages with priority level "warning" and higher, on all tags:

    - -
    adb logcat *:W
    - -

    If you're running logcat from your development computer (versus running it on a remote adb shell), you can also set a default filter expression by exporting a value for the environment variable ANDROID_LOG_TAGS:

    - -
    export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"
    - -

    Note that ANDROID_LOG_TAGS filter is not exported to the emulator/device instance, if you are running logcat from a remote shell or using adb shell logcat.

    - - - - -

    Controlling Log Output Format

    - -

    Log messages contain a number of metadata fields, in addition to the tag and priority. You can modify the output format for messages so that they display a specific metadata field. To do so, you use the -v option and specify one of the supported output formats listed below.

    - - - -

    When starting logcat, you can specify the output format you want by using the -v option:

    - -
    [adb] logcat [-v <format>]
    - -

    Here's an example that shows how to generate messages in thread output format:

    - -
    adb logcat -v thread
    - -

    Note that you can only specify one output format with the -v option.

    - - - -

    Viewing Alternative Log Buffers

    - -

    The Android logging system keeps multiple circular buffers for log messages, and not all of the log messages are sent to the default circular buffer. To see additional log messages, you can start logcat with the -b option, to request viewing of an alternate circular buffer. You can view any of these alternate buffers:

    - - - -

    The usage of the -b option is:

    - -
    [adb] logcat [-b <buffer>]
    - -

    Here's an example of how to view a log buffer containing radio and telephony messages:

    - -
    adb logcat -b radio
    - - - -

    Viewing stdout and stderr

    - -

    By default, the Android system sends stdout and stderr (System.out and System.err) output to /dev/null. In -processes that run the Dalvik VM, you can have the system write a copy of the output to the log file. In this case, the system writes the messages to the log using the log tags stdout and stderr, both with priority I.

    - -

    To route the output in this way, you stop a running emulator/device instance and then use the shell command setprop to enable the redirection of output. Here's how you do it:

    - -
    $ adb shell stop
    -$ adb shell setprop log.redirect-stdio true
    -$ adb shell start
    - -

    The system retains this setting until you terminate the emulator/device instance. To use the setting as a default on the emulator/device instance, you can add an entry to /data/local.prop -on the device.

    - - - -

    Listing of logcat Command Options

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OptionDescription
    -b <buffer>Loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default. See Viewing Alternative Log Buffers.
    -cClears (flushes) the entire log and exits.
    -dDumps the log to the screen and exits.
    -f <filename>Writes log message output to <filename>. The default is stdout.
    -gPrints the size of the specified log buffer and exits.
    -n <count>Sets the maximum number of rotated logs to <count>. The default value is 4. Requires the -r option.
    -r <kbytes>Rotates the log file every <kbytes> of output. The default value is 16. Requires the -f option.
    -sSets the default filter spec to silent.
    -v <format>Sets the output format for log messages. The default is brief format. For a list of supported formats, see Controlling Log Output Format.
    - - - -

    Stopping the adb Server

    - -

    In some cases, you might need to terminate the adb server process and then restart it. For example, if adb does not respond to a command, you can terminate the server and restart it and that may resolve the problem.

    - -

    To stop the adb server, use the kill-server. You can then restart the server by issuing any adb command.

    - - diff --git a/docs/html/guide/developing/tools/adt.jd b/docs/html/guide/developing/tools/adt.jd deleted file mode 100644 index f28b24c..0000000 --- a/docs/html/guide/developing/tools/adt.jd +++ /dev/null @@ -1,154 +0,0 @@ -page.title=ADT Plugin -@jd:body - -

    The Android Development Tools (ADT) plugin adds powerful extensions to the Eclipse integrated development environment. It allows you to create and debug your Android applications easier and faster. If you use Eclipse, the ADT plugin gives you an incredible boost in developing Android applications:

    - - - -

    Installing the Eclipse Plugin (ADT)

    - -

    If you will not be using the Eclipse IDE, you do not need to download or install the ADT plugin.

    - -

    To download and install the ADT plugin, follow the steps below for your respective Eclipse version.

    - - - - - - - -
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    -
      -
    1. Start Eclipse, then select Help > Software Updates > Find - and Install....
    2. - -
    3. In the dialog that appears, select Search for new features to install and click Next.
    4. -
    5. Click New Remote Site.
    6. -
    7. In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL: -
      https://dl-ssl.google.com/android/eclipse/
      -

      Click OK.

    8. -
    9. You should now see the new site added to the search list (and checked). - Click Finish.
    10. -
    11. In the subsequent Search Results dialog box, select the checkbox for - Android Plugin > Developer Tools. - This will check both features: "Android Developer Tools", and "Android - Editors". The Android Editors feature is optional, but recommended. If - you choose to install it, you need the WST plugin mentioned earlier in this - page. Click Next.
    12. -
    13. Read the license agreement and then select Accept terms of the license agreement. - Click Next.
    14. -
    15. Click Finish.
    16. - -
    17. The ADT plugin is not signed; you can accept the installation anyway - by clicking Install All.
    18. -
    19. Restart Eclipse.
    20. -
    - -
    - -
      -
    1. Start Eclipse, then select Help > Software Updates.... -
    2. -
    3. In the dialog that appears, click the Available Software tab. -
    4. -
    5. Click Add Site... -
    6. -
    7. Enter this as the Location: -
      https://dl-ssl.google.com/android/eclipse/
      -

      Click OK.

    8. -
    9. Back in the Available Software view, you should see the plugin. Select the checkbox next to - Developer Tools and click Install... -
    10. -
    11. On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked. - The Android Editors feature is optional, but recommended. If - you choose to install it, you need the WST plugin mentioned earlier in this - page. Click Next. -
    12. -
    13. Accept the license agreement and click Finish.
    14. -
    15. Restart Eclipse.
    16. -
    - -
    - -

    Troubleshooting ADT Installation

    -

    -If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

    - - -

    -If you are still unable to use Eclipse to download the ADT plugin, follow these steps to download and install the plugin from your computer: -

    -
      -
    1. Download the ADT zip file (do not unpack it). -
    2. Follow steps 1 and 2 in the default install instructions (above). -
    3. In Eclipse 3.3, click New Archive Site....
      - In Eclipse 3.4, click Add Site..., then Archive... -
    4. Browse and select the downloaded the zip file. -
    5. Follow the remaining procedures, above, starting from steps 5. -
    -

    -Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.

    - -

    Note that the "Android Editors" feature of ADT requires several optional -Eclipse components (for example, WST). If you encounter an error when -installing ADT, your Eclipse installion might not include those components. -For information about how to quickly add the necessary components to your -Eclipse installation, see the troubleshooting topic -ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".

    - -

    For Linux users

    -

    If you encounter this error when installing the ADT Plugin for Eclipse: -

    -An error occurred during provisioning.
    -Cannot connect to keystore.
    -JKS
    -

    -...then your development machine lacks a suitable Java VM. Installing Sun -Java 6 will resolve this issue and you can then reinstall the ADT -Plugin.

    - - - -

    Updating the ADT Plugin

    - -

    In some cases, a new ADT plugin may become available for your existing version of the SDK. You can use the steps below to update -the ADT plugin from inside Eclipse.

    - - - - - - - -
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    -
      -
    1. Select Help > Software Updates > Find and Install....
    2. -
    3. Select Search for updates of the currently installed features and click Finish.
    4. -
    5. If an update for ADT is available, select and install.
    6. -
    - -

    Alternatively,

    -
      -
    1. Select Help > Software Updates > Manage Configuration.
    2. -
    3. Navigate down the tree and select Android Development Tools <version>
    4. -
    5. Select Scan for Updates under Available Tasks.
    6. -
    -
    -
      -
    1. Select Help > Software Updates...
    2. -
    3. Select the Installed Software tab.
    4. -
    5. Click Update...
    6. -
    7. If an update for ADT is available, select it and click Finish.
    8. -
    -
    diff --git a/docs/html/guide/developing/tools/aidl.jd b/docs/html/guide/developing/tools/aidl.jd deleted file mode 100644 index 96e4fec..0000000 --- a/docs/html/guide/developing/tools/aidl.jd +++ /dev/null @@ -1,302 +0,0 @@ -page.title=Designing a Remote Interface Using AIDL -@jd:body - -

    Since each application runs in its own process, and you can write a service that -runs in a different process from your Application's UI, sometimes you need to pass objects -between processes. On the Android platform, one process can not normally access the memory -of another process. So to talk, they need to decompose their objects into primitives that -the operating system can understand, and "marshall" the object across that boundary for you.

    - -

    The code to do that marshalling is tedious to write, so we provide the AIDL tool to do it -for you.

    - -

    AIDL (Android Interface Definition Language) is an IDL -language used to generate code that enables two processes on an Android-powered device -to talk using interprocess communication (IPC). If you have code -in one process (for example, in an Activity) that needs to call methods on an -object in another process (for example, a Service), you would use AIDL to -generate code to marshall the parameters.

    -

    The AIDL IPC mechanism - is interface-based, similar to COM or Corba, but lighter weight. It uses a proxy - class to pass values between the client and the implementation.

    -

    This page includes the following main topics:

    - -

    Implementing IPC Using AIDL

    -

    Follow these steps to implement an IPC service using AIDL.

    -
      -
    1. Create your .aidl file - This - file defines an interface (YourInterface.aidl) that defines the - methods and fields available to a client.
    2. -
    3. Add the .aidl file to your makefile - (the ADT Plugin for Eclipse - manages this for you). Android includes the compiler, called - AIDL, in the tools/ directory.
    4. -
    5. Implement your interface methods - - The AIDL compiler creates an interface in the Java programming language from your AIDL interface. - This interface has an inner abstract class named Stub that inherits the - interface (and implements a few additional methods necessary for the IPC - call). You must create a class that extends YourInterface.Stub - and implements the methods you declared in your .aidl file.
    6. -
    7. Expose your interface to clients - - If you're writing a service, you should extend {@link - android.app.Service Service} and override {@link android.app.Service#onBind - Service.onBind(Intent)} to return an instance of your class that implements your - interface.
    8. -
    -

    Create an .aidl File

    -

    AIDL is a simple syntax that lets you declare an interface with one or more - methods, that can take parameters and return values. These parameters and return - values can be of any type, even other AIDL-generated interfaces. However, it - is important to note that you must import all non-built-in types, - even if they are defined in the same package as your interface. - Here are the data types that AIDL can support:

    - -

    Here is the basic AIDL syntax:

    -
    // My AIDL file, named SomeClass.aidl
    -// Note that standard comment syntax is respected.
    -// Comments before the import or package statements are not bubbled up
    -// to the generated interface, but comments above interface/method/field
    -// declarations are added to the generated interface.
    -
    -// Include your fully-qualified package statement.
    -package com.android.sample;
    -
    -// See the list above for which classes need
    -// import statements (hint--most of them)
    -import com.android.sample.IAtmService;
    -
    -// Declare the interface.
    -interface IBankAccountService {
    -    
    -    // Methods can take 0 or more parameters, and
    -    // return a value or void.
    -    int getAccountBalance();
    -    void setOwnerNames(in List<String> names);
    -    
    -    // Methods can even take other AIDL-defined parameters.
    -    BankAccount createAccount(in String name, int startingDeposit, in IAtmService atmService);
    -
    -    // All non-Java primitive parameters (e.g., int, bool, etc) require
    -    // a directional tag indicating which way the data will go. Available
    -    // values are in, out, inout. (Primitives are in by default, and cannot be otherwise).
    -    // Limit the direction to what is truly needed, because marshalling parameters
    -    // is expensive.
    -    int getCustomerList(in String branch, out String[] customerList);
    -}
    - -

    Implementing the Interface

    -

    AIDL generates an interface file for you with the same name as your .aidl - file. If you are using the Eclipse plugin, AIDL will automatically be run as part of - the build process (you don't need to run AIDL first and then build your project). - If you are not using the plugin, you should run AIDL first.

    -

    The generated interface - includes an abstract inner class named Stub that declares all the methods - that you declared in your .aidl file. Stub also defines a few helper methods, - most notably asInterface(), which takes an IBinder (passed to a client's onServiceConnected() - implementation when applicationContext.bindService() succeeds), and returns an - instance of the interface used to call the IPC methods. See the section - Calling an IPC Method for more details on how to make this cast.

    -

    To implement your interface, extend YourInterface.Stub, - and implement the methods. (You can create the .aidl file and implement the stub - methods without building between--the Android build process will process .aidl -files before .java files.)

    -

    Here is an example of implementing an interface called IRemoteService, which exposes - a single method, getPid(), using an anonymous instance:

    -
    // No need to import IRemoteService if it's in the same project.
    -private final IRemoteService.Stub mBinder = new IRemoteService.Stub(){
    -    public int getPid(){
    -        return Process.myPid();
    -    }
    -}
    -

    A few rules about implementing your interface:

    - - -

    Exposing Your Interface to Clients

    -

    Now that you've got your interface implementation, you need to expose it to clients. - This is known as "publishing your service." To publish a service, - inherit {@link android.app.Service Service} and implement {@link android.app.Service#onBind - Service.onBind(Intent)} to return an instance of the class that implements your interface. - Here's a code snippet of a service that exposes the IRemoteService - interface to clients.

    -
    public class RemoteService extends Service {
    -...
    -{@include development/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.java
    -    exposing_a_service}
    -}
    - - -

    Pass by value Parameters using Parcelables

    - -

    If you have a class that you would like to send from one process to another through -an AIDL interface, you can do that. You must ensure that the code for your class is available -to the other side of the IPC. Generally, that means that you're talking to a service that you -started.

    -

    There are five parts to making a class support the Parcelable protocol: -

      -
    1. Make your class implement the {@link android.os.Parcelable} interface.
    2. -
    3. Implement the method public void writeToParcel(Parcel out) that takes the -current state of the object and writes it to a parcel.
    4. -
    5. Implement the method public void readFromParcel(Parcel in) that reads the -value in a parcel into your object.
    6. -
    7. Add a static field called CREATOR to your class which is an object implementing -the {@link android.os.Parcelable.Creator Parcelable.Creator} interface.
    8. -
    9. Last but not least: -
        -
      • If you are developing with Eclipse/ADT, follow these steps: -
          -
        1. In the Package Explorer view, right-click on the project.
        2. -
        3. Choose Android Tools > Create Aidl preprocess file -for Parcelable classes.
        4. -
        5. This will create a file called "project.aidl" in the root of the project. -The file will be automatically used when compiling an aidl file that uses the -parcelable classes.
        6. -
        -
      • -
      • If you are developing with Ant or are using a custom build process, create an aidl file -that declares your parcelable class (as shown below). If you are using a custom build process, -do not add the aidl file to your build. Similar to a header file in C, the aidl file isn't -compiled.
      • -
      -
    10. - -

      AIDL will use these methods and fields in the code it generates to marshall and unmarshall -your objects.

      -

      Here is an example of how the {@link android.graphics.Rect} class implements the -Parcelable protocol.

      - -
      -import android.os.Parcel;
      -import android.os.Parcelable;
      -
      -public final class Rect implements Parcelable {
      -    public int left;
      -    public int top;
      -    public int right;
      -    public int bottom;
      -
      -    public static final Parcelable.Creator<Rect> CREATOR = new Parcelable.Creator<Rect>() {
      -        public Rect createFromParcel(Parcel in) {
      -            return new Rect(in);
      -        }
      -
      -        public Rect[] newArray(int size) {
      -            return new Rect[size];
      -        }
      -    };
      -
      -    public Rect() {
      -    }
      -
      -    private Rect(Parcel in) {
      -        readFromParcel(in);
      -    }
      -
      -    public void writeToParcel(Parcel out) {
      -        out.writeInt(left);
      -        out.writeInt(top);
      -        out.writeInt(right);
      -        out.writeInt(bottom);
      -    }
      -
      -    public void readFromParcel(Parcel in) {
      -        left = in.readInt();
      -        top = in.readInt();
      -        right = in.readInt();
      -        bottom = in.readInt();
      -    }
      -}
      -
      - -

      Here is Rect.aidl for this example

      - -
      -package android.graphics;
      -
      -// Declare Rect so AIDL can find it and knows that it implements
      -// the parcelable protocol.
      -parcelable Rect;
      -
      - -

      The marshalling in the Rect class is pretty simple. Take a look at the other -methods on {@link android.os.Parcel} to see the other kinds of values you can write -to a Parcel.

      - -

      Warning: Don't forget the security implications of receiving data from -other processes. In this case, the rect will read four numbers from the parcel, -but it is up to you to ensure that these are within the acceptable range of -values for whatever the caller is trying to do. See -Security and Permissions for more -on how to keep your application secure from malware.

      - -

      Calling an IPC Method

      -

      Here are the steps a calling class should make to call your remote interface:

      -
        -
      1. Declare a variable of the interface type that your .aidl file defined.
      2. -
      3. Implement {@link android.content.ServiceConnection ServiceConnection}.
      4. -
      5. Call {@link android.content.Context#bindService(android.content.Intent,android.content.ServiceConnection,int) - Context.bindService()}, passing in your ServiceConnection implementation.
      6. -
      7. In your implementation of {@link android.content.ServiceConnection#onServiceConnected(android.content.ComponentName,android.os.IBinder) - ServiceConnection.onServiceConnected()}, you will receive an {@link android.os.IBinder - IBinder} instance (called service). Call YourInterfaceName.Stub.asInterface((IBinder)service) to - cast the returned parameter to YourInterface type.
      8. -
      9. Call the methods that you defined on your interface. You should always trap - {@link android.os.DeadObjectException} exceptions, which are thrown when - the connection has broken; this will be the only exception thrown by remote - methods.
      10. -
      11. To disconnect, call {@link android.content.Context#unbindService(android.content.ServiceConnection) - Context.unbindService()} with the instance of your interface.
      12. -
      -

      A few comments on calling an IPC service:

      -
        -
      • Objects are reference counted across processes.
      • -
      • You can send anonymous objects - as method arguments.
      • -
      -

      Here is some sample code demonstrating calling an AIDL-created service, taken - from the Remote Activity sample in the ApiDemos project.

      -

      {@sample development/samples/ApiDemos/src/com/example/android/apis/app/RemoteServiceBinding.java - exposing_a_service}

      - - - diff --git a/docs/html/guide/developing/tools/ddms.jd b/docs/html/guide/developing/tools/ddms.jd deleted file mode 100644 index fa04216..0000000 --- a/docs/html/guide/developing/tools/ddms.jd +++ /dev/null @@ -1,250 +0,0 @@ -page.title=Using Dalvik Debug Monitor Service (DDMS) -@jd:body - -

      Android ships with a debugging tool called the Dalvik Debug Monitor Service (DDMS), - which provides port-forwarding services, screen capture on the device, thread - and heap information on the device, logcat, process, and radio state information, - incoming call and SMS spoofing, location data spoofing, and more. This page - provides a modest discussion of DDMS features; it is not an exhaustive exploration of - all the features and capabilities.

      - -

      DDMS ships in the tools/ directory of the SDK. - Enter this directory from a terminal/console and type ddms (or ./ddms - on Mac/Linux) to run it. DDMS will work with both the emulator and a connected device. If both are - connected and running simultaneously, DDMS defaults to the emulator.

      - -

      How DDMS works

      -

      DDMS acts as a middleman to connect the IDE to the applications running on -the device. On Android, every application runs in its own process, -each of which hosts its own virtual machine (VM). And each process -listens for a debugger on a different port.

      - -

      When it starts, DDMS connects to adb and -starts a device monitoring service between the two, which will notify DDMS when a device is -connected or disconnected. When a device is connected, a VM monitoring service is created -between adb and DDMS, which will notify DDMS when a VM on the device is started -or terminated. Once a VM is running, DDMS retrieves the the VM's process ID (pid), via adb, -and opens a connection to the VM's debugger, through the adb daemon (adbd) on the device. -DDMS can now talk to the VM using a custom wire protocol.

      - -

      For each VM on the device, DDMS opens a port upon which it will listen for a debugger. For the first VM, DDMS listens for a debugger on port 8600, the next on 8601, and so on. When a debugger connects to one of these ports, all traffic is forwarded between the debugger and the associated VM. Debugging can then process like any remote debugging session.

      - -

      DDMS also opens another local port, the DDMS "base port" (8700, by default), upon which it also listens for a debugger. When a debugger connects to this base port, all traffic is forwarded to the VM currently selected in DDMS, so this is typically where you debugger should connect.

      - -

      For more information on port-forwarding with DDMS, -read Configuring your IDE to attach -to port 8700 for debugging.

      - -

      Tip: -You can set a number of DDMS preferences in File > Preferences. -Preferences are saved to "$HOME/.ddmsrc".

      - -

      Known debugging issues with Dalvik
      -Debugging an application in the Dalvik VM should work the same as it does -in other VMs. However, when single-stepping out of synchronized code, the "current line" -cursor may jump to the last line in the method for one step.

      - - -

      Left Pane

      -

      The left side of the Debug Monitor shows each emulator/device currently found, with a list of - all the VMs currently running within each. - VMs are identified by the package name of the application it hosts.

      -

      Use this list to find and attach to the VM - running the activity(ies) that you want to debug. Next to each VM in the - list is a "debugger pass-through" port (in the right-most column). - If you connect your debugger to one of the the ports listed, you - will be connected to the corresponding VM on the device. However, when using - DDMS, you need only connect to port 8700, as DDMS forwards all traffic here to the - currently selected VM. (Notice, as you select a VM in the list, the listed port includes 8700.) - This way, there's no need to reconfigure the debugger's port each time you switch between VMs.

      -

      When an application running on the device calls {@link android.os.Debug#waitForDebugger()} - (or you select this option in the developer - options), a red icon will be shown next to the client name, while it waits for the - debugger to attach to the VM. When a debugger is connected, the icon will turn green.

      -

      If you see a crossed-out bug icon, this means that the DDMS was unable to complete a -connection between the debugger and the VM because it was unable to open the VM's local port. -If you see this for all VMs on the device, it is likely because you have another instance of -DDMS running (this includes the Eclipse plugin).

      -

      If you see a question mark in place of an application package, this means that, -once DDMS received the application pid from adb, it -somehow failed to make a successful handshake with the VM process. Try restarting DDMS.

      - - -

      Right pane

      -

      On the right side, the Debug Monitor provides tabs that display useful information -and some pretty cool tools.

      - -

      Info

      -

      This view shows some general information about the selected VM, including the process - ID, package name, and VM version.

      - -

      Threads

      -

      The threads view has a list of threads running in the process of the target VM. - To reduce the amount - of data sent over the wire, the thread updates are only sent when explicitly - enabled by toggling the "threads" button - in the toolbar. This toggle is maintained per VM. This tab includes the following - information:

      -
        -
      • ID - a VM-assigned unique thread ID. In Dalvik, these are - odd numbers starting from 3.
      • -
      • Tid - the Linux thread ID. For the main thread in a process, - this will match the process ID.
      • -
      • Status - the VM thread status. Daemon threads are - shown with an asterisk (*). This will be one of the following: -
          -
        • running - executing application code
        • -
        • sleeping - called Thread.sleep()
        • -
        • monitor - waiting to acquire a monitor lock
        • -
        • wait - in Object.wait()
        • -
        • native - executing native code
        • -
        • vmwait - waiting on a VM resource
        • -
        • zombie - thread is in the process of dying
        • -
        • init - thread is initializing (you shouldn't see this)
        • -
        • starting - thread is about to start (you shouldn't see - this either)
        • -
        -
      • -
      • utime - cumulative time spent executing user code, in "jiffies" (usually - 10ms). Only available under Linux.
      • -
      • stime - cumulative time spent executing system code, in "jiffies" (usually - 10ms).
      • -
      • Name - the name of the thread
      • -
      -

      "ID" and "Name" are set when the thread is started. The remaining - fields are updated periodically (default is every 4 seconds).

      - -

      VM Heap

      -

      Displays some heap stats, updated during garbage collection. If, when a VM is selected, -the VM Heap view says that heap updates are not enabled, click the "Show heap updates" button, -located in the top-left toolbar. Back in the VM Heap view, click Cause GC -to perform garbage collection and update the heap stats.

      - - -

      Allocation Tracker

      -

      In this view, you can track the memory allocation of each virtual machine. -With a VM selected in the left pane, click Start Tracking, then -Get Allocations to view all allocations since tracking started. -The table below will be filled with all the relevant -data. Click it again to refresh the list.

      - - -

      Emulator Control

      -

      With these controls, you can simulate special device states and activities. -Features include:

      -
        -
      • Telephony Status - change the state of the phone's Voice and Data plans - (home, roaming, searching, etc.), and simulate different kinds of network Speed and Latency - (GPRS, EDGE, UTMS, etc.).
      • -
      • Telephony Actions - perform simulated phone calls and SMS messages to the emulator.
      • -
      • Location Controls - send mock location data to the emulator so that you can perform - location-aware operations like GPS mapping. - -

        To use the Location Controls, launch your application in the Android emulator and open DDMS. -Click the Emulator Controls tab and scroll down to Location Controls. -From here, you can:

        -
          -
        • Manually send individual longitude/latitude coordinates to the device. -

          Click Manual, - select the coordinate format, fill in the fields and click Send. -

          -
        • -
        • Use a GPX file describing a route for playback to the device. -

          Click GPX and load the file. Once loaded, - click the play button to playback the route for your location-aware application.

          -

          When performing playback from GPX, you can adjust the speed of - playback from the DDMS panel and control playback with the pause and skip buttons. - DDMS will parse both the waypoints (<wpt>, in the first table), - and the tracks (<trk>, - in the second table, with support for multiple segments, <trkseg>, - although they are simply - concatenated). Only the tracks can be played. Clicking a waypoint in the first list simply - sends its coordinate to the device, while selecting a track lets you play it.

          -
        • -
        • Use a KML file describing individual placemarks for sequenced playback to the device. -

          Click KML and load the file. Once loaded, - click the play button to send the coordinates to your location-aware application.

          -

          When using a KML file, it is parsed for a <coordinates> - element. The value of which should be a single - set of longitude, latitude and altitude figures. For example:

          -
          <coordinates>-122.084143,37.421972,4</coordinates>
          -

          In your file, you may include multiple <Placemark> elements, each containing - a <coordinates> element. When you do so, the collection of placemarks will - be added as tracks. DDMS will send one placemark per second to the device.

          -

          One way to generate a suitable KML file is to find a location in Google Earth. - Right-click the location entry that appears on the left and select "Save place as..." - with the save format set to Kml.

          -

          Note: DDMS does not support routes created with the -<MultiGeometry><LineString>lat1, long1, lat2, long2, ....</LineString></MultiGeometry> methods. - There is also currently no support for the <TimeStamp> node inside - the <Placemark>. - Future releases may support timed placement and routes within a single coordinate element.

          -
        • -
        -

        For additional methods of setting up mocks of location-based data, see the - Location topic.

        -
      • -
      - - - - - -

      File Explorer

      -

      With the File Explorer, you can view the device file system and perform basic management, -like pushing and pulling files. This circumvents using the adb -push and pull commands, with a GUI experience.

      -

      With DDMS open, select Device > File Explorer... to open the -File Explorer window. You can drag-and-drop into the device directories, but cannot drag out of them. -To copy files from the device, select the file and click the Pull File from Device -button in the toolbar. To delete files, use the Delete button in the toolbar.

      -

      If you're interested in using an SD card image on the emulator, you're still required to use -the mksdcard command to create an image, and then mount it during emulator bootup. -For example, from the /tools directory, execute:

      -
      -$ mksdcard 1024M ./img
      -$ emulator -sdcard ./img
      -
      -

      Now, when the emulator is running, the DDMS File Explorer will be able to read and write to the -sdcard directory. However, your files may not appear automatically. For example, if you add an -MP3 file to the sdcard, the media player won't see them until you restart the emulator. (When restarting -the emulator from command line, be sure to mount the sdcard again.)

      -

      For more information on creating an SD card image, see the -Other Tools document.

      - -

      Screen Capture

      -

      You can capture screen images on the device or emulator by selecting Device - > Screen capture... in the menu bar, or press CTRL-S.

      - -

      Exploring Processes

      -

      You can see the output of ps -x for a specific VM by selecting Device - > Show process status... in the menu bar.

      - -

      Cause a GC to Occur

      -

      Cause garbage collection to occury by pressing the trash can button on the toolbar.

      - -

      Running Dumpsys and Dumpstate on the Device (logcat)

      -
        -
      • To run dumpsys (logcat) from Dalvik, select Device > - Run logcat... in the menu bar.
      • -
      • To run dumpstate from Dalvik, select Device > Dump device - state... in the menu bar.
      • -
      - -

      Examine Radio State

      -

      By default, radio state is not output during a standard logcat (it is a lot of - information). To see radio information, either click Device > Dump radio - state... or run logcat as described in Logging - Radio Information.

      - -

      Stop a Virtual Machine

      -

      You can stop a virtual machine by selecting Actions > Halt -VM. Pressing this button causes the VM to call System.exit(1).

      - -

      Known issues with DDMS

      -

      DDMS has the following known limitations:

      -
        -
      • If you connect and disconnect a debugger, ddms drops and reconnects the - client so the VM realizes that the debugger has gone away. This will be fixed - eventually.
      • -
      diff --git a/docs/html/guide/developing/tools/draw9patch.jd b/docs/html/guide/developing/tools/draw9patch.jd deleted file mode 100644 index f25fabb..0000000 --- a/docs/html/guide/developing/tools/draw9patch.jd +++ /dev/null @@ -1,58 +0,0 @@ -page.title=Draw 9-patch -@jd:body - -

      The Draw 9-patch tool allows you to easily create a - {@link android.graphics.NinePatch} graphic using a WYSIWYG editor.

      -

      For an introduction to Nine-patch graphics and how they work, please read -the section on Nine-patch in the -Ninepatch Images topic.

      - - - -

      Here's a quick guide to create a Nine-patch graphic using the Draw 9-patch tool. -You'll need the PNG image with which you'd like to create a NinePatch.

      - -
        -
      1. From a terminal, launch the draw9patch application from your SDK - /tools directory. -
      2. -
      3. Drag your PNG image into the Draw 9-patch window - (or File > Open 9-patch... to locate the file). - Your workspace will now open. -

        The left pane is your drawing area, in which you can edit the lines for the - stretchable patches and content area. The right - pane is the preview area, where you can preview your graphic when stretched.

        -
      4. -
      5. Click within the 1-pixel perimeter to draw the lines that define the stretchable - patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase - previously drawn lines. -
      6. -
      7. When done, select File > Save 9-patch... -

        Your image will be saved with the .9.png file name.

        -
      8. -
      -

      Note: A normal PNG file (*.png) will be - loaded with an empty one-pixel border added around the image, in which you can draw - the stretchable patches and content area. - A previously saved 9-patch file (*.9.png) will be loaded as-is, - with no drawing area added, because it already exists.

      - - - -

      Optional controls include:

      -
    - -

    Step 11

    - - - -

    Finally, the new Activity has to be defined in the manifest file:

    -

    Before the new Activity can be seen by Android, it needs its own - Activity entry in the AndroidManifest.xml file. This is to let - the system know that it is there and can be called. We could also specify - which IntentFilters the activity implements here, but we are going to skip - this for now and just let Android know that the Activity is - defined.

    -

    There is a Manifest editor included in the Eclipse plugin that makes it much easier - to edit the AndroidManifest file, and we will use this. If you prefer to edit the file directly - or are not using the Eclipse plugin, see the box at the end for information on how to do this - without using the new Manifest editor.

    -

      -
    1. Double click on the AndroidManifest.xml file in the package explorer to open it. -
    2. -
    3. Click the Application tab at the bottom of the Manifest editor.
    4. -
    5. Click Add... in the Application Nodes section. -

      If you see a dialog with radiobuttons at the top, select the top radio button: - "Create a new element at the top level, in Application".

    6. -
    7. Make sure "(A) Activity" is selected in the selection pane of the dialog, and click OK.
    8. -
    9. Click on the new "Activity" node, in the Application Nodes section, then - type .NoteEdit into the Name* - field to the right. Press Return/Enter.
    10. -
    -

    The Android Manifest editor helps you add more complex entries into the AndroidManifest.xml - file, have a look around at some of the other options available (but be careful not to select - them otherwise they will be added to your Manifest). This editor should help you understand - and alter the AndroidManifest.xml file as you move on to more advanced Android applications.

    - -

    If you prefer to edit this file directly, simply open the - AndroidManifest.xml file and look at the source (use the - AndroidManifest.xml tab in the eclipse editor to see the source code directly). - Then edit the file as follows:
    - <activity android:name=".NoteEdit"></activity>

    - This should be placed just below the line that reads:
    - </activity> for the .Notepadv2 activity.

    - -

    Step 12

    - -

    Now Run it!

    -

    You should now be able to add real notes from -the menu, as well as delete an existing one. Notice that in order to delete, you must -first use the directional controls on the device to highlight the note. -Furthermore, selecting a note title from the list should bring up the note -editor to let you edit it. Press confirm when finished to save the changes -back to the database. - -

    Solution and Next Steps

    - -

    You can see the solution to this exercise in Notepadv2Solution -from the zip file to compare with your own.

    -

    Now try editing a note, and then hitting the back button on the emulator -instead of the confirm button (the back button is below the menu button). You -will see an error come up. Clearly our application still has some problems. -Worse still, if you did make some changes and hit the back button, when you go -back into the notepad to look at the note you changed, you will find that all -your changes have been lost. In the next exercise we will fix these -problems.

    - -

    -Once you are ready, move on to Tutorial -Exercise 3 where you will fix the problems with the back button and lost -edits by introducing a proper life cycle into the NoteEdit Activity.

    - - diff --git a/docs/html/guide/tutorials/notepad/notepad-ex3.jd b/docs/html/guide/tutorials/notepad/notepad-ex3.jd deleted file mode 100644 index 8737280..0000000 --- a/docs/html/guide/tutorials/notepad/notepad-ex3.jd +++ /dev/null @@ -1,358 +0,0 @@ -page.title=Notepad Exercise 3 -parent.title=Notepad Tutorial -parent.link=index.html -@jd:body - - -

    In this exercise, you will use life-cycle event callbacks to store and -retrieve application state data. This exercise demonstrates:

    - - -
    - [Exercise 1] - [Exercise 2] - - [Exercise 3] - - [Extra Credit] -
    - -

    Step 1

    - -

    Import Notepadv3 into Eclipse. If you see an error about -AndroidManifest.xml, or some problems related to an Android zip -file, right click on the project and select Android Tools > -Fix Project Properties from the popup menu. The starting point for this exercise is -exactly where we left off at the end of the Notepadv2.

    -

    The current application has some problems — hitting the back button when editing -causes a crash, and anything else that happens during editing will cause the -edits to be lost.

    -

    To fix this, we will move most of the functionality for creating and editing -the note into the NoteEdit class, and introduce a full life cycle for editing -notes.

    - -
      -
    1. Remove the code in NoteEdit that parses the title and body - from the extras Bundle. -

      Instead, we are going to use the DBHelper class - to access the notes from the database directly. All we need passed into the - NoteEdit Activity is a mRowId (but only if we are editing, if creating we pass - nothing). Remove these lines:

      -
      -String title = extras.getString(NotesDbAdapter.KEY_TITLE);
      -String body = extras.getString(NotesDbAdapter.KEY_BODY);
      -
    2. -
    3. We will also get rid of the properties that were being passed in - the extras Bundle, which we were using to set the title - and body text edit values in the UI. So delete: -
      -if (title != null) {
      -    mTitleText.setText(title);
      -}
      -if (body != null) {
      -    mBodyText.setText(body);
      -}
      -
    4. -
    - -

    Step 2

    - -

    Create a class field for a NotesDbAdapter at the top of the NoteEdit class:

    -
        private NotesDbAdapter mDbHelper;
    -

    Also add an instance of NotesDbAdapter in the - onCreate() method (right below the super.onCreate() call):

    -
    -    mDbHelper = new NotesDbAdapter(this);
    -    mDbHelper.open();
    - -

    Step 3

    - -

    In NoteEdit, we need to check the savedInstanceState for the -mRowId, in case the note - editing contains a saved state in the Bundle, which we should recover (this would happen - if our Activity lost focus and then restarted).

    -
      -
    1. - Replace the code that currently initializes the mRowId:
      -
      -        mRowId = null;
      -
      -        Bundle extras = getIntent().getExtras();
      -        if (extras != null) {
      -            mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);
      -        }
      -        
      - with this: -
      -        mRowId = savedInstanceState != null ? savedInstanceState.getLong(NotesDbAdapter.KEY_ROWID) 
      -                                            : null;
      -        if (mRowId == null) {
      -            Bundle extras = getIntent().getExtras();            
      -            mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID) 
      -                                    : null;
      -        }
      -        
      -
    2. -
    3. - Note the null check for savedInstanceState, and we still need to load up - mRowId from the extras Bundle if it is not - provided by the savedInstanceState. This is a ternary operator shorthand - to safely either use the value or null if it is not present. -
    4. -
    - -

    Step 4

    - -

    Next, we need to populate the fields based on the mRowId if we - have it:

    -
    populateFields();
    -

    This goes before the confirmButton.setOnClickListener() line. - We'll define this method in a moment.

    - -

    Step 5

    - -

    Get rid of the Bundle creation and Bundle value settings from the - onClick() handler method. The Activity no longer needs to - return any extra information to the caller. And because we no longer have - an Intent to return, we'll use the shorter version - of setResult():

    -
    -public void onClick(View view) {
    -    setResult(RESULT_OK);
    -    finish();
    -}
    -

    We will take care of storing the updates or new notes in the database - ourselves, using the life-cycle methods.

    - -

    The whole onCreate() method should now look like this:

    -
    -super.onCreate(savedInstanceState);
    - 
    -mDbHelper = new NotesDbAdapter(this);
    -mDbHelper.open();
    - 
    -setContentView(R.layout.note_edit);
    - 
    -mTitleText = (EditText) findViewById(R.id.title);
    -mBodyText = (EditText) findViewById(R.id.body);
    - 
    -Button confirmButton = (Button) findViewById(R.id.confirm);
    - 
    -mRowId = savedInstanceState != null ? savedInstanceState.getLong(NotesDbAdapter.KEY_ROWID) 
    -                                    : null;
    -if (mRowId == null) {
    -    Bundle extras = getIntent().getExtras();
    -    mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID) 
    -                            : null;
    -}
    - 
    -populateFields();
    - 
    -confirmButton.setOnClickListener(new View.OnClickListener() {
    -
    -    public void onClick(View view) {
    -        setResult(RESULT_OK);
    -        finish();
    -    }
    -     
    -});
    - -

    Step 6

    - -

    Define the populateFields() method.

    -
    -private void populateFields() {
    -    if (mRowId != null) {
    -        Cursor note = mDbHelper.fetchNote(mRowId);
    -        startManagingCursor(note);
    -        mTitleText.setText(note.getString(
    -	            note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));
    -        mBodyText.setText(note.getString(
    -                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));
    -    }
    -}
    -

    This method uses the NotesDbAdapter.fetchNote() method to find the right note to -edit, then it calls startManagingCursor() from the Activity class, which -is an Android convenience method provided to take care of the Cursor life-cycle. This will release -and re-create resources as dictated by the Activity life-cycle, so we don't need to worry about -doing that ourselves. After that, we just look up the title and body values from the Cursor -and populate the View elements with them.

    - - -

    Step 7

    - - - -

    Still in the NoteEdit class, we now override the methods - onSaveInstanceState(), onPause() and - onResume(). These are our life-cycle methods - (along with onCreate() which we already have).

    - -

    onSaveInstanceState() is called by Android if the - Activity is being stopped and may be killed before it is - resumed! This means it should store any state necessary to - re-initialize to the same condition when the Activity is restarted. It is - the counterpart to the onCreate() method, and in fact the - savedInstanceState Bundle passed in to onCreate() is the same - Bundle that you construct as outState in the - onSaveInstanceState() method.

    - -

    onPause() and onResume() are also - complimentary methods. onPause() is always called when the - Activity ends, even if we instigated that (with a finish() call for example). - We will use this to save the current note back to the database. Good - practice is to release any resources that can be released during an - onPause() as well, to take up less resources when in the - passive state. onResume() will call our populateFields() method - to read the note out of the database again and populate the fields.

    - -

    So, add some space after the populateFields() method - and add the following life-cycle methods:

    -
      -
    1. - onSaveInstanceState(): -
      -    @Override
      -    protected void onSaveInstanceState(Bundle outState) {
      -        super.onSaveInstanceState(outState);
      -        outState.putLong(NotesDbAdapter.KEY_ROWID, mRowId);
      -    }
      -
    2. -
    3. - onPause(): -
      -    @Override
      -    protected void onPause() {
      -        super.onPause();
      -        saveState();
      -    }
      -

      We'll define saveState() next.

      -
    4. -
    5. - onResume(): -
      -    @Override
      -    protected void onResume() {
      -        super.onResume();
      -        populateFields();
      -    }
      -
    6. -
    - - -

    Step 8

    - -

    Define the saveState() method to put the data out to the -database.

    -
    -     private void saveState() {
    -        String title = mTitleText.getText().toString();
    -        String body = mBodyText.getText().toString();
    -
    -        if (mRowId == null) {
    -            long id = mDbHelper.createNote(title, body);
    -            if (id > 0) {
    -                mRowId = id;
    -            }
    -        } else {
    -            mDbHelper.updateNote(mRowId, title, body);
    -        }
    -    }
    -

    Note that we capture the return value from createNote() and if a valid row ID is - returned, we store it in the mRowId field so that we can update the note in future - rather than create a new one (which otherwise might happen if the life-cycle events are - triggered).

    - - -

    Step 9

    - -

    Now pull out the previous handling code from the - onActivityResult() method in the Notepadv3 - class.

    -

    All of the note retrieval and updating now happens within the - NoteEdit life cycle, so all the onActivityResult() - method needs to do is update its view of the data, no other work is - necessary. The resulting method should look like this:

    -
    -@Override
    -protected void onActivityResult(int requestCode, int resultCode, 
    -                                Intent intent) {
    -    super.onActivityResult(requestCode, resultCode, intent);
    -    fillData();
    -}
    - -

    Because the other class now does the work, all this has to do is refresh - the data.

    - -

    Step 10

    - -

    Also remove the lines which set the title and body from the - onListItemClick() method (again they are no longer needed, - only the mRowId is):

    -
    -    Cursor c = mNotesCursor;
    -    c.moveToPosition(position);
    -
    -and also remove: -
    -
    -    i.putExtra(NotesDbAdapter.KEY_TITLE, c.getString(
    -                    c.getColumnIndex(NotesDbAdapter.KEY_TITLE)));
    -    i.putExtra(NotesDbAdapter.KEY_BODY, c.getString(
    -                    c.getColumnIndex(NotesDbAdapter.KEY_BODY)));
    -
    -so that all that should be left in that method is: -
    -
    -    super.onListItemClick(l, v, position, id);
    -    Intent i = new Intent(this, NoteEdit.class);
    -    i.putExtra(NotesDbAdapter.KEY_ROWID, id);
    -    startActivityForResult(i, ACTIVITY_EDIT);
    - -

    You can also now remove the mNotesCursor field from the class, and set it back to using - a local variable in the fillData() method: -

    -    Cursor notesCursor = mDbHelper.fetchAllNotes();

    -

    Note that the m in mNotesCursor denotes a member field, so when we - make notesCursor a local variable, we drop the m. Remember to rename the - other occurrences of mNotesCursor in your fillData() method. - -

    -Run it! (use Run As -> Android Application on the project right -click menu again)

    - -

    Solution and Next Steps

    - -

    You can see the solution to this exercise in Notepadv3Solution -from -the zip file to compare with your own.

    -

    -When you are ready, move on to the Tutorial -Extra Credit exercise, where you can use the Eclipse debugger to -examine the life-cycle events as they happen.

    diff --git a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd b/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd deleted file mode 100644 index 0d59b56..0000000 --- a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd +++ /dev/null @@ -1,70 +0,0 @@ -page.title=Notepad Extra Credit -parent.title=Notepad Tutorial -parent.link=index.html -@jd:body - - -

    In this exercise, you will use the debugger to look at the work you did -in Exercise 3. This exercise demonstrates:

    - - -
    - - [Exercise 1] - [Exercise 2] - [Exercise 3] - - [Extra Credit] - -
    - -

    Step 1

    - -

    Using the working Notepadv3, put breakpoints in the code at the - beginning of the onCreate(), onPause(), - onSaveInstanceState() and onResume() methods in the - NoteEdit class (if you are not familiar with Eclipse, just - right click in the narrow grey border on the left of the edit window at the - line you want a breakpoint, and select Toggle Breakpoint, you -should see a blue dot appear).

    - -

    Step 2

    - -

    Now start the notepad demo in debug mode:

    - -
      -
    1. - Right click on the Notepadv3 project and from the Debug menu - select Debug As -> Android Application.
    2. -
    3. - The Android emulator should say "waiting for debugger to connect" - briefly and then run the application.
    4. -
    5. - If it gets stuck on the waiting... screen, quit the emulator and Eclipse, - from the command line do an adb kill-server, and then restart -Eclipse and try again.
    - -

    Step 3

    - -

    When you edit or create a new note you should see the breakpoints getting - hit and the execution stopping.

    - -

    Step 4

    - -

    Hit the Resume button to let execution continue (yellow rectangle with a -green triangle to its right in the Eclipse toolbars near the top).

    - -

    Step 5

    - -

    Experiment a bit with the confirm and back buttons, and try pressing Home and - making other mode changes. Watch what life-cycle events are generated and -when.

    - -

    The Android Eclipse plugin not only offers excellent debugging support for -your application development, but also superb profiling support. You can also -try using Traceview to profile your application. If your application is running too slow, this can help you -find the bottlenecks and fix them.

    - diff --git a/docs/html/guide/tutorials/notepad/notepad-index.jd b/docs/html/guide/tutorials/notepad/notepad-index.jd deleted file mode 100644 index 151c50d..0000000 --- a/docs/html/guide/tutorials/notepad/notepad-index.jd +++ /dev/null @@ -1,143 +0,0 @@ -page.title=Notepad Tutorial -@jd:body - - -

    The tutorial in this section gives you a "hands-on" introduction -to the Android framework and the tools you use to build applications on it. -Starting from a preconfigured project file, it guides you through the process of -developing a simple notepad application and provides concrete examples of how to -set up the project, develop the application logic and user interface, and then -compile and run the application.

    - -

    The tutorial presents the notepad application development as a set of -exercises (see below), each consisting of several steps. You can follow along -with the steps in each exercise and gradually build up and refine your -application. The exercises explain each step in detail and provide all the -sample code you need to complete the application.

    - -

    When you are finished with the tutorial, you will have created a functioning -Android application and learned in depth about many of the most important -concepts in Android development. If you want to add more complex features to -your application, you can examine the code in an alternative implementation -of a notepad application, in the -Sample Code documentation.

    - - - -

    Who Should Use this Tutorial

    - -

    This tutorial is designed for experienced developers, especially those with -knowledge of the Java programming language. If you haven't written Java -applications before, you can still use the tutorial, but you might need to work -at a slower pace.

    - -

    The tutorial assumes that you have some familiarity with the basic Android -application concepts and terminology. If you aren't yet familiar with those, you -should read Overview of an Android -Application before continuing.

    - -

    Also note that this tutorial uses -the Eclipse development environment, with the Android plugin installed. If you -are not using Eclipse, you can follow the exercises and build the application, -but you will need to determine how to accomplish the Eclipse-specific -steps in your environment.

    - - -

    Preparing for the Exercises

    - -

    This tutorial builds on the information provided in the Installing the SDK and Hello Android -documents, which explain in detail how to set up your development environment -for building Android applications. Before you start this tutorial, you should -read both these documents, have the SDK installed, and your work environment set up.

    - -

    To prepare for this lesson:

    - -
      -
    1. Download the project - exercises archive (.zip)
    2. -
    3. Unpack the archive file to a suitable location on your machine
    4. -
    5. Open the NotepadCodeLab folder
    6. -
    - -

    Inside the NotepadCodeLab folder, you should see six project -files: Notepadv1, - Notepadv2, Notepadv3, - Notepadv1Solution, Notepadv2Solution - and Notepadv3Solution. The Notepadv# projects are -the starting points for each of the exercises, while the -Notepadv#Solution projects are the exercise - solutions. If you are having trouble with a particular exercise, you - can compare your current work against the exercise solution.

    - - -

    Exercises

    - -

    The table below lists the tutorial exercises and describes the development -areas that each covers. Each exercise assumes that you have completed any -previous exercises.

    - - - - - - - - - - - - - - - - - - -
    Exercise -1Start here. Construct a simple notes list that lets the user add new notes but not -edit them. Demonstrates the basics of ListActivity and creating -and handling - menu options. Uses a SQLite database to store the notes.
    Exercise 2Add a second Activity to the -application. Demonstrates constructing a -new Activity, adding it to the Android manifest, passing data between the -activities, and using more advanced screen layout. Also shows how to -invoke another Activity to return a result, using -startActivityForResult().
    Exercise 3Add handling of life-cycle events to -the application, to let it -maintain application state across the life cycle.
    Extra -CreditDemonstrates how to use the Eclipse -debugger and how you can use it to -view life-cycle events as they are generated. This section is optional but -highly recommended.
    - - - -

    Other Resources and Further Learning

    - diff --git a/docs/html/guide/tutorials/views/hello-autocomplete.jd b/docs/html/guide/tutorials/views/hello-autocomplete.jd deleted file mode 100644 index de3ba29..0000000 --- a/docs/html/guide/tutorials/views/hello-autocomplete.jd +++ /dev/null @@ -1,116 +0,0 @@ -page.title=Hello, AutoCompleteTextView -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    {@link android.widget.AutoCompleteTextView} is an implementation of the EditText widget that will provide -auto-complete suggestions as the user types. The suggestions are extracted from a collection of strings.

    - - -
      -
    1. Start a new project/Activity called HelloAutoComplete.
    2. -
    3. Open the layout file. - Make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      -    android:orientation="horizontal"
      -    android:layout_width="fill_parent" 
      -    android:layout_height="wrap_content">
      -
      -    <TextView
      -        android:layout_width="wrap_content"
      -        android:layout_height="wrap_content"
      -        android:text="Country" />
      -
      -    <AutoCompleteTextView android:id="@+id/edit"
      -        android:layout_width="fill_parent"
      -        android:layout_height="wrap_content"/>
      -
      -</LinearLayout>
      -
      -
    4. - -
    5. Open HelloAutoComplete.java and insert the following as the onCreate method: -
      -@Override
      -protected void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -
      -    AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
      -    ArrayAdapter adapter = new ArrayAdapter(this,
      -            android.R.layout.simple_dropdown_item_1line, R.array.planets);
      -    textView.setAdapter(adapter);
      -}
      -
      -

      Here, we create an AutoComplteteTextView from our layout. We then - create an {@link android.widget.ArrayAdapter} that binds a simple_dropdown_item_1line - layout item to each entry in the COUNTRIES array (which we'll add next). - The last part sets the ArrayAdapter to associate with our AutoCompleteTextView.

      -
    6. - -
    7. After the onCreate() method, add the String array: -
      -static final String[] COUNTRIES = new String[] {
      -  "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
      -  "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
      -  "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
      -  "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
      -  "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
      -  "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
      -  "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
      -  "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
      -  "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
      -  "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
      -  "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
      -  "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
      -  "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
      -  "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
      -  "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
      -  "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
      -  "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
      -  "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
      -  "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
      -  "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
      -  "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
      -  "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
      -  "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
      -  "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
      -  "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
      -  "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
      -  "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
      -  "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
      -  "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
      -  "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
      -  "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
      -  "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
      -  "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
      -  "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
      -  "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
      -  "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
      -  "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
      -  "Ukraine", "United Arab Emirates", "United Kingdom",
      -  "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
      -  "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
      -  "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
      -};
      -
      -

      This is the list of suggestions that will be offered as the user types into the - AutoCompleteTextView.

      -
    8. - -
    9. Now run it.
    10. -
    -

    As you type, you should see something like this:

    - - - -

    References

    - - - diff --git a/docs/html/guide/tutorials/views/hello-datepicker.jd b/docs/html/guide/tutorials/views/hello-datepicker.jd deleted file mode 100644 index fcd43f3..0000000 --- a/docs/html/guide/tutorials/views/hello-datepicker.jd +++ /dev/null @@ -1,151 +0,0 @@ -page.title=Hello, DatePicker -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.DatePicker} is a widget that allows the user to select a month, day and year.

    - - -
      -
    1. Start a new project/Activity called HelloDatePicker.
    2. -
    3. Open the layout file and make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:layout_width="wrap_content"
      -    android:layout_height="wrap_content"
      -    android:orientation="vertical">
      -
      -    <TextView android:id="@+id/dateDisplay"
      -            android:layout_width="wrap_content"
      -            android:layout_height="wrap_content"
      -            android:text=""/>
      -
      -    <Button android:id="@+id/pickDate"
      -            android:layout_width="wrap_content"
      -            android:layout_height="wrap_content"
      -            android:text="Change the date"/>
      -
      -</LinearLayout>
      -
      -

      For the layout, we're using a vertical LinearLayout, with a {@link android.widget.TextView} that - will display the date and a {@link android.widget.Button} that will initiate the DatePicker dialog. - With this layout, the TextView will sit above the Button. - The text value in the TextView is set empty, as it will be filled - with the current date when our Activity runs.

      -
    4. - -
    5. Open HelloDatePicker.java. Insert the following to the HelloDatePicker class: -
      -    private TextView mDateDisplay;
      -    private Button mPickDate;
      -
      -    private int mYear;
      -    private int mMonth;
      -    private int mDay;
      -
      -    static final int DATE_DIALOG_ID = 0;
      -
      -    @Override
      -    protected void onCreate(Bundle savedInstanceState) {
      -        super.onCreate(savedInstanceState);
      -        setContentView(R.layout.main);
      -
      -        // capture our View elements
      -        mDateDisplay = (TextView) findViewById(R.id.dateDisplay);
      -        mPickDate = (Button) findViewById(R.id.pickDate);
      -
      -        // add a click listener to the button
      -        mPickDate.setOnClickListener(new View.OnClickListener() {
      -            public void onClick(View v) {
      -                showDialog(DATE_DIALOG_ID);
      -            }
      -        });
      -
      -        // get the current date
      -        final Calendar c = Calendar.getInstance();
      -        mYear = c.get(Calendar.YEAR);
      -        mMonth = c.get(Calendar.MONTH);
      -        mDay = c.get(Calendar.DAY_OF_MONTH);
      -
      -        // display the current date
      -        updateDisplay();
      -    }
      -
      -

      Tip: Press Ctrl(or Cmd) + Shift + O to import all needed packages.

      -

      We start by instantiating variables for our Views and date fields. - The DATE_DIALOG_ID is a static integer that uniquely identifies the Dialog. In the - onCreate() method, we get prepared by setting the layout and capturing the View elements. - Then we create an on-click listener for the Button, so that when it is clicked it will - show our DatePicker dialog. The showDialog() method will pop-up the date picker dialog - by calling the onCreateDialog() callback method - (which we'll define in the next section). We then create an - instance of {@link java.util.Calendar} and get the current year, month and day. Finally, we call - updateDisplay()—our own method (defined later) that will fill the TextView.

      -
    6. - -
    7. After the onCreate() method, add the onCreateDialog() callback method -(which is called by showDialog()) -
      -@Override
      -protected Dialog onCreateDialog(int id) {
      -    switch (id) {
      -    case DATE_DIALOG_ID:
      -        return new DatePickerDialog(this,
      -                    mDateSetListener,
      -                    mYear, mMonth, mDay);
      -    }
      -    return null;
      -}
      -
      -

      This method is passed the identifier we gave showDialog() and initializes - the DatePicker to the date we retrieved from our Calendar instance.

      -
    8. - -
    9. Following that, add the updateDisplay() method: -
      -    // updates the date we display in the TextView
      -    private void updateDisplay() {
      -        mDateDisplay.setText(
      -            new StringBuilder()
      -                    // Month is 0 based so add 1
      -                    .append(mMonth + 1).append("-")
      -                    .append(mDay).append("-")
      -                    .append(mYear).append(" "));
      -    }
      -
      -

      This uses the member date values to write the date to our TextView.

      -
    10. -
    11. Finally, add a listener that will be called when the user sets a new date: -
      -    // the callback received when the user "sets" the date in the dialog
      -    private DatePickerDialog.OnDateSetListener mDateSetListener =
      -            new DatePickerDialog.OnDateSetListener() {
      -
      -                public void onDateSet(DatePicker view, int year, 
      -                                      int monthOfYear, int dayOfMonth) {
      -                    mYear = year;
      -                    mMonth = monthOfYear;
      -                    mDay = dayOfMonth;
      -                    updateDisplay();
      -                }
      -            };
      -
      -

      This OnDateSetListener method listens for when the user is done setting the date - (clicks the "Set" button). At that time, this fires and we update our member fields with - the new date defined by the user and update our TextView by calling updateDisplay().

      -
    12. - -
    13. Now run it.
    14. -
    -

    When you press the "Change the date" button, you should see the following:

    - - -

    References

    - - diff --git a/docs/html/guide/tutorials/views/hello-formstuff.jd b/docs/html/guide/tutorials/views/hello-formstuff.jd deleted file mode 100644 index f858ce3..0000000 --- a/docs/html/guide/tutorials/views/hello-formstuff.jd +++ /dev/null @@ -1,262 +0,0 @@ -page.title=Hello, Form Stuff -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    This page introduces a variety of widgets, like image buttons, -text fields, checkboxes and radio buttons.

    - - -
      -
    1. Start a new project/Activity called HelloFormStuff.
    2. -
    3. Your layout file should have a basic LinearLayout: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:orientation="vertical"
      -    android:layout_width="fill_parent"
      -    android:layout_height="fill_parent" >
      -    	
      -</LinearLayout>
      -
      -

      For each widget you want to add, just put the respective View inside here.

      -
    4. -
    -

    Tip: As you add new Android code, press Ctrl(or Cmd) + Shift + O -to import all needed packages.

    - - -

    ImageButton

    -

    A button with a custom image on it. -We'll make it display a message when pressed.

    -
      -
    1. - Drag the Android image on the right (or your own image) into the - res/drawables/ directory of your project. - We'll use this for the button.
    2. -
    3. Open the layout file and, inside the LinearLayout, add the {@link android.widget.ImageButton} element: -
      -<ImageButton
      -    android:id="@+id/android_button"
      -    android:layout_width="100dip"
      -    android:layout_height="wrap_content"
      -    android:src="@drawable/android" />	
      -
      -

      The source of the button - is from the res/drawables/ directory, where we've placed the android.png.

      -

      Tip: You can also reference some of the many built-in - images from the Android {@link android.R.drawable} resources, - like ic_media_play, for a "play" button image. To do so, change the source - attribute to android:src="@android:drawable/ic_media_play".

      -
    4. -
    5. To make the button to actually do something, add the following -code at the end of the onCreate() method: -
      -ImageButton button = (ImageButton) findViewById(R.id.android_button);
      -button.setOnClickListener(new OnClickListener() {
      -    public void onClick(View v) {
      -        // Perform action on clicks
      -        Toast.makeText(HelloFormStuff.this, "Beep Bop", Toast.LENGTH_SHORT).show();
      -    }
      -});
      -
      -

      This captures our ImageButton from the layout, then adds an on-click listener to it. -The {@link android.view.View.OnClickListener} must define the onClick() method, which -defines the action to be made when the button is clicked. Here, we show a -{@link android.widget.Toast} message when clicked.

      -
    6. -
    7. Run it.
    8. -
    - - -

    EditText

    -

    A text field for user input. We'll make it display the text entered so far when the "Enter" key is pressed.

    - -
      -
    1. Open the layout file and, inside the LinearLayout, add the {@link android.widget.EditText} element: -
      -<EditText
      -    android:id="@+id/edittext"
      -    android:layout_width="fill_parent"
      -    android:layout_height="wrap_content"/>
      -
      -
    2. -
    3. To do something with the text that the user enters, add the following code -to the end of the onCreate() method: -
      -EditText edittext = (EditText) findViewById(R.id.edittext);
      -edittext.setOnKeyListener(new OnKeyListener() {
      -    public boolean onKey(View v, int keyCode, KeyEvent event) {
      -        if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
      -          // Perform action on key press
      -          Toast.makeText(HelloImageButton.this, edittext.getText(), Toast.LENGTH_SHORT).show();
      -          return true;
      -        }
      -        return false;
      -    }
      -});
      -
      -

      This captures our EditText element from the layout, then adds an on-key listener to it. -The {@link android.view.View.OnKeyListener} must define the onKey() method, which -defines the action to be made when a key is pressed. In this case, we want to listen for the -Enter key (when pressed down), then pop up a {@link android.widget.Toast} message with the -text from the EditText field. Be sure to return true after the event is handled, -so that the event doesn't bubble-up and get handled by the View (which would result in a -carriage return in the text field).

      -
    4. Run it.
    5. -
    - - -

    CheckBox

    -

    A checkbox for selecting items. We'll make it display the the current state when pressed.

    - -
      -
    1. Open the layout file and, inside the LinearLayout, add the {@link android.widget.CheckBox} element: -
      -<CheckBox android:id="@+id/checkbox"
      -    android:layout_width="wrap_content"
      -    android:layout_height="wrap_content"
      -    android:text="check it out" />
      -
      -
    2. -
    3. To do something when the state is changed, add the following code -to the end of the onCreate() method: -
      -final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox);
      -checkbox.setOnClickListener(new OnClickListener() {
      -    public void onClick(View v) {
      -        // Perform action on clicks
      -        if (checkbox.isChecked()) {
      -            Toast.makeText(HelloImageButton.this, "Selected", Toast.LENGTH_SHORT).show();
      -        } else {
      -            Toast.makeText(HelloImageButton.this, "Not selected", Toast.LENGTH_SHORT).show();
      -        }
      -    }
      -});
      -
      -

      This captures our CheckBox element from the layout, then adds an on-click listener to it. -The {@link android.view.View.OnClickListener} must define the onClick() method, which -defines the action to be made when the checkbox is clicked. Here, we query the current state of the -checkbox, then pop up a {@link android.widget.Toast} message that displays the current state. -Notice that the CheckBox handles its own state change between checked and un-checked, so we just -ask which it currently is.

      -
    4. Run it.
    5. -
    -

    Tip: If you find that you need to change the state -in another way (such as when loading a saved {@link android.preference.CheckBoxPreference}), -use setChecked(true) or toggle().

    - - -

    RadioButton

    -

    Two mutually-exclusive radio buttons—enabling one disables the other. -When each is pressed, we'll pop up a message.

    - -
      -
    1. Open the layout file and, inside the LinearLayout, add two {@link android.widget.RadioButton}s, -inside a {@link android.widget.RadioGroup}: -
      -<RadioGroup
      -  android:layout_width="fill_parent"
      -  android:layout_height="wrap_content"
      -  android:orientation="vertical">
      -  
      -  <RadioButton android:id="@+id/radio_red"
      -      android:layout_width="wrap_content"
      -      android:layout_height="wrap_content"
      -      android:text="Red" />
      -  
      -  <RadioButton android:id="@+id/radio_blue"
      -      android:layout_width="wrap_content"
      -      android:layout_height="wrap_content"
      -      android:text="Blue" />
      -  
      -</RadioGroup>
      -
      -
    2. -
    3. To do something when each is selected, we'll need an OnClickListener. Unlike the other -listeners we've created, instead of creating this one as an anonymous inner class, -we'll create it as a new object. This way, we can re-use the OnClickLIstener for -both RadioButtons. So, add the following code in the HelloFormStuff Activity -(outside the onCreate() method): -
      -OnClickListener radio_listener = new OnClickListener() {
      -    public void onClick(View v) {
      -        // Perform action on clicks
      -        RadioButton rb = (RadioButton) v;
      -        Toast.makeText(HelloImageButton.this, rb.getText(), Toast.LENGTH_SHORT).show();
      -    }
      -};
      -
      -

      Our onClick() method will be handed the View clicked, so the first thing to do -is cast it into a RadioButton. Then we pop up a -{@link android.widget.Toast} message that displays the selection.

      -
    4. Now, at the bottom of the onCreate() method, add the following: -
      -  final RadioButton radio_red = (RadioButton) findViewById(R.id.radio_red);
      -  final RadioButton radio_blue = (RadioButton) findViewById(R.id.radio_blue);
      -  radio_red.setOnClickListener(radio_listener);
      -  radio_blue.setOnClickListener(radio_listener);
      -
      -

      This captures each of the RadioButtons from our layout and adds the newly-created -OnClickListener to each.

      -
    5. Run it.
    6. -
    -

    Tip: If you find that you need to change the state of a -RadioButton in another way (such as when loading a saved {@link android.preference.CheckBoxPreference}), -use setChecked(true) or toggle().

    - - -

    ToggleButton

    -

    A button used specifically for toggling something on and off.

    - -
      -
    1. Open the layout file and, inside the LinearLayout, add the {@link android.widget.ToggleButton} element: -
      -<ToggleButton android:id="@+id/togglebutton"
      -    android:layout_width="wrap_content"
      -    android:layout_height="wrap_content" />
      -
      -
    2. -
    3. To do something when the state is changed, add the following code -to the end of the onCreate() method: -
      -final ToggleButton togglebutton = (ToggleButton) findViewById(R.id.togglebutton);
      -togglebutton.setOnClickListener(new OnClickListener() {
      -    public void onClick(View v) {
      -        // Perform action on clicks
      -        if (togglebutton.isChecked()) {
      -            Toast.makeText(HelloImageButton.this, "ON", Toast.LENGTH_SHORT).show();
      -        } else {
      -            Toast.makeText(HelloImageButton.this, "OFF", Toast.LENGTH_SHORT).show();
      -        }
      -    }
      -});
      -
      -

      This captures our ToggleButton element from the layout, then adds an on-click listener to it. -The {@link android.view.View.OnClickListener} must define the onClick() method, which -defines the action to be made when the button is clicked. Here, we query the current state of the -ToggleButton, then pop up a {@link android.widget.Toast} message that displays the current state. -Notice that the ToggleButton handles its own state change between checked and un-checked, so we just -ask which it is.

      -
    4. Run it.
    5. -
    - -

    Tip: By default, the text on the button is "ON" and "OFF", but -you can change each of these with setTextOn(CharSequence) and -setTextOff(CharSequence). And, if you find that you need to change the state -in another way (such as when loading a saved {@link android.preference.CheckBoxPreference}), -use setChecked(true) or toggle().

    - - -

    If you've added all the form items above, your application should look something like this:

    - - -

    References

    - - diff --git a/docs/html/guide/tutorials/views/hello-gallery.jd b/docs/html/guide/tutorials/views/hello-gallery.jd deleted file mode 100644 index 084f912..0000000 --- a/docs/html/guide/tutorials/views/hello-gallery.jd +++ /dev/null @@ -1,135 +0,0 @@ -page.title=Hello, Gallery -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.Gallery} is a View commonly used to display items in a horizontally scrolling list -that locks the current selection at the center. When one is selected, we'll show a message.

    - - -
      -
    1. Start a new project/Activity called HelloGallery.
    2. -
    3. Add some images to your res/drawable/ directory.
    4. -
    5. Open the layout file and make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<Gallery xmlns:android="http://schemas.android.com/apk/res/android" 
      -    android:id="@+id/gallery"
      -    android:layout_width="fill_parent"
      -    android:layout_height="wrap_content"
      -/>
      -
      -
    6. - - -
    7. Open the HelloGallery.java file. Insert the following for the onCreate() method: -
      -@Override
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -
      -    Gallery g = (Gallery) findViewById(R.id.gallery);
      -    g.setAdapter(new ImageAdapter(this));
      -
      -    g.setOnItemClickListener(new OnItemClickListener() {
      -        public void onItemClick(AdapterView parent, View v, int position, long id) {
      -            Toast.makeText(HelloGallery.this, "" + position, Toast.LENGTH_SHORT).show();
      -        }
      -    });
      -}
      -
      -

      We start as usual: set the layout and capture the View we want (our Gallery). -We then set an Adapter, called ImageAdapter for the Gallery—this is a new class that -we'll create next. Then we create an item click listener for the Gallery. This is like a normal -on-click listener (which you might be familiar with for buttons), but it listens to each item -that we've added to the Gallery. The onItemClick() callback method -receives the AdapterView where the click occurred, the specific View that received the click, the -position of the View clicked (zero-based), and the row id of the item clicked (if applicable). All -that we care about is the position, so that we can pop up a {@link android.widget.Toast} message that -tells us the index position of the item clicked. We do this with Toast.makeText().show(). -

      -
    8. - -
    9. After the onCreate() method, add the ImageAdapter class: -
      -public class ImageAdapter extends BaseAdapter {
      -    int mGalleryItemBackground;
      -    private Context mContext;
      -
      -    private Integer[] mImageIds = {
      -            R.drawable.sample_1,
      -            R.drawable.sample_2,
      -            R.drawable.sample_3,
      -            R.drawable.sample_4,
      -            R.drawable.sample_5,
      -            R.drawable.sample_6,
      -            R.drawable.sample_7
      -    };
      -
      -    public ImageAdapter(Context c) {
      -        mContext = c;
      -        TypedArray a = obtainStyledAttributes(android.R.styleable.Theme);
      -        mGalleryItemBackground = a.getResourceId(
      -                android.R.styleable.Theme_galleryItemBackground, 0);
      -        a.recycle();
      -    }
      -
      -    public int getCount() {
      -        return mImageIds.length;
      -    }
      -
      -    public Object getItem(int position) {
      -        return position;
      -    }
      -
      -    public long getItemId(int position) {
      -        return position;
      -    }
      -
      -    public View getView(int position, View convertView, ViewGroup parent) {
      -        ImageView i = new ImageView(mContext);
      -
      -        i.setImageResource(mImageIds[position]);
      -        i.setLayoutParams(new Gallery.LayoutParams(150, 100));
      -        i.setScaleType(ImageView.ScaleType.FIT_XY);
      -        i.setBackgroundResource(mGalleryItemBackground);
      -
      -        return i;
      -    }
      -}
      -
      -

      First, there are a few member variables, including an array of IDs that reference -the images we placed in our drawable resources directory.

      -

      Next is the constructor, where we define the member Context. The rest of the constructor -sets up a reference for our Gallery them, which adds the nice framing for each Gallery item. -Once we have our mGalleryItemBackground, it's important to recycle the -StyledAttribute for later re-use.

      -

      The next three methods are required for basic member queries. -But then we have the getView() method, which is called -for each item read by our ImageAdapter, when the Gallery is being built. Here, we -use our member Context to create a new {@link android.widget.ImageView}. We then define -the image resource with the current position of the Gallery items (corresponding to our -array of drawables), set the dimensions for the ImageView, -set the image scaling to fit the ImageView dimensions, then finally set the -background theme for the ImageView.

      - -

      See {@link android.widget.ImageView.ScaleType} -for other image scaling options, in case you want to avoid stretching images that don't -exactly match the ImageView dimensions.

      - -
    10. Now run it.
    11. -
    -

    You should see something like this:

    - - - -

    References

    - - - diff --git a/docs/html/guide/tutorials/views/hello-gridview.jd b/docs/html/guide/tutorials/views/hello-gridview.jd deleted file mode 100644 index 623a03d..0000000 --- a/docs/html/guide/tutorials/views/hello-gridview.jd +++ /dev/null @@ -1,128 +0,0 @@ -page.title=Hello, GridView -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.GridView} displays items in a two-dimensional, scrolling grid. The items -are acquired from a {@link android.widget.ListAdapter}.

    - - -
      -
    1. Start a new project/Activity called HelloGridView.
    2. -
    3. Find some photos you'd like to use, or copy some from the SDK samples res/drawable/ - folder of your project.
    4. -
    5. Open the layout and make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<GridView xmlns:android="http://schemas.android.com/apk/res/android" 
      -    android:id="@+id/gridview"
      -    android:layout_width="fill_parent" 
      -    android:layout_height="fill_parent"
      -    android:numColumns="auto_fit"
      -    android:verticalSpacing="10dp"
      -    android:horizontalSpacing="10dp"
      -    android:columnWidth="90dp"
      -    android:stretchMode="columnWidth"
      -    android:gravity="center"
      -/>
      -
    6. -
    7. Open the HelloGridView Java file. Insert the following for the onCreate() method: -
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -
      -    GridView gridview = (GridView) findViewById(R.id.gridview);
      -    gridview.setAdapter(new ImageAdapter(this));
      -}
      -
      -

      Here, we get a handle on our GridView, from the layout, and give it an Adapter. - We're actually going to create our own Adapter called ImageAdapter.

      -
    8. -
    9. Create a new class (nested or otherwise), called ImageAdapter, which extends {@link android.widget.BaseAdapter}: -
      -public class ImageAdapter extends BaseAdapter {
      -    private Context mContext;
      -
      -    public ImageAdapter(Context c) {
      -        mContext = c;
      -    }
      -
      -    public int getCount() {
      -        return mThumbIds.length;
      -    }
      -
      -    public Object getItem(int position) {
      -        return null;
      -    }
      -
      -    public long getItemId(int position) {
      -        return 0;
      -    }
      -
      -    // create a new ImageView for each item referenced by the Adapter
      -    public View getView(int position, View convertView, ViewGroup parent) {
      -        ImageView imageView;
      -        if (convertView == null) {  // if it's not recycled, initialize some attributes
      -            imageView = new ImageView(mContext);
      -            imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
      -            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
      -            imageView.setPadding(8, 8, 8, 8);
      -        } else {
      -            imageView = (ImageView) convertView;
      -        }
      -
      -        imageView.setImageResource(mThumbIds[position]);
      -        return imageView;
      -    }
      -
      -    // references to our images
      -    private Integer[] mThumbIds = {
      -            R.drawable.sample_2, R.drawable.sample_3,
      -            R.drawable.sample_4, R.drawable.sample_5,
      -            R.drawable.sample_6, R.drawable.sample_7,
      -            R.drawable.sample_0, R.drawable.sample_1,
      -            R.drawable.sample_2, R.drawable.sample_3,
      -            R.drawable.sample_4, R.drawable.sample_5,
      -            R.drawable.sample_6, R.drawable.sample_7,
      -            R.drawable.sample_0, R.drawable.sample_1,
      -            R.drawable.sample_2, R.drawable.sample_3,
      -            R.drawable.sample_4, R.drawable.sample_5,
      -            R.drawable.sample_6, R.drawable.sample_7
      -    };
      -}
      -
      -

      First we take care of some required methods inherited from BaseAdapter. - The constructor and getCount() are self-explanitory. Normally, getItem() - should return the actual object at the specified position in our Adapter, but for this Hello World, - we're not going to bother. Likewise, getItemId() should return the row id of - the item, but right now we don't care.

      -

      However, getView() is the method we care about. This one creates a new View for each image that we - put in our ImageAdapter. So we're going to create an ImageView each time. When this is called, we're - going to receive a View, which is likely a recycled View object (at least after the first call), so we - check for this—if it's null, we initialize the ImageView and setup all the properties we want. - The LayoutParams() initialization sets the height and width of the View—this ensures - that no matter the drawable size, each image is resized and cropped to fit in the ImageView (if necessary). - With setScaleType(), we say that images should be cropped toward the center (if necessary). - And finally, we set the padding within the ImageView. (Note that, if the images have various aspect-ratios, - as they do in this demo, then less padding will cause for more cropping of the image, if it does not match - the dimensions given to the ImageView.) At the end of getView() we set the image resource and - return the ImageView.

      -

      All that's left is our array or drawable resources at the bottom.

      -
    10. -
    11. Run it.
    12. -
    -

    Your grid layout should look something like this:

    - - -

    Try experimenting with the behaviors of the GridView and ImageView by adjusting their properties. For example, - instead of setting the ImageView LayoutParams, you can try using - {@link android.widget.ImageView#setAdjustViewBounds(boolean)}.

    - -

    References

    - - diff --git a/docs/html/guide/tutorials/views/hello-linearlayout.jd b/docs/html/guide/tutorials/views/hello-linearlayout.jd deleted file mode 100644 index 0e8947c..0000000 --- a/docs/html/guide/tutorials/views/hello-linearlayout.jd +++ /dev/null @@ -1,130 +0,0 @@ -page.title=Hello, LinearLayout -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.LinearLayout} is a GroupView that will lay child View elements -vertically or horizontally.

    - - -
      -
    1. Start a new project/Activity called HelloLinearLayout.
    2. -
    3. Open the layout file. - Make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:orientation="vertical"
      -    android:layout_width="fill_parent"
      -    android:layout_height="fill_parent">
      -
      -    <LinearLayout
      -	android:orientation="horizontal"
      -	android:layout_width="fill_parent"
      -	android:layout_height="fill_parent"
      -	android:layout_weight="1">
      -	
      -	<TextView
      -	    android:text="red"
      -	    android:gravity="center_horizontal"
      -	    android:background="#aa0000"
      -	    android:layout_width="wrap_content"
      -	    android:layout_height="fill_parent"
      -	    android:layout_weight="1"/>
      -	
      -	<TextView
      -	    android:text="green"
      -	    android:gravity="center_horizontal"
      -	    android:background="#00aa00"
      -	    android:layout_width="wrap_content"
      -	    android:layout_height="fill_parent"
      -	    android:layout_weight="1"/>
      -	
      -	<TextView
      -	    android:text="blue"
      -	    android:gravity="center_horizontal"
      -	    android:background="#0000aa"
      -	    android:layout_width="wrap_content"
      -	    android:layout_height="fill_parent"
      -	    android:layout_weight="1"/>
      -	
      -	<TextView
      -	    android:text="yellow"
      -	    android:gravity="center_horizontal"
      -	    android:background="#aaaa00"
      -	    android:layout_width="wrap_content"
      -	    android:layout_height="fill_parent"
      -	    android:layout_weight="1"/>
      -		
      -    </LinearLayout>
      -	
      -    <LinearLayout
      -	android:orientation="vertical"
      -	android:layout_width="fill_parent"
      -	android:layout_height="fill_parent"
      -	android:layout_weight="1">
      -	
      -	<TextView
      -	    android:text="row one"
      -	    android:textSize="15pt"
      -	    android:layout_width="fill_parent"
      -	    android:layout_height="wrap_content"
      -	    android:layout_weight="1"/>
      -	
      -	<TextView
      -	    android:text="row two"
      -	    android:textSize="15pt"
      -	    android:layout_width="fill_parent"
      -	    android:layout_height="wrap_content"
      -	    android:layout_weight="1"/>
      -	
      -	<TextView
      -	    android:text="row three"
      -	    android:textSize="15pt"
      -	    android:layout_width="fill_parent"
      -	    android:layout_height="wrap_content"
      -	    android:layout_weight="1"/>
      -	
      -	<TextView
      -	    android:text="row four"
      -	    android:textSize="15pt"
      -	    android:layout_width="fill_parent"
      -	    android:layout_height="wrap_content"
      -	    android:layout_weight="1"/>
      -        
      -    </LinearLayout>
      -        
      -</LinearLayout>
      -
      -

      Carefully inspect the XML. You'll notice how this layout works a lot like - an HTML layout. There is one parent LinearLayout that is defined to lay - its child elements vertically. The first child is another LinearLayout that uses a horizontal layout - and the second uses a vertical layout. Each LinearLayout contains several {@link android.widget.TextView} - elements.

      -
    4. -
    5. Now open the HelloLinearLayout Activity and be sure it loads this layout in the onCreate() method:

      -
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -}
      -
      -

      R.layout.main refers to the main.xml layout file.

      -
    6. -
    7. Run it.
    8. -
    -

    You should see the following:

    - - -

    Notice how the various XML attributes define the View's behavior. -Pay attention to the effect of the layout_weight. Try - experimenting with different values to see how the screen real estate is - distributed based on the weight of each element.

    - -

    References

    - - - diff --git a/docs/html/guide/tutorials/views/hello-listview.jd b/docs/html/guide/tutorials/views/hello-listview.jd deleted file mode 100644 index d90005b..0000000 --- a/docs/html/guide/tutorials/views/hello-listview.jd +++ /dev/null @@ -1,90 +0,0 @@ -page.title=Hello, ListView -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.ListView} is a View that shows items in a vertically scrolling list. The items are - acquired from a {@link android.widget.ListAdapter}.

    - - -
      -
    1. Start a new project/ListActivity called HelloListView.
    2. -
    3. Open the HelloListView Java file. Make the class extend ListActivity (instead of Activity). -
      public class HelloListView extends ListActivity {
      -
    4. -
    5. Insert the following for the onCreate() method: -
      -@Override
      -public void onCreate(Bundle savedInstanceState) {
      -  super.onCreate(savedInstanceState);
      -  
      -  setListAdapter(new ArrayAdapter<String>(this,
      -          android.R.layout.simple_list_item_1, COUNTRIES));
      -  getListView().setTextFilterEnabled(true);
      -}
      -
      -

      Notice that we don't need to load a layout (at least, not in this case, because we're using - the whole screen for our list). Instead, we just call setListAdapter() (which automatically - adds a ListView to the ListActivity), and provide it with an ArrayAdapter that binds a - simple_list_item_1 layout item to each entry in the COUNTRIES - array (added next). The next line of code adds a text filter to the ListView, so that when the user - begins typing, the list will filter the entire view to display only the items that match the entry.

      -
    6. -
    7. Following the onCreate() method, add the String array: -
      -  static final String[] COUNTRIES = new String[] {
      -    "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
      -    "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
      -    "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
      -    "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
      -    "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
      -    "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
      -    "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
      -    "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
      -    "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
      -    "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
      -    "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
      -    "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
      -    "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
      -    "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
      -    "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
      -    "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
      -    "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
      -    "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
      -    "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
      -    "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
      -    "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
      -    "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
      -    "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
      -    "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
      -    "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
      -    "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
      -    "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
      -    "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
      -    "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
      -    "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
      -    "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
      -    "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
      -    "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
      -    "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
      -    "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
      -    "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
      -    "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
      -    "Ukraine", "United Arab Emirates", "United Kingdom",
      -    "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
      -    "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
      -    "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
      -  };
      -
      -
    8. -
    9. Run it.
    10. -
    -

    You can scroll the list, or type to filter it. You should see something like this:

    - - -

    References

    - - diff --git a/docs/html/guide/tutorials/views/hello-mapview.jd b/docs/html/guide/tutorials/views/hello-mapview.jd deleted file mode 100644 index b0f59de..0000000 --- a/docs/html/guide/tutorials/views/hello-mapview.jd +++ /dev/null @@ -1,243 +0,0 @@ -page.title=Hello, MapView -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A MapView allows you to create your own map-viewing Activity. -First, we'll create a simple Activity that can view and navigate a map. Then we will add some overlay items.

    - -
      -
    1. Start a new project/Activity called HelloMapView. - -
    2. Because we're using the Google Maps library, - which is not a part of the standard Android library, we need to - declare it in the Android Manifest. Open the AndroidManifest.xml - file and add the following as a child of the <application> element: - -
      <uses-library android:name="com.google.android.maps" />
      -
    3. - -
    4. Open the layout file. Define the layout with a MapView inside a RelativeLayout: - -
      -<?xml version="1.0" encoding="utf-8"?>
      -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:id="@+id/mainlayout"
      -    android:orientation="vertical"
      -    android:layout_width="fill_parent"
      -    android:layout_height="fill_parent" >
      -
      -    <com.google.android.maps.MapView
      -        android:id="@+id/mapview"
      -        android:layout_width="fill_parent"
      -        android:layout_height="fill_parent"
      -        android:clickable="true"
      -        android:apiKey="INSERT YOUR KEY HERE"
      -    />
      -
      -<RelativeLayout>
      -
      -

      Setting clickable is important. Otherwise, the map does not allow any user interaction.

      - -

      The android:apiKey must contain an authentic Android Maps API key. - The API key is generated using the MD5 fingerprint of your application certificate. For the purposes of - this exercise, you should use the fingerprint of your debug certificate (which cannot be used to release - your application for Android devices, but will work while developing). See how to - generate a fingerprint from your - debug certificate, then register the - certificate to retieve an API key. - Insert the API key as the value of the apiKey attribute. If you do not insert a valid - Maps API key, the application will still run, but no map tiles will load.

    5. - -
    6. Now open the HelloMapView.java file. For this Activity, we're going to extend the special sub-class of - Activity called MapActivity, so change the class declaration to extend - MapActicity, instead of Activity:

      - -
      public class HelloMapView extends MapActivity {
      - -
    7. The isRouteDisplayed() method is required, so add it inside the class: -
      -@Override
      -protected boolean isRouteDisplayed() {
      -    return false;
      -}
      -
      -

      You can actually run this now, but all it does is allow you to pan around the map.

      -

      Android provides a handy {@link android.widget.ZoomControls} widget for zooming in and out of a View. -MapView can automatically hook one for us by requesting it with the getZoomControls() -method. Let's do this.

      - -
    8. Go back to the layout file. We need a new ViewGroup element, in which we'll - place the ZoomControls. Just below the MapView element (but inside the RelativeLayout), add this element: -
      -<LinearLayout
      -    android:id="@+id/zoomview"
      -    android:layout_width="wrap_content"
      -    android:layout_height="wrap_content"
      -    android:layout_alignBottom="@id/mapview"
      -    android:layout_centerHorizontal="true"
      -/>
      - -

      It doesn't really matter what kind of ViewGroup we use, because we just want a - container that we can position within our root RelativeLayout.

      - -

      The last two attributes are available only to an element that's a child of a - RelativeLayout. layout_alignBottom aligns the bottom of this element to the bottom of - the element identified with a resource tag (which must be a sibling to this element). - layout_centerHorizontal centers this on the horizontal plane.

    9. - -
    10. Now go back to the HelloMapView class. We'll now retrieve the ZoomControls object from - the MapView and add it to our new layout element. First, at the top of the HelloMapView, - instantiate handles for the MapView and LinearLayout, plus a ZoomControl object: -
      -LinearLayout linearLayout;
      -MapView mapView;
      -ZoomControls mZoom;
    11. - -
    12. Then initialize each of these in onCreate(). We'll capture the LinearLayout and - MapView through their layout resources. Then get the ZoomControls from the MapView:: -
      -linearLayout = (LinearLayout) findViewById(R.id.zoomview);
      -mapView = (MapView) findViewById(R.id.mapview);
      -mZoom = (ZoomControls) mapView.getZoomControls();
      - -

      By using the ZoomControls object provided by MapView, we don't have to do any of the work - required to actually perform the zoom operations. The ZoomControls widget that MapView - returns for us is already hooked into the MapView and works as soon as we add it to the - layout. The controls will appear whenever the user touches the map, then dissapear after - a few moments of inactivity.

    13. - -
    14. Now just plug our ZoomControls into the LinearLayout we added: - -
      linearLayout.addView(mZoom);
    15. - -
    16. Run it.
    17. -
    - -
    - -

    So, we now have full interaction controls. All well and good, but what we really want our map -for is custom markers and layovers. Let's add some Overlay -objects to our map. To do this, we're going to -implement the ItemizedOverlay -class, which can manage a whole set of Overlay items for us.

    - -
      -
    1. Create a new Java class named HelloItemizedOverlay that implements ItemizedOverlay. - -

      When using Eclipse, right-click the package name in the Eclipse Package Explorer, and select New > Class. Fill-in - the Name field as HelloItemizedOverlay. For the Superclass, enter - com.google.android.maps.ItemizedOverlay. Click the checkbox for Constructors from - superclass. Click Finish.

    2. - -
    3. First thing, we need an OverlayItem ArrayList, in which we'll put each of the OverlayItem - objects we want on our map. Add this at the top of the HelloItemizedOverlay class: - -
      private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
    4. - -
    5. All the constructor does is define the default marker to be used on each of the OverlayItems. - In order for the Drawable to actually get drawn, it must have its bounds defined. And we want the - center-point at the bottom of the image to be the point at which it's attached to the map - coordinates. We handle all this with the boundCenterBottom() method. Wrap this around our - defaultMarker, so the super constructor call looks like this: - -
      super(boundCenterBottom(defaultMarker));
    6. - -
    7. In order to add new OverlayItems to our ArrayList, we need a new public method. We'll handle - this with the following method: - -
      -public void addOverlay(OverlayItem overlay) {
      -    mOverlays.add(overlay);
      -    populate();
      -}
      - -

      Each time we add a new OverlayItem, we must call populate(), which will read each of out - OverlayItems and prepare them to be drawn.

    8. - -
    9. In order for the populate() method to read each OverlayItem, it will make a request to - createItem(int). We must define this method to properly read from our ArrayList. Replace the - existing contents of the createItem method with a get() call to our ArrayList: - -
      -@Override
      -protected OverlayItem createItem(int i) {
      -  return mOverlays.get(i);
      -}
      -
    10. - -
    11. We're also required to override the size() method. Replace the existing contents of the - method with a size request to our ArrayList: - -
      return mOverlays.size();
    12. -
    - - -

    That's it for the HelloItemizedOverlay class. We're now ready to use it.

    - -
    -

    Go back to the HelloMapView -class. We'll start by creating one OverlayItem, adding to an instance of our HelloItemizedOverlay, -and then adding this to the MapView.

    - - -

    First, we need the image that we'll use for our map overlay. Here, we'll use the Android on the -right as our marker. Drag this image (or your own) to the res/drawable/ directory of your project workspace.

    - -

    Now we're ready to work in the HelloMapView:

    - -
      -
    1. First we need some more types. Add the following at the top of the HelloMapView class: - -
      -List<Overlay> mapOverlays;
      -Drawable drawable;
      -HelloItemizedOverlay itemizedOverlay;
    2. - -
    3. Now pick up where we left off in the onCreate() method. Instantiate the - new fields: - -
      -mapOverlays = mapView.getOverlays();
      -drawable = this.getResources().getDrawable(R.drawable.androidmarker);
      -itemizedoverlay = new HelloItemizedOverlay(drawable);
      - -

      All overlay elements on a map are held by the MapView, so when we want to add some, we must - first retrieve the List with getOverlays() methods. We instantiate the Drawable, which will - be used as our map marker, by using our Context resources to get the Drawable we placed in - the res/drawable/ directory (androidmarker.png). Our HelloItemizedOverlay takes the Drawable in order to set the - default marker.

    4. - -
    5. Now let's make our first OverlayItem by creating a GeoPoint - that defines our map coordinates, then pass it to a new OverlayItem: - -
      -GeoPoint point = new GeoPoint(19240000,-99120000);
      -OverlayItem overlayitem = new OverlayItem(point, "", "");
      - -

      GeoPoint coordinates are based in microdegrees (degrees * 1e6). The OverlayItem takes this - GeoPoint and two strings. Here, we won't concern ourselves with the strings, which can display - text when we click our marker, because we haven't yet written the click handler for the OverlayItem.

    6. - -
    7. All that's left is for us to add this OverlayItem to our collection in the HelloItemizedOverlay, - and add this to the List of Overlay objects retrieved from the MapView: - -
      -itemizedoverlay.addOverlay(overlayitem);
      -mapOverlays.add(itemizedoverlay);
    8. - -
    9. Run it!
    10. -
    - -

    We've sent our droid to Mexico City. Hola, Mundo!

    -

    You should see the following:

    - - -

    Because we created our ItemizedOverlay class with an ArrayList, we can continue adding new -OverlayItems. Try adding another one. Before the addOverlay() method is called, add these lines:

    -
    -GeoPoint point2 = new GeoPoint(35410000, 139460000);
    -OverlayItem overlayitem2 = new OverlayItem(point2, "", "");
    -
    -

    Run it again... We've sent a new droid to Tokyo. Sekai, konichiwa!

    - diff --git a/docs/html/guide/tutorials/views/hello-relativelayout.jd b/docs/html/guide/tutorials/views/hello-relativelayout.jd deleted file mode 100644 index 1b91537..0000000 --- a/docs/html/guide/tutorials/views/hello-relativelayout.jd +++ /dev/null @@ -1,75 +0,0 @@ -page.title=Hello, RelativeLayout -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.RelativeLayout} is a ViewGroup that allows you to layout child elements -in positions relative to the parent or siblings elements.

    - -
      -
    1. Start a new project/Activity called HelloRelativeLayout.
    2. -
    3. Open the layout file. Make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:layout_width="fill_parent"
      -    android:layout_height="fill_parent">
      -
      -    <TextView
      -        android:id="@+id/label"
      -        android:layout_width="fill_parent"
      -        android:layout_height="wrap_content"
      -        android:text="Type here:"/>
      -
      -    <EditText
      -        android:id="@+id/entry"
      -        android:layout_width="fill_parent"
      -        android:layout_height="wrap_content"
      -        android:background="@android:drawable/editbox_background"
      -        android:layout_below="@id/label"/>
      -
      -    <Button
      -        android:id="@+id/ok"
      -        android:layout_width="wrap_content"
      -        android:layout_height="wrap_content"
      -        android:layout_below="@id/entry"
      -        android:layout_alignParentRight="true"
      -        android:layout_marginLeft="10dip"
      -        android:text="OK" />
      -
      -    <Button
      -        android:layout_width="wrap_content"
      -        android:layout_height="wrap_content"
      -        android:layout_toLeftOf="@id/ok"
      -        android:layout_alignTop="@id/ok"
      -        android:text="Cancel" />
      -
      -</RelativeLayout>
      -
      -

      Pay attention to each of the additional layout_* attributes (besides the -usual width and height, which are required for all elements). When using relative layout, -we use attributes like layout_below and layout_toLeftOf to describe -how we'd like to position each View. Naturally, these are different relative positions, and the -value of the attribute is the id of the element we want the position relative to.

      -
    4. -
    5. Make sure your Activity loads this layout in the onCreate() method:

      -
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -}
      -
      -

      R.layout.main refers to the main.xml layout file.

      -
    6. -
    7. Run it.
    8. -
    -

    You should see the following:

    - - -

    Resources

    - diff --git a/docs/html/guide/tutorials/views/hello-spinner.jd b/docs/html/guide/tutorials/views/hello-spinner.jd deleted file mode 100644 index 3a04214..0000000 --- a/docs/html/guide/tutorials/views/hello-spinner.jd +++ /dev/null @@ -1,106 +0,0 @@ -page.title=Hello, Spinner -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.Spinner} is a widget that allows the user to select an item from a group. -It is similar to a dropdown list and will allow scrolling when the -list exceeds the available vertical space on the screen.

    - - -
      -
    1. Start a new project/Activity called HelloSpinner.
    2. -
    3. Open the layout file. - Make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:orientation="vertical"
      -    android:padding="10dip"
      -    android:layout_width="fill_parent"
      -    android:layout_height="wrap_content">
      -
      -    <TextView
      -        android:layout_width="fill_parent"
      -        android:layout_height="wrap_content"
      -        android:layout_marginTop="10dip"
      -        android:text="Please select a planet:"
      -    />
      -
      -    <Spinner 
      -        android:id="@+id/spinner"
      -        android:layout_width="fill_parent"
      -        android:layout_height="wrap_content"
      -        android:drawSelectorOnTop="true"
      -        android:prompt="@string/planet_prompt"
      -    />
      -
      -</LinearLayout>
      -
      -

      Notice that the Spinner's android:prompt is a string resource. In - this case, Android does not allow it to be a string, it must be a reference to a resource. - So...

      -
    4. - -
    5. Open the strings.xml file in res/values/ and add the following <string> -element inside the <resources> element: -
      -<string name="planet_prompt">Choose a planet</string>
      -
      -
    6. - -
    7. Create a new XML file in res/values/ called arrays.xml. Insert the following: -
      -<resources>
      -
      -    <string-array name="planets">
      -        <item>Mercury</item>
      -        <item>Venus</item>
      -        <item>Earth</item>
      -        <item>Mars</item>
      -        <item>Jupiter</item>
      -        <item>Saturn</item>
      -        <item>Uranus</item>
      -        <item>Neptune</item>
      -    </string-array>
      -    
      -</resources>
      -
      -

      This is the list of items (planets) that the user can select from in the Spinner widget.

      -
    8. - -
    9. Now open the HelloSpinner.java file. Insert the following code into the HelloSpinner class: -
      -@Override
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -
      -    Spinner s = (Spinner) findViewById(R.id.spinner);
      -    ArrayAdapter adapter = ArrayAdapter.createFromResource(
      -            this, R.array.planets, android.R.layout.simple_spinner_item);
      -    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      -    s.setAdapter(adapter);
      -}
      -
      -

      That's it. We start by creating a Spinner from our layout. We then create an {@link android.widget.ArrayAdapter} - that binds each element of our string array to a layout view—we pass createFromResource our Context, - the array of selectable items and the type of layout we'd like each one bound to. We then call - setDropDownViewResource() to define the type of layout in which to present the - entire collection. Finally, we set this Adapter to associate with our Spinner, - so the string items have a place to go.

      -
    10. - -
    11. Now run it.
    12. -
    -

    It should look like this:

    - - - -

    Resources

    - - diff --git a/docs/html/guide/tutorials/views/hello-tablelayout.jd b/docs/html/guide/tutorials/views/hello-tablelayout.jd deleted file mode 100644 index 83d6f5d..0000000 --- a/docs/html/guide/tutorials/views/hello-tablelayout.jd +++ /dev/null @@ -1,118 +0,0 @@ -page.title=Hello, TableLayout -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.TableLayout} is a ViewGroup that -will lay child View elements into rows and columns.

    - - -
      -
    1. Start a new project/Activity called HelloTableLayout.
    2. -
    3. Open the layout file. - Make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:layout_width="fill_parent"
      -    android:layout_height="fill_parent"
      -    android:stretchColumns="1">
      -
      -    <TableRow>
      -        <TextView
      -            android:layout_column="1"
      -            android:text="Open..."
      -            android:padding="3dip" />
      -        <TextView
      -            android:text="Ctrl-O"
      -            android:gravity="right"
      -            android:padding="3dip" />
      -    </TableRow>
      -
      -    <TableRow>
      -        <TextView
      -            android:layout_column="1"
      -            android:text="Save..."
      -            android:padding="3dip" />
      -        <TextView
      -            android:text="Ctrl-S"
      -            android:gravity="right"
      -            android:padding="3dip" />
      -    </TableRow>
      -
      -    <TableRow>
      -        <TextView
      -            android:layout_column="1"
      -            android:text="Save As..."
      -            android:padding="3dip" />
      -        <TextView
      -            android:text="Ctrl-Shift-S"
      -            android:gravity="right"
      -            android:padding="3dip" />
      -    </TableRow>
      -
      -    <View
      -        android:layout_height="2dip"
      -        android:background="#FF909090" />
      -
      -    <TableRow>
      -        <TextView
      -            android:text="X"
      -            android:padding="3dip" />
      -        <TextView
      -            android:text="Import..."
      -            android:padding="3dip" />
      -    </TableRow>
      -
      -    <TableRow>
      -        <TextView
      -            android:text="X"
      -            android:padding="3dip" />
      -        <TextView
      -            android:text="Export..."
      -            android:padding="3dip" />
      -        <TextView
      -            android:text="Ctrl-E"
      -            android:gravity="right"
      -            android:padding="3dip" />
      -    </TableRow>
      -
      -    <View
      -        android:layout_height="2dip"
      -        android:background="#FF909090" />
      -
      -    <TableRow>
      -        <TextView
      -            android:layout_column="1"
      -            android:text="Quit"
      -            android:padding="3dip" />
      -    </TableRow>
      -</TableLayout>
      -
      -

      Notice how this resembles the structure of an HTML table. TableLayout is like the -table element; TableRow is like a tr element; but for our cells like -the html td element, we can use any kind of View. Here, we use TextView for the cells.

      - -
    4. -
    5. Make sure your Activity loads this layout in the onCreate() method: -
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -}
      -
      -

      R.layout.main refers to the main.xml layout file.

      -
    6. -
    7. Run it.
    8. -
    -

    You should see the following:

    - - -

    References

    - - - diff --git a/docs/html/guide/tutorials/views/hello-tabwidget.jd b/docs/html/guide/tutorials/views/hello-tabwidget.jd deleted file mode 100644 index 8424616..0000000 --- a/docs/html/guide/tutorials/views/hello-tabwidget.jd +++ /dev/null @@ -1,124 +0,0 @@ -page.title=Hello, TabWidget -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.TabWidget} offers the ability to easily draw an interface that uses -tabs to navigate between different views.

    - -
      -
    1. Start a new project/Activity called HelloTabWidget.
    2. -
    3. Open the layout file and make it like so:
    4. -
      -<?xml version="1.0" encoding="utf-8"?>
      -<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:id="@android:id/tabhost"
      -    android:layout_width="fill_parent"
      -    android:layout_height="fill_parent">
      -    <LinearLayout
      -        android:orientation="vertical"
      -        android:layout_width="fill_parent"
      -        android:layout_height="fill_parent">
      -        <TabWidget
      -            android:id="@android:id/tabs"
      -            android:layout_width="fill_parent"
      -            android:layout_height="wrap_content" />
      -        <FrameLayout
      -            android:id="@android:id/tabcontent"
      -            android:layout_width="fill_parent"
      -            android:layout_height="fill_parent">
      -            <TextView 
      -                android:id="@+id/textview1"
      -                android:layout_width="fill_parent"
      -                android:layout_height="fill_parent" 
      -                android:text="this is a tab" />
      -            <TextView 
      -                android:id="@+id/textview2"
      -                android:layout_width="fill_parent"
      -                android:layout_height="fill_parent" 
      -                android:text="this is another tab" />
      -            <TextView 
      -                android:id="@+id/textview3"
      -                android:layout_width="fill_parent"
      -                android:layout_height="fill_parent" 
      -                android:text="this is a third tab" />
      -    	</FrameLayout>
      -    </LinearLayout>
      -</TabHost>
      -
      -

      Here, we've created a {@link android.widget.TabHost} that contains the entire layout of the Activity. - A TabHost requires two descendant elements: a {@link android.widget.TabWidget} and a {@link android.widget.FrameLayout}. - In order to properly layout these elements, we've put them inside a vertical {@link android.widget.LinearLayout}. - The FrameLayout is where we keep the content that will change with each tab. Each child in the FrameLayout will - be associated with a different tab. - In this case, each tab simply shows a different {@link android.widget.TextView} with some text.

      -

      Notice that the TabWidget and the FrameLayout elements have specific android namespace IDs. These are necessary - so that the TabHost can automatically retireve references to them, populate the TabWidget with the tabs that we'll define - in our code, and swap the views in the FrameLayout. We've also defined our own IDs for each TextView, which we'll use to - associate each tab with the view that it should reveal.

      -

      Of course, you can - make these child views as large as complex as you'd like — instead of the TextView elements, - you could start with other layout views and build a unique layout hierarchy for each tab.

      - -
    5. Now we'll add our code. Open HelloTabWidget.java and make it a TabActivity. -

      By default, Eclipse creates a class that extends Activity. Change it to - extend TabActivity:

      -
      -public class HelloTabWidget extends TabActivity {
      -
      -
    6. -
    7. Now fill in the the onCreate method like this: -
      -public void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -
      -    mTabHost = getTabHost();
      -    
      -    mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("TAB 1").setContent(R.id.textview1));
      -    mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("TAB 2").setContent(R.id.textview2));
      -    mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("TAB 3").setContent(R.id.textview3));
      -    
      -    mTabHost.setCurrentTab(0);
      -}
      -
      -

      As usual, we start by setting our layout.

      -

      We then call the TabActivity method getTabHost(), - which returns us a reference to the TabHost we created in our layout. Upon our TabHost, we call addTab() - for each of the tabs that we want to add to the TabWidget. Each time we call this, we pass a - {@link android.widget.TabHost.TabSpec} that we build on the fly, and with it, chain together two necessary methods: - setIndicator() to set the text for the tab button, and setContent() to define - which View we want to associate with the tab and reveal when pressed. Our indicator is just a text string and - our content is an ID reference to the TextView elements we inserted in the FrameLayout.

      -

      At the end, we call setCurrentTab() to define which tab should be opened by default. The tabs - are saved like a zero-based array, so to open the first tab, we pass zero (0).

      -
    8. -
    9. To clean-up the presentation a bit more, let's remove the window title that appears at the top of the layout. - Android includes a theme that removes that title for us. To add it, open the Android Manifest file and add - the NoTitleBar theme to the <application> tag. It should end up like this: -
      -<application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar">
      -
      -
    10. -
    11. That's it. Run your application.
    12. - -
    - - -

    Your application should look like this:

    - - -

    You can include icons in your tabs by passing a -{@link android.graphics.drawable.Drawable} when you call setIndicator(). Here's an example -that uses a Drawable created from an image in the project resources:

    -
    setIndicator("TAB 1", getResources().getDrawable(R.drawable.tab_icon))
    -
    - -

    References

    - - diff --git a/docs/html/guide/tutorials/views/hello-timepicker.jd b/docs/html/guide/tutorials/views/hello-timepicker.jd deleted file mode 100644 index 1a6c8f9..0000000 --- a/docs/html/guide/tutorials/views/hello-timepicker.jd +++ /dev/null @@ -1,159 +0,0 @@ -page.title=Hello, TimePicker -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.widget.TimePicker} is a widget that allows the -user to select the time by hour, minute and AM or PM.

    - - -
      -
    1. Start a new project/Activity called HelloTimePicker.
    2. -
    3. Open the layout file and make it like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:layout_width="wrap_content"
      -    android:layout_height="wrap_content"
      -    android:orientation="vertical">
      -
      -    <TextView android:id="@+id/timeDisplay"
      -        android:layout_width="wrap_content"
      -        android:layout_height="wrap_content"
      -        android:text=""/>
      -
      -    <Button android:id="@+id/pickTime"
      -        android:layout_width="wrap_content"
      -        android:layout_height="wrap_content"
      -        android:text="Change the time"/>
      -
      -</LinearLayout>
      -
      -

      For the layout, we're using a vertical LinearLayout, with a {@link android.widget.TextView} that - will display the time and a {@link android.widget.Button} that will initiate the - {@link android.widget.TimePicker} dialog. - With this layout, the TextView will sit above the Button. - The text value in the TextView is set empty, as it will be filled by our Activity - with the current time.

      -
    4. - -
    5. Open HelloTimePicker.java. Insert the following to the HelloTimePicker class: -
      -private TextView mTimeDisplay;
      -private Button mPickTime;
      -
      -private int mHour;
      -private int mMinute;
      -
      -static final int TIME_DIALOG_ID = 0;
      -
      -@Override
      -protected void onCreate(Bundle savedInstanceState) {
      -    super.onCreate(savedInstanceState);
      -    setContentView(R.layout.main);
      -    
      -    // capture our View elements
      -    mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);
      -    mPickTime = (Button) findViewById(R.id.pickTime);
      -
      -    // add a click listener to the button
      -    mPickTime.setOnClickListener(new View.OnClickListener() {
      -        public void onClick(View v) {
      -            showDialog(TIME_DIALOG_ID);
      -        }
      -    });
      -
      -    // get the current time
      -    final Calendar c = Calendar.getInstance();
      -    mHour = c.get(Calendar.HOUR_OF_DAY);
      -    mMinute = c.get(Calendar.MINUTE);
      -
      -    // display the current date
      -    updateDisplay();
      -}
      -
      -

      Tip: Press Ctrl(or Cmd) + Shift + O to import all needed packages.

      -

      We start by instantiating variables for our View elements and time fields. - The TIME_DIALOG_ID is a static integer that uniquely identifies the dialog. In the - onCreate() method, we get prepared by setting the layout and capturing the View elements. - We then set an on-click listener for the Button, so that when it is clicked, it will - show our TimePicker dialog. The showDialog() method will perform a callback - to our Activity. (We'll define this callback in the next section.) We then create an - instance of {@link java.util.Calendar} and get the current hour and minute. Finally, we call - updateDisplay()—our own method that will fill the TextView with the time.

      -
    6. - -
    7. After the onCreate() method, add the onCreateDialog() callback method: -
      -@Override
      -protected Dialog onCreateDialog(int id) {
      -    switch (id) {
      -    case TIME_DIALOG_ID:
      -        return new TimePickerDialog(this,
      -                mTimeSetListener, mHour, mMinute, false);
      -    }
      -    return null;
      -}
      -
      -

      This is passed the identifier we gave showDialog() and initializes - the TimePicker to the time we retrieved from our Calendar instance. It will be called by - showDialog().

      -
    8. - -
    9. Now add our updateDisplay() method: -
      -// updates the time we display in the TextView
      -private void updateDisplay() {
      -    mTimeDisplay.setText(
      -        new StringBuilder()
      -                .append(pad(mHour)).append(":")
      -                .append(pad(mMinute)));
      -}
      -
      -

      This simply takes our member fields for the time and inserts them in - the mTimeDisplay TextView. Note that we call a new method, pad(), - on the hour and minute. (We'll create this method in the last step.)

      -
    10. - -
    11. Next, add a listener to be called when the time is reset: -
      -// the callback received when the user "sets" the time in the dialog
      -private TimePickerDialog.OnTimeSetListener mTimeSetListener =
      -    new TimePickerDialog.OnTimeSetListener() {
      -        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
      -            mHour = hourOfDay;
      -            mMinute = minute;
      -            updateDisplay();
      -        }
      -    };
      -
      -

      Now when the user is done setting the time (clicks the "Set" button), we update our member fields with - the new time and update our TextView.

      -
    12. -
    13. Finally, add the pad() method that we called from the updateDisplay(): -
      -private static String pad(int c) {
      -    if (c >= 10)
      -        return String.valueOf(c);
      -    else
      -        return "0" + String.valueOf(c);
      -}
      -
      -

      This method returns the appropriate String representation of the hour or minute. - It will prefix a zero to the number if it's a single digit. -

      -
    14. - -
    15. Now run it.
    16. -
    -

    When you press the "Change the time" button, you should see the following:

    - - -

    References

    -
      -
    1. {@link android.widget.TimePicker}
    2. -
    3. {@link android.widget.Button}
    4. -
    5. {@link android.widget.TextView}
    6. -
    7. {@link java.util.Calendar}
    8. -
    - diff --git a/docs/html/guide/tutorials/views/hello-webview.jd b/docs/html/guide/tutorials/views/hello-webview.jd deleted file mode 100644 index c4388ea..0000000 --- a/docs/html/guide/tutorials/views/hello-webview.jd +++ /dev/null @@ -1,118 +0,0 @@ -page.title=Hello, WebView -parent.title=Hello, Views -parent.link=index.html -@jd:body - -

    A {@link android.webkit.WebView} allows you to create your own web browser Activity. In this tutorial, -we'll create a simple Activity that can view web pages.

    - -
      -
    1. Create a new project/Activity called HelloWebView.
    2. -
    3. Open the layout file. Insert a WebView so it looks like so: -
      -<?xml version="1.0" encoding="utf-8"?>
      -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      -    android:layout_width="wrap_content"
      -    android:layout_height="wrap_content"
      -    android:orientation="vertical">
      -
      -    <WebView 
      -        android:id="@+id/webview"
      -        android:layout_width="fill_parent"
      -        android:layout_height="fill_parent"
      -    />
      -
      -</LinearLayout>
      -
    4. - -
    5. Now open the HelloWebView.java file. - At the top of the class, instantiate a WebView object: -
      WebView webview;
      -

      Then add the following at the end of the onCreate() method:

      -
      -webview = (WebView) findViewById(R.id.webview);
      -webview.getSettings().setJavaScriptEnabled(true);
      -webview.loadUrl("http://www.google.com");
      -
      - -

      This captures the WebView we created in our layout, then requests a - {@link android.webkit.WebSettings} object and enables JavaScript. - Then we load a URL.

    6. - -
    7. Because we're accessing the internet, we need to add the appropriate - permissions to the Android manifest file. So open the AndroidManifest.xml file - and, add the following as a child of the <manifest> element: - -
      <uses-permission android:name="android.permission.INTERNET" />
    8. - -
    9. Now run it.
    10. -
    -

    You now have the world's simplest web page viewer. - It's not quite a browser yet. It only loads the page we've requested.

    - -
    - -

    We can load a page, but as soon as we click a link, the default Android web browser -handles the Intent, instead of our own WebView handling the action. So now we'll -override the {@link android.webkit.WebViewClient} to enable us to handle our own URL loading.

    - -
      -
    1. In the HelloAndroid Activity, add this nested private class: -
      -private class HelloWebViewClient extends WebViewClient {
      -    @Override
      -    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      -        view.loadUrl(url);
      -        return true;
      -    }
      -}
    2. - -
    3. Now, in the onCreate() method, set an instance of the HelloWebViewClient - as our WebViewClient: -
      webview.setWebViewClient(new WebViewClientDemo());
      - -

      This line should immediately follow the initialization of our WebView object.

      -

      What we've done is create a WebViewClient that will load any URL selected in our -WebView in the same WebView. You can see this in the shouldOverrideUrlLoading() -method, above—it is passed the current WebView and the URL, so all we do -is load the URL in the given view. Returning true says that we've handled the URL -ourselves and the event should not bubble-up.

      -

      If you try it again, new pages will now load in the HelloWebView Activity. However, you'll notice that -we can't navigate back. We need to handle the back button -on the device, so that it will return to the previous page, rather than exit the application.

      -
    4. - -
    5. To handle the back button key press, add the following method inside the HelloWebView -Activity: -
       
      -@Override
      -public boolean onKeyDown(int keyCode, KeyEvent event) {
      -    if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
      -        webview.goBack();
      -        return true;
      -    }
      -    return super.onKeyDown(keyCode, event);
      -}
      -

      The condition uses a {@link android.view.KeyEvent} to check - whether the key pressed is the BACK button and whether the - WebView is actually capable of navigating back (if it has a history). If both are - not true, then we send the event up the chain (and the Activity will close). - But if both are true, then we call goBack(), - which will navigate back one step in the history. We then return true to indicate - that we've handled the event.

      -
    6. -
    -

    When you open the application, it should look like this:

    - - -

    Resource

    - - - - - - diff --git a/docs/html/guide/tutorials/views/images/android.png b/docs/html/guide/tutorials/views/images/android.png deleted file mode 100755 index 39a1ac7..0000000 Binary files a/docs/html/guide/tutorials/views/images/android.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/androidmarker.png b/docs/html/guide/tutorials/views/images/androidmarker.png deleted file mode 100755 index 8c43d46..0000000 Binary files a/docs/html/guide/tutorials/views/images/androidmarker.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-autocomplete.png b/docs/html/guide/tutorials/views/images/hello-autocomplete.png deleted file mode 100755 index e1fd80d..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-autocomplete.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-datepicker.png b/docs/html/guide/tutorials/views/images/hello-datepicker.png deleted file mode 100755 index 2075066..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-datepicker.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-formstuff.png b/docs/html/guide/tutorials/views/images/hello-formstuff.png deleted file mode 100755 index 3b4bf54..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-formstuff.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-gallery.png b/docs/html/guide/tutorials/views/images/hello-gallery.png deleted file mode 100755 index 22d1eaf..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-gallery.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-gridview.png b/docs/html/guide/tutorials/views/images/hello-gridview.png deleted file mode 100755 index 2def0df..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-gridview.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-linearlayout.png b/docs/html/guide/tutorials/views/images/hello-linearlayout.png deleted file mode 100755 index dfef819..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-linearlayout.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-listview.png b/docs/html/guide/tutorials/views/images/hello-listview.png deleted file mode 100755 index a1cf7aa..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-listview.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-mapview.png b/docs/html/guide/tutorials/views/images/hello-mapview.png deleted file mode 100755 index 0956760..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-mapview.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-relativelayout.png b/docs/html/guide/tutorials/views/images/hello-relativelayout.png deleted file mode 100755 index ec4d9d4..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-relativelayout.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-spinner.png b/docs/html/guide/tutorials/views/images/hello-spinner.png deleted file mode 100755 index 42e2a91..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-spinner.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-tablelayout.png b/docs/html/guide/tutorials/views/images/hello-tablelayout.png deleted file mode 100755 index 3d80e7f..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-tablelayout.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-tabwidget.png b/docs/html/guide/tutorials/views/images/hello-tabwidget.png deleted file mode 100644 index 6a52356..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-tabwidget.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-timepicker.png b/docs/html/guide/tutorials/views/images/hello-timepicker.png deleted file mode 100755 index bd5a1ee..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-timepicker.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/images/hello-webview.png b/docs/html/guide/tutorials/views/images/hello-webview.png deleted file mode 100755 index 283ce7d..0000000 Binary files a/docs/html/guide/tutorials/views/images/hello-webview.png and /dev/null differ diff --git a/docs/html/guide/tutorials/views/index.jd b/docs/html/guide/tutorials/views/index.jd deleted file mode 100644 index 2248c68..0000000 --- a/docs/html/guide/tutorials/views/index.jd +++ /dev/null @@ -1,118 +0,0 @@ -page.title=Hello, Views -@jd:body - - - -

    This collection of "Hello World"-style tutorials is designed -to get you quickly started with common Android Views and widgets. The aim is to let you copy and paste -these kinds of boring bits so you can focus on developing the code that makes your Android application rock. -Of course, we'll discuss some of the given code so that it all makes sense.

    - -

    Note that a certain amount of knowledge is assumed for these tutorials. If you haven't -completed the Hello, World tutorial, -please do so—it will teach you many things you should know about basic -Android development and Eclipse features. More specifically, you should know:

    - -

    Please, also notice that, in order to make these tutorials simple, some may -not convey the better Android coding practices. In particular, many of them -use hard-coded strings in the layout files—the better practice is to reference strings from -your strings.xml file.

    -

    With this knowledge, you're ready to begin, so take your pick.

    - -
    - - - - - - - - - -
    -Spinner
    - -
    - - -
    -ListView
    - -
    -
    -GridView
    - -
    - -
    -Gallery
    - -
    - -
    -TabWidget
    - -
    - -
    -MapView
    - -
    - -
    -WebView
    - -
    - - - -

    -There are plenty more Views and widgets available. See the {@link android.view.View} class -for more on View layouts, and the {@link android.widget widget package} -for more useful widgets. And for more raw code samples, visit the -Api Demos. -These can also be found offline, in /<sdk>/samples/ApiDemos.

    -
    - diff --git a/docs/html/images/activity_lifecycle.png b/docs/html/images/activity_lifecycle.png deleted file mode 100644 index aafe493..0000000 Binary files a/docs/html/images/activity_lifecycle.png and /dev/null differ diff --git a/docs/html/images/android_adc.gif b/docs/html/images/android_adc.gif deleted file mode 100644 index 469a73a..0000000 Binary files a/docs/html/images/android_adc.gif and /dev/null differ diff --git a/docs/html/images/android_icon_125.png b/docs/html/images/android_icon_125.png deleted file mode 100644 index f526193..0000000 Binary files a/docs/html/images/android_icon_125.png and /dev/null differ diff --git a/docs/html/images/anr.png b/docs/html/images/anr.png deleted file mode 100644 index f6e16ef..0000000 Binary files a/docs/html/images/anr.png and /dev/null differ diff --git a/docs/html/images/binder_rpc.png b/docs/html/images/binder_rpc.png deleted file mode 100644 index 1021109..0000000 Binary files a/docs/html/images/binder_rpc.png and /dev/null differ diff --git a/docs/html/images/content_uri.png b/docs/html/images/content_uri.png deleted file mode 100644 index 1fb6d09..0000000 Binary files a/docs/html/images/content_uri.png and /dev/null differ diff --git a/docs/html/images/designing_ui_layout_example.png b/docs/html/images/designing_ui_layout_example.png deleted file mode 100644 index 7d90b31..0000000 Binary files a/docs/html/images/designing_ui_layout_example.png and /dev/null differ diff --git a/docs/html/images/designing_ui_relative_layout.png b/docs/html/images/designing_ui_relative_layout.png deleted file mode 100644 index 8e373a5..0000000 Binary files a/docs/html/images/designing_ui_relative_layout.png and /dev/null differ diff --git a/docs/html/images/draw9patch-bad.png b/docs/html/images/draw9patch-bad.png deleted file mode 100644 index 186d9ce9..0000000 Binary files a/docs/html/images/draw9patch-bad.png and /dev/null differ diff --git a/docs/html/images/draw9patch-norm.png b/docs/html/images/draw9patch-norm.png deleted file mode 100644 index 0cba944..0000000 Binary files a/docs/html/images/draw9patch-norm.png and /dev/null differ diff --git a/docs/html/images/e-mini-hvga-l.png b/docs/html/images/e-mini-hvga-l.png deleted file mode 100644 index f68853f..0000000 Binary files a/docs/html/images/e-mini-hvga-l.png and /dev/null differ diff --git a/docs/html/images/e-mini-hvga-p.png b/docs/html/images/e-mini-hvga-p.png deleted file mode 100644 index 3cf0db9..0000000 Binary files a/docs/html/images/e-mini-hvga-p.png and /dev/null differ diff --git a/docs/html/images/e-mini-qvga-l.png b/docs/html/images/e-mini-qvga-l.png deleted file mode 100644 index 3138b9f..0000000 Binary files a/docs/html/images/e-mini-qvga-l.png and /dev/null differ diff --git a/docs/html/images/e-mini-qvga-p.png b/docs/html/images/e-mini-qvga-p.png deleted file mode 100644 index 54f2cc1..0000000 Binary files a/docs/html/images/e-mini-qvga-p.png and /dev/null differ diff --git a/docs/html/images/emulator-hvga-p.png b/docs/html/images/emulator-hvga-p.png deleted file mode 100644 index f3b8900..0000000 Binary files a/docs/html/images/emulator-hvga-p.png and /dev/null differ diff --git a/docs/html/images/emulator.png b/docs/html/images/emulator.png deleted file mode 100644 index 9c6860a..0000000 Binary files a/docs/html/images/emulator.png and /dev/null differ diff --git a/docs/html/images/gradient_drawable.png b/docs/html/images/gradient_drawable.png deleted file mode 100644 index 4ea846a..0000000 Binary files a/docs/html/images/gradient_drawable.png and /dev/null differ diff --git a/docs/html/images/hello_world_0.png b/docs/html/images/hello_world_0.png deleted file mode 100644 index c174fba..0000000 Binary files a/docs/html/images/hello_world_0.png and /dev/null differ diff --git a/docs/html/images/hello_world_1.png b/docs/html/images/hello_world_1.png deleted file mode 100644 index f08438a..0000000 Binary files a/docs/html/images/hello_world_1.png and /dev/null differ diff --git a/docs/html/images/hello_world_2.png b/docs/html/images/hello_world_2.png deleted file mode 100644 index 58f5703..0000000 Binary files a/docs/html/images/hello_world_2.png and /dev/null differ diff --git a/docs/html/images/hello_world_3.png b/docs/html/images/hello_world_3.png deleted file mode 100644 index d2d2ff6..0000000 Binary files a/docs/html/images/hello_world_3.png and /dev/null differ diff --git a/docs/html/images/hello_world_4.png b/docs/html/images/hello_world_4.png deleted file mode 100644 index 5c41e80..0000000 Binary files a/docs/html/images/hello_world_4.png and /dev/null differ diff --git a/docs/html/images/hello_world_5.png b/docs/html/images/hello_world_5.png deleted file mode 100644 index 96b830a..0000000 Binary files a/docs/html/images/hello_world_5.png and /dev/null differ diff --git a/docs/html/images/hello_world_8.png b/docs/html/images/hello_world_8.png deleted file mode 100644 index 07db360..0000000 Binary files a/docs/html/images/hello_world_8.png and /dev/null differ diff --git a/docs/html/images/hello_world_9.png b/docs/html/images/hello_world_9.png deleted file mode 100644 index 3cb4436..0000000 Binary files a/docs/html/images/hello_world_9.png and /dev/null differ diff --git a/docs/html/images/hierarchyviewer-layout.png b/docs/html/images/hierarchyviewer-layout.png deleted file mode 100644 index 217f058..0000000 Binary files a/docs/html/images/hierarchyviewer-layout.png and /dev/null differ diff --git a/docs/html/images/hierarchyviewer-pixelperfect.png b/docs/html/images/hierarchyviewer-pixelperfect.png deleted file mode 100644 index bce3673..0000000 Binary files a/docs/html/images/hierarchyviewer-pixelperfect.png and /dev/null differ diff --git a/docs/html/images/icon_barriers.png b/docs/html/images/icon_barriers.png deleted file mode 100644 index 73345ef..0000000 Binary files a/docs/html/images/icon_barriers.png and /dev/null differ diff --git a/docs/html/images/icon_equal.png b/docs/html/images/icon_equal.png deleted file mode 100644 index 5548de1..0000000 Binary files a/docs/html/images/icon_equal.png and /dev/null differ diff --git a/docs/html/images/icon_fast.png b/docs/html/images/icon_fast.png deleted file mode 100644 index 4962db9..0000000 Binary files a/docs/html/images/icon_fast.png and /dev/null differ diff --git a/docs/html/images/icon_open.png b/docs/html/images/icon_open.png deleted file mode 100644 index 0db4e8e..0000000 Binary files a/docs/html/images/icon_open.png and /dev/null differ diff --git a/docs/html/images/layoutparams.png b/docs/html/images/layoutparams.png deleted file mode 100644 index 7473dcc..0000000 Binary files a/docs/html/images/layoutparams.png and /dev/null differ diff --git a/docs/html/images/like_thumb1.png b/docs/html/images/like_thumb1.png deleted file mode 100644 index 098cfaf..0000000 Binary files a/docs/html/images/like_thumb1.png and /dev/null differ diff --git a/docs/html/images/like_thumb2.png b/docs/html/images/like_thumb2.png deleted file mode 100644 index ef9d2d2..0000000 Binary files a/docs/html/images/like_thumb2.png and /dev/null differ diff --git a/docs/html/images/like_thumb3.png b/docs/html/images/like_thumb3.png deleted file mode 100644 index 543f2de..0000000 Binary files a/docs/html/images/like_thumb3.png and /dev/null differ diff --git a/docs/html/images/like_thumb4.png b/docs/html/images/like_thumb4.png deleted file mode 100644 index 1f5e7e4..0000000 Binary files a/docs/html/images/like_thumb4.png and /dev/null differ diff --git a/docs/html/images/linearlayout.png b/docs/html/images/linearlayout.png deleted file mode 100644 index a1feb5c..0000000 Binary files a/docs/html/images/linearlayout.png and /dev/null differ diff --git a/docs/html/images/logo_android.gif b/docs/html/images/logo_android.gif deleted file mode 100644 index 0a84d1b..0000000 Binary files a/docs/html/images/logo_android.gif and /dev/null differ diff --git a/docs/html/images/mediaplayer_state_diagram.gif b/docs/html/images/mediaplayer_state_diagram.gif deleted file mode 100644 index f1dcfb5..0000000 Binary files a/docs/html/images/mediaplayer_state_diagram.gif and /dev/null differ diff --git a/docs/html/images/mediarecorder_state_diagram.gif b/docs/html/images/mediarecorder_state_diagram.gif deleted file mode 100644 index f2a08a7..0000000 Binary files a/docs/html/images/mediarecorder_state_diagram.gif and /dev/null differ diff --git a/docs/html/images/ninepatch_examples.png b/docs/html/images/ninepatch_examples.png deleted file mode 100644 index bd64bfd..0000000 Binary files a/docs/html/images/ninepatch_examples.png and /dev/null differ diff --git a/docs/html/images/ninepatch_raw.png b/docs/html/images/ninepatch_raw.png deleted file mode 100644 index 80d8b69..0000000 Binary files a/docs/html/images/ninepatch_raw.png and /dev/null differ diff --git a/docs/html/images/no_scrollview.png b/docs/html/images/no_scrollview.png deleted file mode 100644 index d1b4ee0..0000000 Binary files a/docs/html/images/no_scrollview.png and /dev/null differ diff --git a/docs/html/images/notepad.png b/docs/html/images/notepad.png deleted file mode 100644 index 01b0f6d..0000000 Binary files a/docs/html/images/notepad.png and /dev/null differ diff --git a/docs/html/images/options_menu.png b/docs/html/images/options_menu.png deleted file mode 100755 index ecb9394..0000000 Binary files a/docs/html/images/options_menu.png and /dev/null differ diff --git a/docs/html/images/padding_margins.png b/docs/html/images/padding_margins.png deleted file mode 100644 index 4b2a576..0000000 Binary files a/docs/html/images/padding_margins.png and /dev/null differ diff --git a/docs/html/images/radio_buttons.png b/docs/html/images/radio_buttons.png deleted file mode 100755 index b755e42..0000000 Binary files a/docs/html/images/radio_buttons.png and /dev/null differ diff --git a/docs/html/images/service_lifecycle.png b/docs/html/images/service_lifecycle.png deleted file mode 100644 index 0748db2..0000000 Binary files a/docs/html/images/service_lifecycle.png and /dev/null differ diff --git a/docs/html/images/setting_width_and_height.png b/docs/html/images/setting_width_and_height.png deleted file mode 100644 index ac9e6b8..0000000 Binary files a/docs/html/images/setting_width_and_height.png and /dev/null differ diff --git a/docs/html/images/system-architecture.jpg b/docs/html/images/system-architecture.jpg deleted file mode 100644 index 8831483..0000000 Binary files a/docs/html/images/system-architecture.jpg and /dev/null differ diff --git a/docs/html/images/table_layout.png b/docs/html/images/table_layout.png deleted file mode 100644 index e7fae2d..0000000 Binary files a/docs/html/images/table_layout.png and /dev/null differ diff --git a/docs/html/images/tracedump.png b/docs/html/images/tracedump.png deleted file mode 100644 index 53036ae..0000000 Binary files a/docs/html/images/tracedump.png and /dev/null differ diff --git a/docs/html/images/traceview_profile.png b/docs/html/images/traceview_profile.png deleted file mode 100644 index fbb4d68..0000000 Binary files a/docs/html/images/traceview_profile.png and /dev/null differ diff --git a/docs/html/images/traceview_timeline.png b/docs/html/images/traceview_timeline.png deleted file mode 100644 index 8ebcaba..0000000 Binary files a/docs/html/images/traceview_timeline.png and /dev/null differ diff --git a/docs/html/images/video_thumb_dan.png b/docs/html/images/video_thumb_dan.png deleted file mode 100644 index 85231d7..0000000 Binary files a/docs/html/images/video_thumb_dan.png and /dev/null differ diff --git a/docs/html/images/video_thumb_mike.png b/docs/html/images/video_thumb_mike.png deleted file mode 100644 index 87daf21..0000000 Binary files a/docs/html/images/video_thumb_mike.png and /dev/null differ diff --git a/docs/html/images/viewgroup.png b/docs/html/images/viewgroup.png deleted file mode 100644 index a4c2518..0000000 Binary files a/docs/html/images/viewgroup.png and /dev/null differ diff --git a/docs/html/images/views_autocomplete.png b/docs/html/images/views_autocomplete.png deleted file mode 100644 index 9e9b69c..0000000 Binary files a/docs/html/images/views_autocomplete.png and /dev/null differ diff --git a/docs/html/images/views_controls_example2.png b/docs/html/images/views_controls_example2.png deleted file mode 100644 index 198d848..0000000 Binary files a/docs/html/images/views_controls_example2.png and /dev/null differ diff --git a/docs/html/images/views_datewidgets_example1_pickdate.png b/docs/html/images/views_datewidgets_example1_pickdate.png deleted file mode 100644 index 581a80f..0000000 Binary files a/docs/html/images/views_datewidgets_example1_pickdate.png and /dev/null differ diff --git a/docs/html/images/views_datewidgets_example1_picktime.png b/docs/html/images/views_datewidgets_example1_picktime.png deleted file mode 100644 index 7d91665..0000000 Binary files a/docs/html/images/views_datewidgets_example1_picktime.png and /dev/null differ diff --git a/docs/html/images/views_gallery_example1.png b/docs/html/images/views_gallery_example1.png deleted file mode 100644 index 103fad8..0000000 Binary files a/docs/html/images/views_gallery_example1.png and /dev/null differ diff --git a/docs/html/images/views_grid_example2.png b/docs/html/images/views_grid_example2.png deleted file mode 100644 index 16590b7..0000000 Binary files a/docs/html/images/views_grid_example2.png and /dev/null differ diff --git a/docs/html/images/views_image_switcher.png b/docs/html/images/views_image_switcher.png deleted file mode 100644 index 601e123..0000000 Binary files a/docs/html/images/views_image_switcher.png and /dev/null differ diff --git a/docs/html/images/views_imagebutton_example1.png b/docs/html/images/views_imagebutton_example1.png deleted file mode 100644 index a6bb81b..0000000 Binary files a/docs/html/images/views_imagebutton_example1.png and /dev/null differ diff --git a/docs/html/images/views_layouts_linearlayout_example1.png b/docs/html/images/views_layouts_linearlayout_example1.png deleted file mode 100644 index 2c201f6..0000000 Binary files a/docs/html/images/views_layouts_linearlayout_example1.png and /dev/null differ diff --git a/docs/html/images/views_layouts_linearlayout_example7.png b/docs/html/images/views_layouts_linearlayout_example7.png deleted file mode 100644 index f8e4770..0000000 Binary files a/docs/html/images/views_layouts_linearlayout_example7.png and /dev/null differ diff --git a/docs/html/images/views_layouts_relativelayout_example2.png b/docs/html/images/views_layouts_relativelayout_example2.png deleted file mode 100644 index 395ecb9..0000000 Binary files a/docs/html/images/views_layouts_relativelayout_example2.png and /dev/null differ diff --git a/docs/html/images/views_layouts_tablelayout_example10.png b/docs/html/images/views_layouts_tablelayout_example10.png deleted file mode 100644 index 2f96fa2..0000000 Binary files a/docs/html/images/views_layouts_tablelayout_example10.png and /dev/null differ diff --git a/docs/html/images/views_layouts_tablelayout_spanning.png b/docs/html/images/views_layouts_tablelayout_spanning.png deleted file mode 100644 index 143ce34..0000000 Binary files a/docs/html/images/views_layouts_tablelayout_spanning.png and /dev/null differ diff --git a/docs/html/images/views_lists_example1.png b/docs/html/images/views_lists_example1.png deleted file mode 100644 index 067d247..0000000 Binary files a/docs/html/images/views_lists_example1.png and /dev/null differ diff --git a/docs/html/images/views_spinner.png b/docs/html/images/views_spinner.png deleted file mode 100644 index 99513a3..0000000 Binary files a/docs/html/images/views_spinner.png and /dev/null differ diff --git a/docs/html/images/zippy_bullet.gif b/docs/html/images/zippy_bullet.gif deleted file mode 100644 index e06601f..0000000 Binary files a/docs/html/images/zippy_bullet.gif and /dev/null differ diff --git a/docs/html/images/zippy_closed.gif b/docs/html/images/zippy_closed.gif deleted file mode 100644 index 7f25fcd..0000000 Binary files a/docs/html/images/zippy_closed.gif and /dev/null differ diff --git a/docs/html/images/zippy_open.gif b/docs/html/images/zippy_open.gif deleted file mode 100644 index e14f0f9..0000000 Binary files a/docs/html/images/zippy_open.gif and /dev/null differ diff --git a/docs/html/index.jd b/docs/html/index.jd deleted file mode 100644 index bd681e2..0000000 --- a/docs/html/index.jd +++ /dev/null @@ -1,157 +0,0 @@ -home=true -@jd:body - - -
    -
    -
    -
    -

    Developer Announcements

    -
    -
    - - Google I/O Developer Conference 2009 -
    -

    Google I/O is a two-day developer event that will take place May 27-28 at Moscone Center, San Francisco.

    -

    Learn more »

    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
     
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Download

    -

    The Android SDK has the tools, sample code, and docs you need to create great apps.

    -

    Learn more »

    -
     
    -

    Publish

    -

    Android Market is an open service that lets you distribute your apps to handsets.

    -

    Learn more »

    -
     
    -

    Contribute

    -

    Android Open Source Project gives you access to the entire platform source.

    -

    Learn more »

    -
     
    -

    Watch

    - -

    More Android videos »

    -
    -
    -
    - - - - - - diff --git a/docs/html/license.jd b/docs/html/license.jd deleted file mode 100644 index 88932b6..0000000 --- a/docs/html/license.jd +++ /dev/null @@ -1,143 +0,0 @@ -page.title=Content License -hide_license_footer=true -@jd:body - -
    -

    Content License

    - -

    For the purposes of licensing, the content of this site is divided -into two categories:

    -
      -
    • Documentation content, found under the "Dev Guide" and "Reference" - tabs, including both static content and content extracted from source - code modules, as well as sample code, and
    • -
    • All other site content
    • -
    - -

    The documentation content on this site is made available to -you as part of the Android Open -Source Project. This documentation, including any code shown in it, -is licensed under the Apache 2.0 -license, the preferred license for all parts of the of the Android -Open Source Project.

    - -

    Apache 2.0 is a commercial and open-source-friendly software -license. The majority of the Android platform and documentation is -licensed under the Apache 2.0 license. While the project strives to -adhere to the preferred license, there may be exceptions, such as for -documentation (code comments) extracted from a source code module that -is licensed under GPLv2 or other license. In those cases, the license -covering the source code module will apply to the documentation -extracted from it.

    - -

    All other content on this site, except the license documents themselves -and as otherwise noted, is licensed under the Creative Commons -Attribution 2.5 license.

    - -

    You may use the content of this site in any way that is consistent -with the specific license that applies to the content, as described -above. For content licensed under Creative Commons Attribution 2.5, we -ask that you give proper attribution.

    - - -

    Terms of Use

    - -

    We are pleased to license the Android documentation and sample code under -terms that encourage you to take, modify, reuse, re-purpose, and remix the -content as you see fit. Except as noted in the Restrictions section below, you -are free to use the documentation content in your own creations. For example, -you could quote the text in a book, cut-and-paste sections to your blog, record -it as an audiobook for the visually impaired, or even translate it.

    - - -

    Restrictions

    - -
      -
    • While the documentation itself is available to you under the Apache 2.0 -license, note that proprietary trademarks and brand features are not -included in that license.
    • - -
    • Google's trademarks and other brand features (including the -ANDROID stylized typeface logo) are not included in the license. -Please see -Guidelines for Third Party Use of Google Brand Features for -information about this usage.
    • - -
    • In some cases, a page may include content, such as an image, that is not -covered by the license. In that case, we will label the content that is not licensed.
    • - -
    • In addition, content linked from a page on this site is not covered -by the license unless specifically noted. For example, pages may link to videos or -slide decks that are not covered.
    • - -
    • The use of sample source code provided in the SDK or shown in this -documentation is subject to the conditions detailed in the SDK Terms and Conditions.
    • -
    - - -

    Attribution

    -

    -Proper attribution is required when you reuse or create modified -versions of content that appears on a page made available under the -terms of the Creative Commons Attribution license. On this site, the -requirement for attribution applies only to the non-documentation -content, as described earlier in this document. The complete -requirements for attribution can be found in section 4b of the - -Creative Commons legal code. -

    -

    - In practice we ask that you provide attribution to the Android Open - Source project to the best of the ability of the medium in which you - are producing the work. There are several typical ways in which this - might apply: -

    -

    Exact Reproductions

    -

    - If your online work exactly reproduces text or images from this - site, in whole or in part, please include a paragraph at the bottom - of your page that reads: -

    -
    - Portions of this page are reproduced from work created and shared by the Android Open Source Project - and used according to terms described in the Creative Commons - 2.5 Attribution License. - -
    -

    - Also, please link back to the original source page so that readers can - refer there for more information. -

    -

    Modified Versions

    -

    - If your online work shows modified text or images based on - the content from this site, please include a paragraph at the bottom of - your page that reads: -

    -
    - Portions of this page are modifications based on work created and shared by the Android Open - Source Project and used according to terms described in the Creative Commons - 2.5 Attribution License. -
    -

    - Again, please link back to the original source page so that readers can - refer there for more information. This is even more important when - the content has been modified. -

    -

    Other Media

    -

    - If you produce non-hypertext works, such as books, audio, or - video, we ask that you make a best effort to include a spoken or - written attribution in the spirit of the messages above. -

    - -
    - - diff --git a/docs/html/maps-api-signup.html b/docs/html/maps-api-signup.html deleted file mode 100644 index a604b2a..0000000 --- a/docs/html/maps-api-signup.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - -Sign Up for the Android Maps API - Android Maps API - Google Code - - - - - - - - - - - -
    - - -
    - - -
    - - -
    - - -
    -

    Android Maps API Key Signup

    - -
    - - -
    - - - -
    -

    Sign Up for the Android Maps API

    - -

    The Android Maps API lets you embed -Google -Maps in your own Android applications. A single Maps API key is -valid for all applications signed by a single certificate. See -this documentation -page for more information about application signing. To get a -Maps API key for your certificate, you will need to provide its the certificate's -fingerprint. This can be obtained using Keytool. For example, on -Linux or Mac OSX, you would examine your debug keystore like this: -

    $ keytool -list -keystore ~/.android/debug.keystore
    -...
    -Certificate fingerprint (MD5): 94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98
    -
    - -

    If you use different keys for signing development builds and -release builds, you will need to obtain a separate Maps API key for -each certificate. Each key will only work in applications signed by -the corresponding certificate.

    - -

    You also need a Google Account -to get a Maps API key, and your API key will be connected to your Google Account.

    -
    -
    - -
    - -
    -
    - - - - - - - - - - - - - -
    I have read and agree with the terms and conditions (printable version)
    - My certificate's MD5 fingerprint: - -
    -
    -
    - - - - -
    -
    - -
    - - - - - diff --git a/docs/html/maps-api-tos.pdf b/docs/html/maps-api-tos.pdf deleted file mode 100644 index 80c2836..0000000 Binary files a/docs/html/maps-api-tos.pdf and /dev/null differ diff --git a/docs/html/offline.jd b/docs/html/offline.jd deleted file mode 100644 index d41459b..0000000 --- a/docs/html/offline.jd +++ /dev/null @@ -1,36 +0,0 @@ -home=true -page.title=Welcome -@jd:body - -
    - -

    Welcome to the Android SDK!

    - - - -

    If you've just downloaded the SDK, then continue with -Installing the Android SDK.

    - -

    If you're upgrading from a previously installed version, then refer to the -Upgrading guide.

    - -

    Once you've completed the SDK installation, you can start learning about -development on the Android framework by reading the Developer's Guide. The SDK package -also includes a wide variety of very helpful code samples.

    - -

    Please note that you are currently viewing a local, offline version of the -Android developer documentation. The offline documentation offers the same -content and features as the online documentation, but since the search -capability is network-based, it will not work while you are offline. -Autocompletion for API packages and classes, also offered from the search box, -is available both online and offline and loads the reference documentation for -the item you select.

    - -

    For the most current, fully searchable documentation, please visit

    - -

    -http://developer.android.com.

    - -
    diff --git a/docs/html/publish/index.jd b/docs/html/publish/index.jd deleted file mode 100644 index 63f2e68..0000000 --- a/docs/html/publish/index.jd +++ /dev/null @@ -1,5 +0,0 @@ -publish=true -page.title=Publish Your Application -@jd:body - -FIXME diff --git a/docs/html/publish/publish_toc.cs b/docs/html/publish/publish_toc.cs deleted file mode 100644 index c6f5c65..0000000 --- a/docs/html/publish/publish_toc.cs +++ /dev/null @@ -1 +0,0 @@ - FIXME diff --git a/docs/html/reference/index.html b/docs/html/reference/index.html deleted file mode 100644 index 8d516b1..0000000 --- a/docs/html/reference/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Redirecting... - - - - - diff --git a/docs/html/reference/reference_toc.cs b/docs/html/reference/reference_toc.cs deleted file mode 100644 index 60e9d5f..0000000 --- a/docs/html/reference/reference_toc.cs +++ /dev/null @@ -1 +0,0 @@ - FIXME diff --git a/docs/html/robots.txt b/docs/html/robots.txt deleted file mode 100644 index a872944..0000000 --- a/docs/html/robots.txt +++ /dev/null @@ -1,6 +0,0 @@ -User-Agent: * -Allow: / -Disallow: /gae_shell/ -Disallow: /assets/ -Disallow: /images/ -Sitemap: http://developer.android.com/sitemap.txt diff --git a/docs/html/samples/index.jd b/docs/html/samples/index.jd deleted file mode 100644 index c5c0b71..0000000 --- a/docs/html/samples/index.jd +++ /dev/null @@ -1,23 +0,0 @@ -page.title=Android SDK -page.onlyfortemplate=codesite -@jd:body -

    Sample Code

    - -

    The Android SDK ships with several sample projects. They are:

    - -
    -
    API Demos
    -
    A demonstration of many of the Android APIs.
    - -
    Lunar Lander
    -
    Your objective: to land on the moon.
    - -
    Note Pad
    -
    A simple note pad application.
    -
    - -

    To run these samples, you should import them into -Eclipse or use -activitycreator.py, as described in the Installing the SDK.

    diff --git a/docs/html/sdk/1.0_r1/index.jd b/docs/html/sdk/1.0_r1/index.jd deleted file mode 100644 index d236844..0000000 --- a/docs/html/sdk/1.0_r1/index.jd +++ /dev/null @@ -1,64 +0,0 @@ -page.title=Android 1.0 SDK, release 1 - -sdk.not_latest_version=true - -sdk.version=1.0_r1 -sdk.date=September 23, 2008 - -sdk.win_download=android-sdk-windows-1.0_r1.zip -sdk.win_bytes=89.7 MB -sdk.win_checksum=d69f4ee93d4010f726c04302662fd999 - -sdk.mac_download=android-sdk-mac_x86-1.0_r1.zip -sdk.mac_bytes=87.5 MB -sdk.mac_checksum=564876ada22872e50c2866806de9fc5c - -sdk.linux_download=android-sdk-linux_x86-1.0_r1.zip -sdk.linux_bytes=87.8 MB -sdk.linux_checksum=2660b4029039b7d714e59827e9a9a11d - - -@jd:body - -

    Included in this SDK

    - -

    This SDK includes some awesome stuff.

    - - -

    System and Software Requirements

    - -

    The following systems and development environments are supported by this SDK.

    - -

    Supported Operating Systems:

    -
      -
    • Windows XP or Vista
    • -
    • Mac OS X 10.4.8 or later (x86 only)
    • -
    • Linux (tested on Linux Ubuntu Dapper Drake)
    • -
    - -

    Supported Development Environments:

    -
      -
    • Eclipse IDE - -
    • -
    • Other development environments or IDEs -
        -
      • JDK 5 or JDK 6 (JRE alone is not sufficient)
      • -
      • Apache Ant 1.6.5 or later for Linux and Mac, 1.7 or later for Windows
      • -
      • Not compatible with Gnu Compiler for Java (gcj)
      • -
      -
    • -
    - -

    Note: If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In -particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.

    \ No newline at end of file diff --git a/docs/html/sdk/1.0_r1/installing.jd b/docs/html/sdk/1.0_r1/installing.jd deleted file mode 100644 index 0f15396..0000000 --- a/docs/html/sdk/1.0_r1/installing.jd +++ /dev/null @@ -1,124 +0,0 @@ -page.title=Installing the SDK -@jd:body - - -

    This page describes how to install the Android SDK and set up your development environment. If you haven't -downloaded the SDK yet, follow the link below.

    - - - -

    Before you begin, be sure that you're development environment meets the SDK -System and Software Requirements.

    - -
    -

    Upgrading?

    -

    If you have already developed applications using an earlier version of the -SDK, please skip this page and read the -Upgrading the SDK document. -

    -
    - - - - -

    Installing the SDK

    - -

    After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named android_sdk_<platform>_<release>_<build>. The directory contains the subdirectories tools/, samples/, and others.

    - -

    Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the Android plugin or using SDK tools.

    - -

    Optionally, you can add the path to the SDK tools directory to your path. As mentioned above, the tools/ directory is located in the SDK directory.

    -
      -
    • On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look - for a line that sets the PATH environment variable and add the - full path to the tools/ directory to it. If you don't - see a line setting the path, you can add one:
    • - -
        export PATH=${PATH}:<your_sdk_dir>/tools
      - -
    • On a Mac, look in your home directory for .bash_profile and - proceed as for Linux. You can create the .bash_profile, if - you haven't already set one up on your machine.
    • - -
    • On Windows, right click on My Computer, and select Properties. - Under the Advanced tab, hit the Environment Variables button, and in the - dialog that comes up, double-click on Path under System Variables. Add the full path to the tools/ directory to the path.
    • -
    - -

    Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.

    - -

    Setting up Eclipse

    -

    If you'll be developing with the Eclipse IDE, follow the following procedure to setup the IDE -to use the Android SDK.

    -

    Basically, you just need to update your Eclipse preferences to point to the Android SDK directory:

    -
      -
    1. Select Window > Preferences... to open the Preferences - panel. (Mac OS X: Eclipse > Preferences)
    2. -
    3. Select Android from the left panel.
    4. -
    5. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    6. -
    7. Click Apply, then OK.
    8. -
    -

    Done! We now recommend that you install the ADT Eclipse plugin, which will provide some much-appreciated assistance in developing Android apps with Eclipse...

    - - -

    Installing the Eclipse Plugin (ADT)

    - -

    If you will be using the Eclipse IDE as your environment for developing Android applications, you can install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier. This plugin is highly recommended for Eclipse users.

    - -

    If you will not be using the Eclipse IDE, you do not need to download or install the ADT plugin.

    - -

    Follow this guide to install the ADT Plugin

    - - -

    Installation Notes

    -

    Ubuntu Linux Notes

    -
      -
    • If you need help installing and configuring Java on your -development machine, you might find these resources helpful: - -
    • -
    • Here are the steps to install Java and Eclipse, prior to installing -the Android SDK and ADT Plugin. -
        -
      1. If you are running a 64-bit distribution on your development -machine, you need to install the ia32-libs package using -apt-get:: -
        apt-get install ia32-libs
      2. -
      3. Next, install Java: -
        apt-get install sun-java6-bin
      4. -
      5. The Ubuntu package manager does not currently offer an Eclipse 3.3 - version for download, so we recommend that you download Eclipse from -eclipse.org (http://www.eclipse.org/ -downloads/). A Java or RCP version of Eclipse is recommended.
      6. -
      7. Follow the steps given in previous sections to install the SDK -and the ADT plugin.
      8. -
      -
    -

    Other Linux Notes

    -
      -
    • If JDK is already installed on your development computer, please -take a moment to make sure that it meets the version requirements listed -at the top of this page. In particular, note that some Linux -distributions may include JDK 1.4 or Gnu Compiler for Java, both of -which are not supported for Android development.
    • -
    - - - - - - - - - - - - - - - - diff --git a/docs/html/sdk/1.0_r1/upgrading.jd b/docs/html/sdk/1.0_r1/upgrading.jd deleted file mode 100644 index 168f1be..0000000 --- a/docs/html/sdk/1.0_r1/upgrading.jd +++ /dev/null @@ -1,151 +0,0 @@ -page.title=Upgrading the SDK -@jd:body - - - - -

    This guide will help you migrate your development environment and applications -to the latest version of the SDK. Use this guide if you've been developing applications -on a previous version of the Android SDK. -

    - -

    To ensure that your applications are compliant with the Android 1.0 system available -on mobile devices, you need to install the new SDK and port your existing Android -applications to the updated API. The sections below guide you through the process.

    - -

    Install the new SDK

    - -

    Download the SDK and unpack it into a safe location.

    - -

    After unpacking the new SDK, you should:

    - -
      -
    • Wipe your emulator data.

      Some data formats have changed since the last - SDK release, so any previously saved data in your emulator must be removed. Open a console/terminal - and navigate to the /tools directory of your SDK. Launch the - emulator with the -wipe-data option.

      -

      Windows: emulator -wipe-data
      - Mac/Linux: ./emulator -wipe-data

      -
    • -
    • Update your PATH variable (Mac/Linux; optional).

      If you had previously setup your - PATH variable to point to the SDK tools directory, then you'll need to update it to - point to the new SDK. E.g., for a .bashrc or .bash_profile file: - export PATH=$PATH:<your_new_sdk_dir>/tools

      -
    • -
    - -

    Update your ADT Eclipse Plugin

    - -

    If you develop on Eclipse and are using the ADT plugin, follow these steps to install the new plugin that accompanies the latest SDK.

    - - - - - - - -
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    -
      -
    1. Select Help > Software Updates > Find and Install....
    2. -
    3. Select Search for updates of the currently installed features and click Finish.
    4. -
    5. If any update for ADT is available, select and install.
    6. -
    7. Restart Eclipse.
    8. -
    -
    -
      -
    1. Select Help > Software Updates...
    2. -
    3. Select the Installed Software tab.
    4. -
    5. Click Update...
    6. -
    7. If an update for ADT is available, select it and click Finish.
    8. -
    9. Restart Eclipse.
    10. -
    -
    - -

    After restart, update your Eclipse preferences to point to the SDK directory:

    -
      -
    1. Select Window > Preferences... to open the Preferences panel. (Mac OSX: Eclipse > Preferences)
    2. -
    3. Select Android from the left panel.
    4. -
    5. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    6. -
    7. Click Apply, then OK.
    8. -
    - -

    Set Up Application Signing

    - -

    All applications must now be signed before you can install them on the emulator. Both -the ADT plugin and the Ant-based build tools support this requirement by signing compiled -.apk files with a debug key. To do so, the build tools use the Keytool utility included -in the JDK to to create a keystore and a key with a known alias and password. For more -information, see Signing Your Applications. - -

    To support signing, you should first make sure that Keytool is available to the SDK build -tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure that -your JAVA_HOME environment variable is set and that it references a suitable JDK. Alternatively, -you can add the JDK version of Keytool to your PATH variable.

    - -

    If you are developing on a version of Linux that originally came with Gnu Compiler for Java, -make sure that the system is using the JDK version of Keytool, rather than the gcj version. -If keytool is already in your PATH, it might be pointing to a symlink at /usr/bin/keytool. -In this case, check the symlink target to make sure that it points to the keytool in the JDK.

    - -

    If you use Ant to build your .apk files (rather than ADT for Eclipse), you must regenerate -your build.xml file. To do that, follow these steps:

    -
      -
    1. In your Android application project directory, locate and delete the current build.xml file.
    2. -
    3. Run activitycreator, directing output to the folder containing your application project. - -
      - exec activitycreator --out <project folder> your.activity.YourActivity
      - -
    4. -
    - -

    Run in this way, activitycreator will not erase or create new Java files (or manifest files), -provided the activity and package already exists. It is important that the package and the activity -are real. The tool creates a new build.xml file, as well as a new directory called "libs" in which -to place 3rd jar files, which are now automatically handled by the Ant script.

    - -

    Migrate your applications

    - -

    After updating your SDK, you will likely encounter breakages in your code, due to -framework and API changes. You'll need to update your code to match changes in the Android APIs.

    - -

    One way to start is to open your project in Eclipse and see where the ADT -identifies errors in your application. From there, you can lookup -respective changes in the -Overview of Changes -and API Diffs Report.

    - -

    If you have additional trouble updating your code, visit the -Android Developers Group -to seek help from other Android developers.

    - -

    If you have modified one of the ApiDemos applications and would like to migrate it -to the new SDK, note that you will need to uninstall the version of ApiDemos that comes -preinstalled in the emulator. For more information, or if you encounter an "reinstallation" -error when running or installing ApiDemos, see the troubleshooting topic -I can't install ApiDemos -apps in my IDE because of a signing error for information about how to solve the problem.

    - diff --git a/docs/html/sdk/1.0_r2/index.jd b/docs/html/sdk/1.0_r2/index.jd deleted file mode 100644 index 6fbca6d..0000000 --- a/docs/html/sdk/1.0_r2/index.jd +++ /dev/null @@ -1,64 +0,0 @@ -page.title=Android 1.0 SDK, release 2 - -sdk.not_latest_version=true - -sdk.version=1.0_r2 -sdk.date=November 2008 - -sdk.win_download=android-sdk-windows-1.0_r2.zip -sdk.win_bytes=98360564 -sdk.win_checksum=a5e1af8ac145946b4a9627516ad4a711 - -sdk.mac_download=android-sdk-mac_x86-1.0_r2.zip -sdk.mac_bytes=93771410 -sdk.mac_checksum=87b99d5e9f59b78363a63200c11498e8 - -sdk.linux_download=android-sdk-linux_x86-1.0_r2.zip -sdk.linux_bytes=94186463 -sdk.linux_checksum=a1f3b6d854596f850f5008856d0f380e - - -@jd:body - -

    Included in this SDK

    - -

    This SDK includes some awesome stuff.

    - - -

    System and Software Requirements

    - -

    The following systems and development environments are supported by this SDK.

    - -

    Supported Operating Systems:

    -
      -
    • Windows XP or Vista
    • -
    • Mac OS X 10.4.8 or later (x86 only)
    • -
    • Linux (tested on Linux Ubuntu Dapper Drake)
    • -
    - -

    Supported Development Environments:

    -
      -
    • Eclipse IDE - -
    • -
    • Other development environments or IDEs -
        -
      • JDK 5 or JDK 6 (JRE alone is not sufficient)
      • -
      • Apache Ant 1.6.5 or later for Linux and Mac, 1.7 or later for Windows
      • -
      • Not compatible with Gnu Compiler for Java (gcj)
      • -
      -
    • -
    - -

    Note: If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In -particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.

    \ No newline at end of file diff --git a/docs/html/sdk/1.0_r2/installing.jd b/docs/html/sdk/1.0_r2/installing.jd deleted file mode 100644 index 0f15396..0000000 --- a/docs/html/sdk/1.0_r2/installing.jd +++ /dev/null @@ -1,124 +0,0 @@ -page.title=Installing the SDK -@jd:body - - -

    This page describes how to install the Android SDK and set up your development environment. If you haven't -downloaded the SDK yet, follow the link below.

    - - - -

    Before you begin, be sure that you're development environment meets the SDK -System and Software Requirements.

    - -
    -

    Upgrading?

    -

    If you have already developed applications using an earlier version of the -SDK, please skip this page and read the -Upgrading the SDK document. -

    -
    - - - - -

    Installing the SDK

    - -

    After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named android_sdk_<platform>_<release>_<build>. The directory contains the subdirectories tools/, samples/, and others.

    - -

    Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the Android plugin or using SDK tools.

    - -

    Optionally, you can add the path to the SDK tools directory to your path. As mentioned above, the tools/ directory is located in the SDK directory.

    -
      -
    • On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look - for a line that sets the PATH environment variable and add the - full path to the tools/ directory to it. If you don't - see a line setting the path, you can add one:
    • - -
        export PATH=${PATH}:<your_sdk_dir>/tools
      - -
    • On a Mac, look in your home directory for .bash_profile and - proceed as for Linux. You can create the .bash_profile, if - you haven't already set one up on your machine.
    • - -
    • On Windows, right click on My Computer, and select Properties. - Under the Advanced tab, hit the Environment Variables button, and in the - dialog that comes up, double-click on Path under System Variables. Add the full path to the tools/ directory to the path.
    • -
    - -

    Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.

    - -

    Setting up Eclipse

    -

    If you'll be developing with the Eclipse IDE, follow the following procedure to setup the IDE -to use the Android SDK.

    -

    Basically, you just need to update your Eclipse preferences to point to the Android SDK directory:

    -
      -
    1. Select Window > Preferences... to open the Preferences - panel. (Mac OS X: Eclipse > Preferences)
    2. -
    3. Select Android from the left panel.
    4. -
    5. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    6. -
    7. Click Apply, then OK.
    8. -
    -

    Done! We now recommend that you install the ADT Eclipse plugin, which will provide some much-appreciated assistance in developing Android apps with Eclipse...

    - - -

    Installing the Eclipse Plugin (ADT)

    - -

    If you will be using the Eclipse IDE as your environment for developing Android applications, you can install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier. This plugin is highly recommended for Eclipse users.

    - -

    If you will not be using the Eclipse IDE, you do not need to download or install the ADT plugin.

    - -

    Follow this guide to install the ADT Plugin

    - - -

    Installation Notes

    -

    Ubuntu Linux Notes

    -
      -
    • If you need help installing and configuring Java on your -development machine, you might find these resources helpful: - -
    • -
    • Here are the steps to install Java and Eclipse, prior to installing -the Android SDK and ADT Plugin. -
        -
      1. If you are running a 64-bit distribution on your development -machine, you need to install the ia32-libs package using -apt-get:: -
        apt-get install ia32-libs
      2. -
      3. Next, install Java: -
        apt-get install sun-java6-bin
      4. -
      5. The Ubuntu package manager does not currently offer an Eclipse 3.3 - version for download, so we recommend that you download Eclipse from -eclipse.org (http://www.eclipse.org/ -downloads/). A Java or RCP version of Eclipse is recommended.
      6. -
      7. Follow the steps given in previous sections to install the SDK -and the ADT plugin.
      8. -
      -
    -

    Other Linux Notes

    -
      -
    • If JDK is already installed on your development computer, please -take a moment to make sure that it meets the version requirements listed -at the top of this page. In particular, note that some Linux -distributions may include JDK 1.4 or Gnu Compiler for Java, both of -which are not supported for Android development.
    • -
    - - - - - - - - - - - - - - - - diff --git a/docs/html/sdk/1.0_r2/upgrading.jd b/docs/html/sdk/1.0_r2/upgrading.jd deleted file mode 100644 index 168f1be..0000000 --- a/docs/html/sdk/1.0_r2/upgrading.jd +++ /dev/null @@ -1,151 +0,0 @@ -page.title=Upgrading the SDK -@jd:body - - - - -

    This guide will help you migrate your development environment and applications -to the latest version of the SDK. Use this guide if you've been developing applications -on a previous version of the Android SDK. -

    - -

    To ensure that your applications are compliant with the Android 1.0 system available -on mobile devices, you need to install the new SDK and port your existing Android -applications to the updated API. The sections below guide you through the process.

    - -

    Install the new SDK

    - -

    Download the SDK and unpack it into a safe location.

    - -

    After unpacking the new SDK, you should:

    - -
      -
    • Wipe your emulator data.

      Some data formats have changed since the last - SDK release, so any previously saved data in your emulator must be removed. Open a console/terminal - and navigate to the /tools directory of your SDK. Launch the - emulator with the -wipe-data option.

      -

      Windows: emulator -wipe-data
      - Mac/Linux: ./emulator -wipe-data

      -
    • -
    • Update your PATH variable (Mac/Linux; optional).

      If you had previously setup your - PATH variable to point to the SDK tools directory, then you'll need to update it to - point to the new SDK. E.g., for a .bashrc or .bash_profile file: - export PATH=$PATH:<your_new_sdk_dir>/tools

      -
    • -
    - -

    Update your ADT Eclipse Plugin

    - -

    If you develop on Eclipse and are using the ADT plugin, follow these steps to install the new plugin that accompanies the latest SDK.

    - - - - - - - -
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    -
      -
    1. Select Help > Software Updates > Find and Install....
    2. -
    3. Select Search for updates of the currently installed features and click Finish.
    4. -
    5. If any update for ADT is available, select and install.
    6. -
    7. Restart Eclipse.
    8. -
    -
    -
      -
    1. Select Help > Software Updates...
    2. -
    3. Select the Installed Software tab.
    4. -
    5. Click Update...
    6. -
    7. If an update for ADT is available, select it and click Finish.
    8. -
    9. Restart Eclipse.
    10. -
    -
    - -

    After restart, update your Eclipse preferences to point to the SDK directory:

    -
      -
    1. Select Window > Preferences... to open the Preferences panel. (Mac OSX: Eclipse > Preferences)
    2. -
    3. Select Android from the left panel.
    4. -
    5. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    6. -
    7. Click Apply, then OK.
    8. -
    - -

    Set Up Application Signing

    - -

    All applications must now be signed before you can install them on the emulator. Both -the ADT plugin and the Ant-based build tools support this requirement by signing compiled -.apk files with a debug key. To do so, the build tools use the Keytool utility included -in the JDK to to create a keystore and a key with a known alias and password. For more -information, see Signing Your Applications. - -

    To support signing, you should first make sure that Keytool is available to the SDK build -tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure that -your JAVA_HOME environment variable is set and that it references a suitable JDK. Alternatively, -you can add the JDK version of Keytool to your PATH variable.

    - -

    If you are developing on a version of Linux that originally came with Gnu Compiler for Java, -make sure that the system is using the JDK version of Keytool, rather than the gcj version. -If keytool is already in your PATH, it might be pointing to a symlink at /usr/bin/keytool. -In this case, check the symlink target to make sure that it points to the keytool in the JDK.

    - -

    If you use Ant to build your .apk files (rather than ADT for Eclipse), you must regenerate -your build.xml file. To do that, follow these steps:

    -
      -
    1. In your Android application project directory, locate and delete the current build.xml file.
    2. -
    3. Run activitycreator, directing output to the folder containing your application project. - -
      - exec activitycreator --out <project folder> your.activity.YourActivity
      - -
    4. -
    - -

    Run in this way, activitycreator will not erase or create new Java files (or manifest files), -provided the activity and package already exists. It is important that the package and the activity -are real. The tool creates a new build.xml file, as well as a new directory called "libs" in which -to place 3rd jar files, which are now automatically handled by the Ant script.

    - -

    Migrate your applications

    - -

    After updating your SDK, you will likely encounter breakages in your code, due to -framework and API changes. You'll need to update your code to match changes in the Android APIs.

    - -

    One way to start is to open your project in Eclipse and see where the ADT -identifies errors in your application. From there, you can lookup -respective changes in the -Overview of Changes -and API Diffs Report.

    - -

    If you have additional trouble updating your code, visit the -Android Developers Group -to seek help from other Android developers.

    - -

    If you have modified one of the ApiDemos applications and would like to migrate it -to the new SDK, note that you will need to uninstall the version of ApiDemos that comes -preinstalled in the emulator. For more information, or if you encounter an "reinstallation" -error when running or installing ApiDemos, see the troubleshooting topic -I can't install ApiDemos -apps in my IDE because of a signing error for information about how to solve the problem.

    - diff --git a/docs/html/sdk/1.1_r1/index.jd b/docs/html/sdk/1.1_r1/index.jd deleted file mode 100644 index 7e70b6b..0000000 --- a/docs/html/sdk/1.1_r1/index.jd +++ /dev/null @@ -1,62 +0,0 @@ -page.title=Android 1.1 SDK, Release 1 - -sdk.version=1.1_r1 -sdk.date=February 2009 - -sdk.win_download=android-sdk-windows-1.1_r1.zip -sdk.win_bytes=84533935 -sdk.win_checksum=4cec82e3d2c1658d73182e543d130a06 - -sdk.mac_download=android-sdk-mac_x86-1.1_r1.zip -sdk.mac_bytes=78918508 -sdk.mac_checksum=d67fb5f0eaf4f5a83dc985f5790940c6 - -sdk.linux_download=android-sdk-linux_x86-1.1_r1.zip -sdk.linux_bytes=79219171 -sdk.linux_checksum=df88091c9f0ef6cc56cd92afcdad8d56 - - -@jd:body - -

    SDK Contents

    - -

    Development tools

    - -

    The SDK includes a variety of tools for developing and debugging application code and designing an application UI. You can read about the tools in the -Dev Guide and access them in the <sdk>/tools/ directory. - -

    The tools package included in this SDK is the same as that included in the Android 1.0, Release 2 SDK.

    - -

    System Images

    - -

    The Android system images listed below are included in this SDK. For more information about a system image — features, applications included, localizations, API changes, and so on — see its Version Notes.

    - - - - - - - - - - - - - - -
    System ImageAPI LevelNotesDescription
    Android 1.12Version NotesIncludes com.google.android.maps external library and a set of standard development applications.
    - -

    Sample Code and Applications

    - -

    You can look at a variety of tutorials and samples in the Dev Guide and access the sample code itself -in the <sdk>/samples/ directory of the SDK package.

    - -

    Documentation

    - -

    The SDK package includes a full set of local documentation. To view it, open the <sdk>/documentation.html file in a web browser. If you are developing in an IDE such as Eclipse, you can also view the reference documentation directly in the IDE.

    - -

    The most current documentation is always available on the Android Developers site:

    - -

    http://developer.android.com/

    - - diff --git a/docs/html/sdk/1.1_r1/installing.jd b/docs/html/sdk/1.1_r1/installing.jd deleted file mode 100644 index b198800..0000000 --- a/docs/html/sdk/1.1_r1/installing.jd +++ /dev/null @@ -1,223 +0,0 @@ -page.title=Installing the Android SDK -sdk.version=1.1_r1 - -@jd:body - - -

    This page describes how to install the Android 1.1 SDK, Release 1, and set up your development environment. -If you haven't downloaded the SDK yet, you can so from the Download page.

    - -

    Before you begin, be sure that your development environment meets the SDK -System Requirements. If you encounter any problems during installation, -see the Installation Notes at the bottom of this page.

    - -

    Upgrading?

    -

    If you have already developed applications using an earlier version of the -SDK, please skip this page and read the -Upgrading the SDK document instead. -

    - - - -

    Installing the SDK

    - -

    After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named android_sdk_<platform>_<release>_<build>. The directory contains a link to a local copy of the documentation and the subdirectories tools/, samples/, and others.

    - -

    Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the Android plugin or using SDK tools.

    - -

    Optionally, you can add the path to the SDK tools directory to your path. As mentioned above, the tools/ directory is located in the SDK directory.

    -
      -
    • On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look - for a line that sets the PATH environment variable and add the - full path to the tools/ directory to it. If you don't - see a line setting the path, you can add one:
    • - -
        export PATH=${PATH}:<your_sdk_dir>/tools
      - -
    • On a Mac, look in your home directory for .bash_profile and - proceed as for Linux. You can create the .bash_profile, if - you haven't already set one up on your machine.
    • - -
    • On Windows, right click on My Computer, and select Properties. - Under the Advanced tab, hit the Environment Variables button, and in the - dialog that comes up, double-click on Path under System Variables. Add the full path to the tools/ directory to the path.
    • -
    - -

    Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.

    - - -

    If you will be using the Eclipse IDE as your environment for developing Android applications, continue reading the next -section in order to install the Android Development Tools plugin and setup Eclipse. If you choose not to use Eclipse, you can -develop Android applications using other tools — read the guide to developing -In other IDEs.

    - - -

    Setting up Eclipse

    - -

    First, you should install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier. Developing in ADT/Eclipse is highly recommended for Eclipse users and those new to Android.

    - -

    To download and install the ADT plugin, follow the steps below for your respective Eclipse version.

    - - - - - - - -
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    -
      -
    1. Start Eclipse, then select Help > Software Updates > Find - and Install....
    2. - -
    3. In the dialog that appears, select Search for new features to install and click Next.
    4. -
    5. Click New Remote Site.
    6. -
    7. In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL: -
      https://dl-ssl.google.com/android/eclipse/
      -

      Alternatively, you can use http in the Location URL, if you are having - trouble with https (https is preferred for security reasons).

      -
      http://dl-ssl.google.com/android/eclipse/
      -

      Click OK.

    8. -
    9. You should now see the new site added to the search list (and checked). - Click Finish.
    10. -
    11. In the subsequent Search Results dialog box, select the checkbox for - Android Plugin > Developer Tools. - This will check both features: "Android Developer Tools", and "Android - Editors". The Android Editors feature is optional, but recommended. If - you choose to install it, you need the WST plugin mentioned earlier in this - page. Click Next.
    12. -
    13. Read the license agreement and then select Accept terms of the license agreement. - Click Next.
    14. -
    15. Click Finish.
    16. - -
    17. The ADT plugin is not signed; you can accept the installation anyway - by clicking Install All.
    18. -
    19. Restart Eclipse.
    20. -
    - -
    - -
      -
    1. Start Eclipse, then select Help > Software Updates.... -
    2. -
    3. In the dialog that appears, click the Available Software tab. -
    4. -
    5. Click Add Site... -
    6. -
    7. Enter this as the Location: -
      https://dl-ssl.google.com/android/eclipse/
      -

      Alternatively, you can use http in the Location URL, if you are having - trouble with https (https is preferred for security reasons).

      -
      http://dl-ssl.google.com/android/eclipse/
      -

      Click OK.

    8. -
    9. Back in the Available Software view, you should see the plugin. Select the checkbox next to - Developer Tools and click Install... -
    10. -
    11. On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked. - The Android Editors feature is optional, but recommended. If - you choose to install it, you need the WST plugin mentioned earlier in this - page. Click Next. -
    12. -
    13. Accept the license agreement and click Finish.
    14. -
    15. Restart Eclipse.
    16. -
    - -
    - - -

    Now, you just need to modify your Eclipse preferences to point to the Android SDK directory:

    -
      -
    1. Select Window > Preferences... to open the Preferences - panel. (Mac OS X: Eclipse > Preferences)
    2. -
    3. Select Android from the left panel.
    4. -
    5. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    6. -
    7. Click Apply, then OK.
    8. -
    - -

    Done! If you haven't encountered any problems, then you're ready to begin developing Android applications. -We recommend you begin with the Hello World tutorial, -which will teach you some basics about Android applications and how to create projects using Eclipse.

    - - -

    Troubleshooting ADT Installation

    -

    -If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

    - -
      -
    • If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to: -
      http://dl-ssl.google.com/android/eclipse/
    • -
    • If you are behind a firewall (such as a corporate firewall), make - sure that you have properly configured your proxy settings in Eclipse. - In Eclipse 3.3/3.4, you can configure proxy information from the main - Eclipse menu in Window (on Mac, Eclipse) > Preferences > General > Network Connections.
    • -
    -

    -If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT files to your local machine using a browser and the install the files in Eclipse from there: -

    -
      -
    1. Download the ADT zip file (do not unpack it). -
    2. Follow steps 1 and 2 in the default install instructions (above). -
    3. In Eclipse 3.3, click New Archive Site....
      - In Eclipse 3.4, click Add Site..., then Archive... -
    4. Browse and select the downloaded the zip file. -
    5. Follow the remaining procedures, above, starting from steps 5. -
    -

    -Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.

    - -

    Note that the "Android Editors" feature of ADT requires several optional -Eclipse components (for example, WST). If you encounter an error when -installing ADT, your Eclipse installion might not include those components. -For information about how to quickly add the necessary components to your -Eclipse installation, see the troubleshooting topic -ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".

    - -

    For Linux users

    -

    If you encounter this error when installing the ADT Plugin for Eclipse: -

    -An error occurred during provisioning.
    -Cannot connect to keystore.
    -JKS
    -

    -...then your development machine lacks a suitable Java VM. Installing Sun -Java 6 will resolve this issue and you can then reinstall the ADT -Plugin.

    - - -

    Installation Notes

    -

    Ubuntu Linux Notes

    -
      -
    • If you need help installing and configuring Java on your -development machine, you might find these resources helpful: - -
    • -
    • Here are the steps to install Java and Eclipse, prior to installing -the Android SDK and ADT Plugin. -
        -
      1. If you are running a 64-bit distribution on your development -machine, you need to install the ia32-libs package using -apt-get:: -
        apt-get install ia32-libs
      2. -
      3. Next, install Java: -
        apt-get install sun-java6-bin
      4. -
      5. The Ubuntu package manager does not currently offer an Eclipse 3.3 - version for download, so we recommend that you download Eclipse from -eclipse.org (http://www.eclipse.org/ -downloads/). A Java or RCP version of Eclipse is recommended.
      6. -
      7. Follow the steps given in previous sections to install the SDK -and the ADT plugin.
      8. -
      -
    -

    Other Linux Notes

    -
      -
    • If JDK is already installed on your development computer, please -take a moment to make sure that it meets the version requirements listed -at the top of this page. In particular, note that some Linux -distributions may include JDK 1.4 or Gnu Compiler for Java, both of -which are not supported for Android development.
    • -
    - - diff --git a/docs/html/sdk/1.1_r1/requirements.jd b/docs/html/sdk/1.1_r1/requirements.jd deleted file mode 100644 index 95b658b..0000000 --- a/docs/html/sdk/1.1_r1/requirements.jd +++ /dev/null @@ -1,42 +0,0 @@ -page.title=System Requirements - -sdk.version=1.1_r1 -sdk.date=February 2009 - -@jd:body - -

    The sections below describe the system and software requirements for developing Android applications using the Android SDK tools included in Android 1.1 SDK, Release 1.

    - -

    Supported Operating Systems

    -
      -
    • Windows XP (32-bit) or Vista (32- or 64-bit)
    • -
    • Mac OS X 10.4.8 or later (x86 only)
    • -
    • Linux (tested on Linux Ubuntu Dapper Drake)
    • -
    - -

    Supported Development Environments

    -
      -
    • Eclipse IDE - -
    • -
    • Other development environments or IDEs -
        -
      • JDK 5 or JDK 6 (JRE alone is not sufficient)
      • -
      • Apache Ant 1.6.5 or later for Linux and Mac, 1.7 or later for Windows
      • -
      • Not compatible with Gnu Compiler for Java (gcj)
      • -
      -
    • -
    - -

    Note: If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In -particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.

    \ No newline at end of file diff --git a/docs/html/sdk/1.1_r1/upgrading.jd b/docs/html/sdk/1.1_r1/upgrading.jd deleted file mode 100644 index 2ad6757..0000000 --- a/docs/html/sdk/1.1_r1/upgrading.jd +++ /dev/null @@ -1,150 +0,0 @@ -page.title=Upgrading the SDK -sdk.version=1.1_r1 -@jd:body - - - -

    This document describes how to move your development environment and existing -Android applications from an Android 1.0 SDK to the Android 1.1, Release 1 SDK. -If you are migrating applications from an earlier SDK, please read the upgrading -document available in the Android 1.0 SDK package. -

    - -

    To ensure that your applications are compliant with the Android 1.1 system available -on mobile devices, you need to install the Android 1.1 SDK and port your existing Android -applications to it. The sections below will guide you through the process.

    - -

    Installing the Latest SDK

    - -

    Download the SDK and unpack it into a safe location.

    - -

    After unpacking the new SDK and saving it an appropriate location, you should:

    - -
      -
    • Wipe your emulator data.

      Some data formats have changed since the last - SDK release, so any previously saved data in your emulator must be removed. Open a console/terminal - and navigate to the /tools directory of your new SDK. Launch the - emulator with the -wipe-data option. -

      Windows: emulator -wipe-data
      - Mac/Linux: ./emulator -wipe-data

      -
    • -
    • Update your PATH variable (Mac/Linux; optional).

      If you had previously setup your - PATH variable to point to the SDK tools directory, then you'll need to update it to - point to the new SDK. For example, for a .bashrc or .bash_profile file: - export PATH=$PATH:<your_new_sdk_dir>/tools

      -
    • -
    • If (and only if) you are developing using Ant, you will also need to modify - your build.xml properties to point to the new SDK. -

      Open the default.properties file associated with your build.xml - file (typically located in the same directory). In the default.properties - file, update the sdk-folder property with the full path to - the new SDK directory.

    • -
    - - -

    Update your ADT Eclipse Plugin

    - -

    If you develop on Eclipse and are migrating from an Android 1.0 -SDK, no update of the ADT plugin is needed — skip to Update your Eclipse SDK Preferences.

    - -

    If you are migrating from an earlier version of the SDK, you will -need to update the ADT plugin.

    You may also want to upgrade your -ADT plugin when a new version becomes available for your existing version -of the SDK.

    - -

    The steps below describe how to update the ADT plugin to the latest -version available.

    - - - - - - - -
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    -
      -
    1. Select Help > Software Updates > Find and Install....
    2. -
    3. Select Search for updates of the currently installed features and click Finish.
    4. -
    5. If any update for ADT is available, select and install.
    6. -
    7. Restart Eclipse.
    8. -
    -

    Alternatively,

    -
      -
    1. Select Help > Software Updates > Manage Configuration.
    2. - -
    3. Navigate down the tree and select Android Development Tools <version>
    4. -
    5. Select Scan for Updates under Available Tasks.
    6. -
    -
    -
      -
    1. Select Help > Software Updates...
    2. -
    3. Select the Installed Software tab.
    4. -
    5. Click Update...
    6. -
    7. If an update for ADT is available, select it and click Finish.
    8. -
    9. Restart Eclipse.
    10. -
    -
    - -

    Update your Eclipse SDK Preferences

    - -

    The last step is to update your Eclipse preferences to point to the new SDK directory:

    -
      -
    1. Select Window > Preferences... to open the Preferences panel. (Mac OSX: Eclipse > Preferences)
    2. -
    3. Select Android from the left panel.
    4. -
    5. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    6. -
    7. Click Apply, then OK.
    8. -
    - -

    Migrate Your Applications, if Necessary

    - -

    If (and only if) you have written apps in an SDK released previous to -the Android 1.0 SDK, you will need to migrate your applications. After -installing the new SDK and updating the ADT Plugin (if applicable), you -may encounter breakages in your application code, due to -framework and API changes. You'll need to update your code to match the -latest APIs.

    - -

    One way to start is to open your project in Eclipse and see where the ADT -identifies errors in your application. From there, you can lookup -specific API changes in the Android 1.0 APIs in the - -Overview of Changes and -API Diffs Report.

    - -

    If you have additional trouble updating your code, visit the -Android Developers Group -to seek help from other Android developers.

    - -

    If you have modified one of the ApiDemos applications and would like to migrate it -to the new SDK, note that you will need to uninstall the version of ApiDemos that comes -preinstalled in the emulator. For more information, or if you encounter an "reinstallation" -error when running or installing ApiDemos, see the troubleshooting topic -I can't install ApiDemos -apps in my IDE because of a signing error for information about how to solve the problem.

    - diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd deleted file mode 100644 index bad71a2..0000000 --- a/docs/html/sdk/RELEASENOTES.jd +++ /dev/null @@ -1,327 +0,0 @@ -page.title=SDK Release Notes -@jd:body - -

    This document provides version-specific information about Android SDK releases. For the latest known issues, please ensure that you're viewing this page at: http://developer.android.com/sdk/RELEASENOTES.html.

    - -

    Android 1.1 SDK, Release 1

    - -

    This SDK provides the development tools and Android system image you need to create applications for Android-powered devices. Applications developed on this SDK will be compatible with mobile devices running the Android 1.1 platform.

    - -

    This release provides an updated system image (Android 1.1), updated documentation, and the same set of development tools provided in the Android 1.0 r2 SDK. The updated system image includes bug fixes and some smaller features, as well as a few minor API changes from the 1.0 version.

    - -

    For details about the Android 1.1 system image included in the SDK — including bug fixes, features, and API changes — please read the Android 1.1 Version Notes.

    - -

    App Versioning for Android 1.1

    - -

    If you are using this SDK to build an application that is compatible only with Android-powered devices running the Android 1.1 platform, please note that you must set the the android:minSdkVersion attribute in the application's manifest to the API Level of Android 1.1 — "2".

    - -

    Specifically, you specify the android:minSdkVersion attribute in a <uses-sdk> element as a child of <manifest> in the manifest file. When set, the attribute looks like this:

    - -
    <manifest>
    -  ...
    -  <uses-sdk minSdkVersion="2" />
    -  ...
    -</manifest>
    -
    - -

    By setting android:minSdkVersion in this way, you ensure that users will only be able to install your application if their devices are running the Android 1.1 platform. In turn, this ensures that your application will function properly on their devices, especially if it uses APIs introduced in Android 1.1.

    - -

    If your application uses APIs introduced in Android 1.1 but does not declare <uses-sdk minSdkVersion="2" />, then it will run properly on Android 1.1 devices but not on Android 1.0 devices.

    - -

    If your application does not use any new APIs introduced in Android 1.1, you can indicate Android 1.0 compatibility by removing minSdkVersion or setting the attribute to "1". However, before publishing your application, you must make sure to compile your application against the Android 1.0 system image (available in the Android 1.0 SDK), to ensure that it builds and functions properly for Android 1.0 devices. You should test the application against system images corresponding to the API Levels that the application is designed to be compatible with.

    - -

    If you are sure your application is not using Android 1.1 APIs and has no need to use them, you might find it easier to keep working in the Android 1.0 SDK, rather than migrating to the Android 1.1 SDK and having to do additional testing.

    - - -

    ADT Plugin Compatibility

    - -

    For this version of the SDK — Android 1.1 SDK, Release 1 -— the compatible version of the Android Development Tools (ADT) -Plugin for Eclipse is 0.8.0. If you are using a -previous version of ADT, you should update to the latest version for use -with this SDK. For information about how to update your ADT plugin, see -Upgrading -the SDK.

    - -

    Installation and Upgrade Notes

    - -

    If you've been developing an application using an Android 1.0 SDK no -changes to your application are needed. You may want to wipe application -user data (emulator option -wipe-data) when running your -application on the Android 1.1 emulator for the first time.

    - -

    If you're installing the Android SDK for the first time, please see -the instructions in Installing the SDK. - -

    Other Notes

    - -

    MapView API Key

    - -

    com.google.android.maps.MapView is a class that lets you -easily integrate Google Maps into your application. Before you can -access the maps data, you will need to register with the Google Maps -service and receive a Maps API Key, which you then add to your MapView -for authentication to the server.

    - -

    Developers should note that the registration service for MapView is now -active and Google Maps is actively enforcing the Maps API Key requirement. -For information about how to register for a Maps API Key, see - -Obtaining a Maps API Key.

    - -

    USB Drivers for Windows

    - -

    If you using Windows and want to develop or test your application on an -Android-powered device (such as the T-Mobile G1), you need an appropriate USB -driver. For your convenience, the Windows version of the Android SDK includes -these USB drivers that you can install, to let you develop on the device:

    - -
      -
    • USB driver for 32-bit XP and Vista
    • -
    • USB driver for 64-bit Vista only
    • -
    - -

    The USB driver files are located in the -<SDK>/usb_driver directory. For details and -installation instructions, see Setting Up a -Device for Development.

    -

    - -

    Resolved Issues, Changes

    - -

    Emulator

    -
      -
    • Emulator now saves the user image in <android>/SDK1.1/
    • -
    - -

    Known Issues

    - -

    JUnit and Eclipse/ADT

    -
      -
    • If you are developing in Eclipse/ADT and want to add JUnit test -classes, you can do so. However, you need to set up a custom JUnit configuration -before your tests will run properly. For detailed information about how to set -up the JUnit configuration, see the troubleshooting topic Running a Junit test class -in Eclipse.
    • -
    - -

    Other

    - -
      -
    • It is not possible to send MMS messages between emulator instances.
    • -
    • In some cases, you may encounter problems when using the browser on an -emulator started with the command-line option -http-proxy.
    • -
    • On the OSX platform, if you manually remove the ~/.android directory -using rm -rf ~/.android, then try to run -the emulator, it crashes. This happens because the emulator fails to create -a new .android directory before attempting to create the child SDK1.0 directory. -To work around this issue, manually create a new .android directory using -mkdir ~/.android, then run the emulator. The emulator -creates the SDK1.0 directory and starts normally.
    • -
    • We regret to inform developers that Android 1.1 will not include support -for ARCNet network interfaces.
    • -
    • The final set of Intent patterns honored by Android 1.0 has not yet been -fully documented. Documentation will be provided in future releases.
    • -
    • In ADT Editor, you can add at most ten new resource values at a time, -in a given res/values/*.xml, using the form in the Android Resources pane. -If you add more than ten, the Android Resources pane will not display the -attributes fields for the additional resource entries. To work around this -problem, you can close the file in the editor and open it again, or you -can edit the resource entries in the XML text mode.
    • -
    • The emulator's battery-control commands (power <option>) -are not working in this release.
    • -
    - - - - - -

    Android 1.0 SDK, Release 2

    - -

    This SDK release includes the Android 1.0 platform and application API. -Applications developed on this SDK will be compatible with mobile devices -running the Android 1.0 platform.

    - -

    This release includes mainly bug fixes, although some smaller features were -added.

    - -

    ADT Plugin Compatibility

    - -

    For this release of the SDK, the compatible version of the Android -Development Tools (ADT) Plugin for Eclipse is 0.8.0. If you are -using a previous version of ADT, you should update to the latest version for use -with this SDK. For information about how to update your ADT plugin, see Upgrading the SDK.

    - -

    Installation and Upgrade Notes

    - -

    If you're installing the Android SDK for the first time, please see the -instructions in Installing the -SDK. - -

    Other Notes

    - -

    T-Mobile G1 Compatability

    - -

    This version of the SDK has been tested for compatability with the first -Android-powered mobile device, the T-Mobile -G1.

    - -

    MapView API Key

    - -

    MapView is a class that lets you easily integrate Google Maps into your -application. Before you can access the maps data, you will need to register with -the Google Maps service and receive a Maps API Key, which you then add to your -MapView for authentication to the server.

    - -

    Developers should note that the registration service for MapView is now -active and Google Maps is actively enforcing the Maps API Key requirement. For -information about how to register for a Maps API Key, see http://code. -google.com/android/toolbox/apis/mapkey.html.

    - -

    USB Driver for Windows

    -

    If you using Windows and want to develop or test your application on an -Android-powered device (such as the T-Mobile G1), you need an appropriate USB -driver. For your convenience, the Windows version of the Android SDK includes a -USB driver that you can install, to let you develop on the device. The USB -driver files are located in the <SDK>/usb_driver directory. - -

    - -

    Resolved Issues, Changes

    -
      -
    • The android.jar in this SDK release now includes several classes that were -missing from the previous SDK.
    • -
    • The android.R.styleable class and its fields were removed from the public -API, to better ensure forward-compatibility for applications. The constants -declared in android.R.styleable were platform-specific and subject to arbitrary -change across versions, so were not suitable for use by applications. You can -still access the platform's styleable attributes from your resources or code. To -do so, declare a custom resource element using a -<declare-styleable> in your project's res/values/R.attrs -file, then declare the attribute inside. For examples, see -<sdk>/samples/ApiDemos/res/values/attrs.xml. For more information about -custom resources, see Custom -Layout Resources. Note that the android.R.styleable documentation is still -provided in the SDK, but only as a reference of the platform's styleable -attributes for the various elements.
    • -
    • The VM now properly ensures that private classes are not -available to applications through reflection. If you were using reflection -to access private classes in a previous release, you will now get a run-time -error.
    • - -
    • The Settings and Email applications are now included in the SDK and -available in the emulator.
    • -
    • We regret to inform developers that SDK 1.0_r2 does not support MFM, RLL, -or Winchester hard disk drives.
    • -
    • In the emulator, the control key for enabling/disabling trackball mode -is changed from Control-T to F6. You can also enter trackball mode temporarily -using the Delete key. While the key is pressed, you can send trackball events.
    • -
    - -

    Unless otherwise noted, Known Issues from the previous SDK release also apply -to this release.

    - - - - - - -

    Android 1.0 SDK, Release 1

    - -

    This SDK release is the first to include the Android 1.0 platform and application API. Applications developed on this SDK will be compatible with mobile devices running the Android 1.0 platform, when such devices are available.

    - -

    This release includes mainly bug fixes, although some smaller features were added. The Android 1.0 also includes several API changes from the 0.9 version. For more information on API changes, see the Overview of Changes and the API Differences Report. For those porting from the M5 release, the SDK also includes the legacy changes overview and API Differences Reports. See the current Overview of Changes for more information.

    - -

    ADT Plugin Compatibility

    - -

    For this version of the SDK — Android 1.0 SDK, Release 1 — the compatible version of the Android Development Tools (ADT) Plugin for Eclipse is 0.8.0. If you are using a previous version of ADT, you should update to the latest version for use with this SDK. For information about how to update your ADT plugin, see Upgrading the SDK.

    - -

    Installation and Upgrade Notes

    - -

    If you've been developing an application using a previous SDK version and you want the application to run on Android-powered mobile devices, you must port the application to the Android 1.0 SDK. Please see Upgrading the SDK for detailed instructions on how to make the transition to this release. Be sure to wipe application user data (emulator option -wipe-data) when running your application on the Android 1.0 SDK emulator.

    - -

    If you're installing the Android SDK for the first time, please see the instructions in Installing the SDK. - -

    Other Notes

    - -

    MapView API Key

    - -

    MapView is a class that lets you easily integrate Google Maps into your application. Before you can access the maps data, you will need to register with the Google Maps service and receive a Maps API Key, which you then add to your MapView for authentication to the server.

    - -

    Currently, the registration service for MapView is not yet active and Google Maps is not yet enforcing the Maps API Key requirement. However, note that the registration service will be activated soon, so that MapViews in any application deployed to a mobile device will require registration and a valid Maps API Key.

    - -

    As soon as the registration service becomes available, we will update the page at http://code.google.com/android/toolbox/apis/mapkey.html with details about how and where to register. Please check that page periodically for registration information, if you are using a MapView.

    - - -

    Resolved Issues, Changes

    - -

    Emulator

    -
      -
    • Emulator now saves the user image in <android>/SDK1.0/
    • -
    • Fixed EsounD-related freezes on Linux.
    • -
    • Fixed the documentation in -help-audio. '-audio list' doesn't work, one - needs to call -help-audio-out and -help-audio-in to get the list of valid - audio backends.
    • -
    • Fixed scrollwheel Dpad emulation in rotated mode. before that, using the - scroll-wheel would always generated Dpad Up/Down events, even when in - landscape mode.
    • - -
    • Several Obsolete command options were removed.
    • -
    • Setting the network speed through the console or the -netspeed option will - properly modify the connectivity icon on the device.
    • -
    • Setting the GSM voice registration state to 'roaming' in the console will - properly modify the voice icon on the device
    • -
    - -

    SQLite

    -
      -
    • SQLite is now included in the SDK package on all platforms.
    • -
    - -

    Known Issues

    - -

    JUnit and Eclipse/ADT

    -
      -
    • If you are developing in Eclipse/ADT and want to add JUnit test -classes, you can do so. However, you need to set up a custom JUnit configuration -before your tests will run properly. For detailed information about how to set -up the JUnit configuration, see the troubleshooting topic Running a Junit test class -in Eclipse.
    • -
    - -

    Other

    - -
      -
    • It is not possible to send MMS messages between emulator instances.
    • -
    • In some cases, you may encounter problems when using the browser on an -emulator started with the command-line option -http-proxy.
    • - -
    • We regret to inform developers that Android 1.0 will not include support for -dot-matrix printers.
    • -
    • On the OSX platform, if you manually remove the ~/.android directory -using rm -rf ~/.android, then try to run -the emulator, it crashes. This happens because the emulator fails to create -a new .android directory before attempting to create the child SDK1.0 directory. -To work around this issue, manually create a new .android directory using -mkdir ~/.android, then run the emulator. The emulator -creates the SDK1.0 directory and starts normally.
    • -
    • The final set of Intent patterns honored by Android 1.0 has not yet been -fully documented. Documentation will be provided in future releases.
    • -
    • In ADT Editor, you can add at most ten new resource values at a time, -in a given res/values/*.xml, using the form in the Android Resources pane. -If you add more than ten, the Android Resources pane will not display the -attributes fields for the additional resource entries. To work around this -problem, you can close the file in the editor and open it again, or you -can edit the resource entries in the XML text mode.
    • -
    • The emulator's battery-control commands (power <option>) -are not working in this release.
    • - -
    - diff --git a/docs/html/sdk/adt_download.jd b/docs/html/sdk/adt_download.jd deleted file mode 100644 index 6e9eec4..0000000 --- a/docs/html/sdk/adt_download.jd +++ /dev/null @@ -1,65 +0,0 @@ -page.title=Download the ADT Plugin Zip File -@jd:body - -

    -If you are unable to download the ADT plugin through setting up a remote -update site in Eclipse, you can download the ADT zip file and install it -from your computer (archived site) instead. -

    -

    -If you go with this method, in order to update the plugin, you will need to -download the latest version from this page, uninstall the old version from -Eclipse, then install the new version. For more details on the procedure, -see Troubleshooting ADT Installation in the - installation -page. -

    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    VersionFileDateCompatible SDK VersionsNotes
    0.8.0ADT-0.8.0.zip23 September 2008Android 1.1 SDK, Release 1
    Android 1.0 SDK, Release 1
    Required for users of Android 1.1 SDK, Release 1 and Android 1.0 SDK, Release 1
    0.7.1ADT-0.7.1.zip18 Aug 2008Android 0.9 SDK betaRequired for users of Android 0.9 SDK beta. As of this version, Eclipse 3.2 is no longer supported. - Please upgrade to Eclipse Ganymede (3.4) or Europa (3.3) if you are still using 3.2.
    0.4.0ADT-0.4.0.zip12 Feb 2008m5-rc14Required if you are using the M5 SDK. See the SDK Release Notes for details on changes and enhancements in this version.
    0.3.3ADT-0.3.3.zip14 Dec 2007m3-rc37Some significant enhancements (see SDK Release Notes).
    0.3.1ADT-0.3.1.zip21 Nov 2007m3-rc20, m3-rc22Initial Release.
    -

    diff --git a/docs/html/sdk/android-1.1.jd b/docs/html/sdk/android-1.1.jd deleted file mode 100644 index f70ad26..0000000 --- a/docs/html/sdk/android-1.1.jd +++ /dev/null @@ -1,249 +0,0 @@ -page.title=Android 1.1 Version Notes -sdk.version=1.1_r1 -sys.date=February 2009 -@jd:body - -

    -Date: February 2009
    -API Level: 2

    - - -

    This document provides version notes for the Android 1.1 system image included in the SDK. - -

    - -

    Overview

    - -

    The Android 1.1 system image delivered in the SDK is the development -counterpart to the Android 1.1 production system image, deployable to -Android-powered handsets starting in February 2009.

    - -

    The Android 1.1 system image delivers an updated version of the framework -API. As with the Android 1.0 API, the Android 1.1 API -is assigned an integer identifier — 2 — that is -stored in the system itself. This identifier, called the "API Level", allows the -system to correctly determine whether an application is compatible with -the system, prior to installing the application.

    - -

    Applications can reference a specific API Level value in their -manifest files, to indicate the minimum version of the Android system -required to run the app. To reference a minimum API Level, applications -can add a minSdkVersion attribute in their manifest files. -The value of the attribute is an integer corresponding to an API Level -identifier. Prior to installing an application, the system then checks the value of -minSdkVersion and allows the install only -if the referenced integer is less than or equal to the API Level integer stored -in the system itself.

    - -

    If you use the Android 1.1 system image to build an application -compatible with Android-powered devices running the Android 1.1 -platform, please note that you must set the the -android:minSdkVersion attribute in the application's -manifest to "2", which is the API strictly associated with Android 1.1. -

    - -

    Specifically, you specify the android:minSdkVersion -attribute in a <uses-sdk> element as a child of -<manifest> in the manifest file. When set, the -attribute looks like this:

    - -
    <manifest>
    -  ...
    -  <uses-sdk minSdkVersion="2" />
    -  ...
    -</manifest>
    -
    - -

    By setting android:minSdkVersion in this way, you ensure -that users will only be able to install your application if their -devices are running the Android 1.1 platform. In turn, this ensures that -your application will function properly on their devices, especially if -it uses APIs introduced in Android 1.1.

    - -

    If your application uses APIs introduced in Android 1.1 but does not -declare <uses-sdk minSdkVersion="2" />, then it will -run properly on Android 1.1 devices but not on Android 1.0 -devices. In the latter case, the application will crash at runtime when -it tries to use the Android 1.1 APIs.

    - -

    If your application does not use any new APIs introduced in Android -1.1, you can indicate Android 1.0 compatibility by removing -minSdkVersion or setting the attribute to "1". However, -before publishing your application, you must make sure to compile your -application against the Android 1.0 system image (available in the -Android 1.0 SDK), to ensure that it builds and functions properly for -Android 1.0 devices. You should test the application against system -images corresponding to the API Levels that the application is designed -to be compatible with.

    - -

    If you are sure your application is not using Android 1.1 APIs and -has no need to use them, you might find it easier to keep working in the -Android 1.0 SDK, rather than migrating to the Android 1.1 SDK and having -to do additional testing.

    - - -

    External Libraries

    - -

    The system image includes these external libraries, which you can -access from your application by adding a -<uses-library>.

    -
      -
    • com.google.android.maps — gives your -application access to Google Maps data. Note that, to use Google Maps -data, a Maps API Key is required.
    • -
    - -

    Device Compatibility

    - -

    The Android 1.1 system image was tested for compatability with the -Android-powered devices listed below:

    - - -

    Built-in Applications

    - -

    The system image includes these built-in applications:

    -
      -
    • Alarm Clock
    • -
    • API Demos
    • -
    • Browser
    • -
    • Calculator
    • -
    • Camera
    • -
    • Contacts
    • -
    • Dev Tools
    • -
    • Dialer
    • -
    • Email
    • -
    • Maps (and StreetView)
    • -
    • Messaging
    • -
    • Music
    • -
    • Pictures
    • -
    • Settings
    • -
    - -

    UI Localizations

    - -

    The system image provides localized UI strings for the languages -listed below.

    -
      -
    • English, US (en_US)
    • -
    • German (de)
    • -
    - -

    Localized UI strings match the locales that are displayable in -the emulator, accessible through the device Settings application.

    - -

    Resolved Issues

    -
      -
    • AlarmClock alert now plays audio/vibe directly, rather than through -AlarmManager. AlarmClock alert starts playing audio/vibe in its -IntentReceiver, rather than on activity start. These changes should -prevent alarms from being blocked by modal dialogs.
    • -
    • Fixes to device sleep.
    • -
    • Single tap no longer opens the in-call dialpad; users now need to -touch and drag it.
    • -
    • Fixes a bug causing approximately 1 in 25 outbound messages to -freeze up the IMAP connection (to a Gmail based server) when transferred -to the Sent folder.
    • -
    • Removes automatic account setup entries that were broken or not -testable. Adds minor fixes to a few of the remaining entries. Makes -improvements to warning dialogs used for a few special cases.
    • -
    • Changes default mail checking interval to every 15 minutes (instead -of defaulting to "never").
    • -
    • Fixes password-quoting bugs in IMAP, so that users can include -special characters in passwords (e.g. spaces).
    • -
    • Fixes various errors in auto and manual account setup
    • -
    • Improves reporting for various connection errors, making it easier -for the user to diagnose failed account setups.
    • -
    • Fixes new-mail notifications for POP3 accounts.
    • -
    • Ensures proper auto-checking of accounts marked as "never -check".
    • -
    • Now displays date and time using user preference (e.g. 24 hr vs. -AM/PM).
    • -
    • Now shows cc: in message view.
    • -
    • Improves recovery from POP3 connection failures.
    • -
    • POP3 parser rules loosened, so the application can work with -non-compliant email servers.
    • -
    - -

    New Features

    - -
      -
    • Maps: Adds details and reviews when a user does a search on Maps and -clicks on a business to view its details.
    • -
    • Dialer: In-call screen timeout default is now longer when using the -speakerphone.
    • -
    • Dialer: Adds a "Show dialpad" / "Hide dialpad" item to the in-call -menu, to make it easier to discover the DTMF dialpad.
    • -
    • Adds support for saving attachments from MMS
    • -
    • Adds support for marquee in layouts.
    • -
    - -

    API Changes

    - -

    Overview

    - -
      -
    • Adds annotations for test systems, no actual (non-test) API -changes.
    • -
    • Adds a method to allow a process to easily determine its UID. -
    • Adds support for marquee in layouts.
    • -
    • Adds new methods for determining padding in views. Useful if you are -writing your own -subclasses of {@link android.view.View View}.
    • -
    • Adds new permissions that allow an application to broadcast an SMS -or WAP Push message.
    • -
    • API cleanup: removes protected constructor from -SDK-bound system images.
    • -
    - -

    API Change Details

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Module or FeatureChange Description
    Annotations for test systems
    Added {@link android.test.suitebuilder.annotation.LargeTest LargeTest} annotation.
    Added {@link android.test.suitebuilder.annotation.MediumTest MediumTest} annotation.
    Added {@link android.test.suitebuilder.annotation.SmallTest SmallTest} annotation.
    Allow a process to easily know its UID.
    Added public method {@link android.os.Process#myUid} to class {@link android.os.Process android.os.Process}
    Padding in views
    Added public method {@link android.view.View#getBottomPaddingOffset} to class {@link android.view.View android.view.View}.
    Added public method {@link android.view.View#getLeftPaddingOffset} to class {@link android.view.View android.view.View}.
    Added public method {@link android.view.View#getRightPaddingOffset} to class {@link android.view.View android.view.View}.
    Added public method {@link android.view.View#getTopPaddingOffset} to class {@link android.view.View android.view.View}.
    Added public method {@link android.view.View#isPaddingOffsetRequired} to class {@link android.view.View android.view.View}.
    Marquee support
    Added public method {@link android.widget.TextView#setMarqueeRepeatLimit} to class {@link android.widget.TextView}
    Added public field {@link android.R.attr#marqueeRepeatLimit android.R.attr.marqueeRepeatLimit}
    New permissions
    Added public field {@link android.Manifest.permission#BROADCAST_SMS android.Manifest.permission.BROADCAST_SMS}
    Added public field {@link android.Manifest.permission#BROADCAST_WAP_PUSH android.Manifest.permission.BROADCAST_WAP_PUSH}
    API cleanup
    Removed protected constructor java.net.ServerSocket.ServerSocket(java.net.SocketImpl).
    - - - - - - diff --git a/docs/html/sdk/download.jd b/docs/html/sdk/download.jd deleted file mode 100644 index 3c4f06b..0000000 --- a/docs/html/sdk/download.jd +++ /dev/null @@ -1,86 +0,0 @@ -page.title=Download the Android SDK -hide_license_footer=true - -@jd:body - - - -
    -

    Please carefully review the Android SDK License Agreement before downloading the SDK. -The License Agreement constitutes a contract between you and Google with respect to your use of the SDK.

    - - - -

    - - -

    -

    - -

    -

    - -

    -
    - - - - - - - - - - - - - diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd deleted file mode 100644 index 38db6f8..0000000 --- a/docs/html/sdk/index.jd +++ /dev/null @@ -1,5 +0,0 @@ -sdk.redirect=1.1_r1 -@jd:body - - - diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs deleted file mode 100644 index 688929f..0000000 --- a/docs/html/sdk/sdk_toc.cs +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/docs/html/sdk/terms.jd b/docs/html/sdk/terms.jd deleted file mode 100644 index 4638850..0000000 --- a/docs/html/sdk/terms.jd +++ /dev/null @@ -1,219 +0,0 @@ -page.title=Terms and Conditions -hide_license_footer=true -@jd:body - -

    This is the Android Software Development Kit License Agreement.

    - -

    - 1. Introduction -

    -

    - 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files and packaged APIs) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. -

    -

    - 1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. -

    -

    - 2. Accepting this License Agreement -

    -

    - 2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement. -

    -

    - 2.2 You can accept this License Agreement by: -

    -

    - (A) clicking to accept or agree to this License Agreement, where this option is made available to you; or -

    -

    - (B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards. -

    -

    - 2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK. -

    -

    - 2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity. -

    -

    - 3. SDK License from Google -

    -

    - 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform. -

    -

    - 3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. The Android Open Source Project -

    -

    - 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK. -

    -

    - 3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. -

    -

    - 3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. -

    -

    - 3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. -

    -

    - 3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK. -

    -

    - 4. Use of the SDK by You -

    -

    - 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights which subsist in those applications. -

    -

    - 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). -

    -

    - 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. -

    -

    - 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. -

    -

    - 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. -

    -

    - 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. -

    -

    - 5. Your Developer Credentials -

    -

    - 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. -

    -

    - 6. Privacy and Information -

    -

    - 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. -

    -

    - 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy. -

    -

    - 7. Third Party Applications for the Android Platform -

    -

    - 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. -

    -

    - 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. -

    -

    - 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. -

    -

    - 8. Using Android APIs -

    -

    - 8.1 Android Maps API -

    -

    - 8.1.1 If you use the Android Maps API (described in the SDK by the Package names "com.google.android.maps" and "com.android.location.Geocoder"), the terms of your binding legal agreement with Google include this License Agreement, the Google Maps API Terms of Service and the Google Maps Terms of Service. You must read and agree to those Terms of Service before you use the Android Maps API. -

    -

    - 8.1.2 If you use the Android Maps API to retrieve map or satellite image data from Google, you must include the following copyright notice in your application or service in a manner that is reasonably available to users: -

    -

    - "Copyright Notice: Data: (c)2007 TeleAtlas, AND, Europa Technologies, Kingway, Map Data Sciences Pty Ltd, PSMA, ZENRIN, Geocentre, MapLink/TeleAtlas; Imagery: (c)2007 DigitalGlobe, EarthSat, Sanborn, NYGIS, Scankort, TerraMetrics, MassGIS Commonwealth of Massachusetts, Digital Earth Technology." -

    -

    - 8.2 Google Data APIs -

    -

    - 8.2.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by those who provide that data (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless you have been specifically given permission to do so by the owners of that data. -

    -

    - 8.2.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. -

    -

    - 9. Terminating this License Agreement -

    -

    - 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. -

    -

    - 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. -

    -

    - 9.3 Google may at any time, terminate this License Agreement with you if: -

    -

    - (A) you have breached any provision of this License Agreement; or -

    -

    - (B) Google is required to do so by law; or -

    -

    - (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or -

    -

    - (D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. -

    -

    - 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. -

    -

    - 10. DISCLAIMER OF WARRANTIES -

    -

    - 10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. -

    -

    - 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. -

    -

    - 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -

    -

    - 11. LIMITATION OF LIABILITY -

    -

    - 11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. -

    -

    - 12. Indemnification -

    -

    - 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. -

    -

    - 13. Changes to the License Agreement -

    -

    - 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available and with the SDK downloadable. -

    -

    - 13.2 You agree that your use of a specific version of the SDK is governed by the License Agreement included with that version of the SDK. -

    -

    - 14. General Legal Terms -

    -

    - 14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK. -

    -

    - 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. -

    -

    - 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. -

    -

    - 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. -

    -

    - 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. -

    -

    - 14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. -

    -

    - 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. -

    -

    - August 18, 2008 -

    diff --git a/docs/html/sdk/terms_body.html b/docs/html/sdk/terms_body.html deleted file mode 100644 index e8fdc3c..0000000 --- a/docs/html/sdk/terms_body.html +++ /dev/null @@ -1,216 +0,0 @@ - -

    This is the Android Software Development Kit License Agreement.

    - -

    - 1. Introduction -

    -

    - 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files and packaged APIs) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. -

    -

    - 1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. -

    -

    - 2. Accepting this License Agreement -

    -

    - 2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement. -

    -

    - 2.2 You can accept this License Agreement by: -

    -

    - (A) clicking to accept or agree to this License Agreement, where this option is made available to you; or -

    -

    - (B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards. -

    -

    - 2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK. -

    -

    - 2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity. -

    -

    - 3. SDK License from Google -

    -

    - 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform. -

    -

    - 3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. The Android Open Source Project -

    -

    - 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK. -

    -

    - 3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. -

    -

    - 3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. -

    -

    - 3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. -

    -

    - 3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK. -

    -

    - 4. Use of the SDK by You -

    -

    - 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights which subsist in those applications. -

    -

    - 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). -

    -

    - 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. -

    -

    - 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. -

    -

    - 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. -

    -

    - 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. -

    -

    - 5. Your Developer Credentials -

    -

    - 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. -

    -

    - 6. Privacy and Information -

    -

    - 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. -

    -

    - 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy. -

    -

    - 7. Third Party Applications for the Android Platform -

    -

    - 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. -

    -

    - 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. -

    -

    - 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. -

    -

    - 8. Using Android APIs -

    -

    - 8.1 Android Maps API -

    -

    - 8.1.1 If you use the Android Maps API (described in the SDK by the Package names "com.google.android.maps" and "com.android.location.Geocoder"), the terms of your binding legal agreement with Google include this License Agreement, the Google Maps API Terms of Service and the Google Maps Terms of Service. You must read and agree to those Terms of Service before you use the Android Maps API. -

    -

    - 8.1.2 If you use the Android Maps API to retrieve map or satellite image data from Google, you must include the following copyright notice in your application or service in a manner that is reasonably available to users: -

    -

    - "Copyright Notice: Data: (c)2007 TeleAtlas, AND, Europa Technologies, Kingway, Map Data Sciences Pty Ltd, PSMA, ZENRIN, Geocentre, MapLink/TeleAtlas; Imagery: (c)2007 DigitalGlobe, EarthSat, Sanborn, NYGIS, Scankort, TerraMetrics, MassGIS Commonwealth of Massachusetts, Digital Earth Technology." -

    -

    - 8.2 Google Data APIs -

    -

    - 8.2.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by those who provide that data (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless you have been specifically given permission to do so by the owners of that data. -

    -

    - 8.2.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. -

    -

    - 9. Terminating this License Agreement -

    -

    - 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. -

    -

    - 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. -

    -

    - 9.3 Google may at any time, terminate this License Agreement with you if: -

    -

    - (A) you have breached any provision of this License Agreement; or -

    -

    - (B) Google is required to do so by law; or -

    -

    - (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or -

    -

    - (D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. -

    -

    - 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. -

    -

    - 10. DISCLAIMER OF WARRANTIES -

    -

    - 10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. -

    -

    - 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. -

    -

    - 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -

    -

    - 11. LIMITATION OF LIABILITY -

    -

    - 11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. -

    -

    - 12. Indemnification -

    -

    - 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. -

    -

    - 13. Changes to the License Agreement -

    -

    - 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available and with the SDK downloadable. -

    -

    - 13.2 You agree that your use of a specific version of the SDK is governed by the License Agreement included with that version of the SDK. -

    -

    - 14. General Legal Terms -

    -

    - 14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK. -

    -

    - 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. -

    -

    - 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. -

    -

    - 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. -

    -

    - 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. -

    -

    - 14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. -

    -

    - 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. -

    -

    - August 18, 2008 -

    diff --git a/docs/html/search.jd b/docs/html/search.jd deleted file mode 100644 index 979964b..0000000 --- a/docs/html/search.jd +++ /dev/null @@ -1,60 +0,0 @@ -page.title=Search Results -@jd:body - - - - - -
    -

    search results

    - -

    -
    Loading...
    -
    diff --git a/docs/html/security_at_android_dot_com.txt b/docs/html/security_at_android_dot_com.txt deleted file mode 100644 index daeda53..0000000 --- a/docs/html/security_at_android_dot_com.txt +++ /dev/null @@ -1,40 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.2.2 (GNU/Linux) - -mQGiBEigu7MRBAD7gZJzevtYLB3c1pE7uMwu+zHzGGJDrEyEaz0lYTAaJ2YXmJ1+ -IvmvBI/iMrRqpFLR35uUcz2UHgJtIP+xenCF4WIhHv5wg3XvBvTgG/ooZaj1gtez -miXV2bXTlEMxSqsZKvkieQRrMv3eV2VYhgaPvp8xJhl+xs8eVhlrmMv94wCgzWUw -BrOICLPF5lANocvkqGNO3UUEAMH7GguhvXNlIUncqOpHC0N4FGPirPh/6nYxa9iZ -kQEEg6mB6wPkaHZ5ddpagzFC6AncoOrhX5HPin9T6+cPhdIIQMogJOqDZ4xsAYCY -KwjkoLQjfMdS5CYrMihFm4guNMKpWPfCe/T4TU7tFmTug8nnAIPFh2BNm8/EqHpg -jR4JA/9wJMxv+2eFuFGeLtiPjo+o2+AfIxTTEIlWyNkO+a9KkzmPY/JP4OyVGKjM -V+aO0vZ6FamdlrXAaAPm1ULmY5pC15P/hNr0YAbN28Y8cwNGuuKGbiYvYD35KKhs -5c5/pfMy0rgDElhFTGd4rpZdkHei3lwF5cyV0htv5s2lwGJKnrQnQW5kcm9pZCBT -ZWN1cml0eSA8c2VjdXJpdHlAYW5kcm9pZC5jb20+iGAEExECACAFAkigu7MCGwMG -CwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRBzHmufAFQPw547AKDIDW3mDx+84xk1 -EfzH/uNQQLYBBgCeMabHPlx+2+IGnfPsQ8UsxMPLFnO5BA0ESKC72BAQALKb8W8l -U3Xs+lbquuVEA5x+mNnJriRnq1q1ZA8J43z0lCqT6n+q/nICuE/SjGxfp+8G/K3/ -LrIfBWLLQHZMQyk/1Eild/ZoRxNAbjTGiQY6HWrZOd+Z2fWiSN03nSSpWImPbua3 -6LwSRRZNmZ77tdY0hI9TqJzqax1WQWk7IxfWubNTbNsPiktm/d6C2P04OkKOAmr8 -QCqKLLCO578zYLTgraL6F4g2YVurGgAB1KFSX2F8fh6Igr+pIW/ytoS9n2H+uecR -l+2RB6Pq7MahwZvPPeMavwUMPQpOI6Or3pYZTzp/IJWNyL6MOBzV5q4gkD0xYtEq -Ihr1hX1IdiGdOA4oH1Rk1K/XIPwLelQdYp3ftiReh4/Gb3kfKCxpmMXL1f/ndx6N -zIiqweDU5mZBpXBsBzFZfUDALL4VGqpc2eEltkVtD0RuQI2YaImBjOPsHI4StN5t -2OspWke4xJGf0PqRVjTDJmtUrIJX4X5Fh8M85unHYYIpBCaDbM/7/xIaNQbQfdeO -6yqGrj/0WAjL34wbo4D12BiPeoUTreD60aNwmpu5z1NRPS2Wn+6kTIHGhf47wGTZ -v9OFYWhgSs3INpna4VA4E8SpOWPd8LFYLs9clAlaUhqJyLJ3JlmXmhGnWM41z+p9 -RA8UQXhvQcvYJSR77SC4O503wdVKJ07OH6WbAAMFD/4yjBZ+X7QBIKTLHXAIQBjB -526iOhmfxyIgmX4vWcggJFZrBxPFulkGJj65Mwr9AwZeIceukKQUGcf2LpEoIdZY -dP8gEshRDZQ1Y3GDD9ukChRDoK9kFIxnYmH8euU/TwTPtAEEDASfwEZnM5DcJQOA -Q6G3GVKr/8uwmT5hUn5sR2L9vmrjw1nPkfZeDQNBmeTI8A+byosp6Nxl8thJIGNt -8UTa02+g/nbf+ODRrEf3xeeFUNb14kTqULNT/hTj8/6xDwxwaF2ms60kYxA/EXDB -21jqmhnfUwjSa++R38Qig9tGwOo83Z7uNCqtU3caFW1P55iD/Sju/ZecHVSgfq6j -2H7mNWfvB9ILkS7w1w/InjEA7LpY9jtmPKDIYYQ7YGZuxFwOxtw69ulkS6ddc1Pt -AQ5oe0d59rBicE8R7rBCxwzMihG5ctJ+a+t4/MHqi6jy/WI9OK+SwWmCeT1nVy6F -NZ00QOPe89DFBCqhj4qSGfjOtCEKAM7SOhkyEYJ8jk5KrsLOcWPOM9i3uus1RquG -XJ2Cljt6zJYtEnpkjrw+Ge0SBDNEMGZEBLbEZKECtNJ2NBrMRKYeAseCGNQ+uJOz -8vL7ztUKoi1SbFGuHkv5N2NmPq42QrN8dftW01DceGDnJ1KHRvCUbpPcyQYFhRFb -nxd3tMIEGO83iEmozvJfB4hJBBgRAgAJBQJIoLvYAhsMAAoJEHMea58AVA/D6ewA -ninKQSW+oL4z28F3T0GHag38WeWyAJ45d7dx4z0GxhTm2b9DclLombY+nw== -=XyBX ------END PGP PUBLIC KEY BLOCK----- -- cgit v1.1