gametel 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.calabash_settings +1 -0
- data/.gitignore +25 -0
- data/.irbrc +16 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/.travis.yml +5 -0
- data/ApiDemos/.classpath +8 -0
- data/ApiDemos/.project +33 -0
- data/ApiDemos/.settings/org.eclipse.jdt.core.prefs +4 -0
- data/ApiDemos/AndroidManifest.xml +2715 -0
- data/ApiDemos/README.txt +19 -0
- data/ApiDemos/assets/HelloActivity.apk +0 -0
- data/ApiDemos/assets/fonts/samplefont.ttf +0 -0
- data/ApiDemos/assets/read_asset.txt +3 -0
- data/ApiDemos/bin/ApiDemos.apk +0 -0
- data/ApiDemos/build.xml +83 -0
- data/ApiDemos/local.properties +10 -0
- data/ApiDemos/proguard-project.txt +20 -0
- data/ApiDemos/project.properties +14 -0
- data/ApiDemos/res/anim/animator.xml +23 -0
- data/ApiDemos/res/anim/animator_set.xml +32 -0
- data/ApiDemos/res/anim/color_animator.xml +23 -0
- data/ApiDemos/res/anim/cycle_7.xml +17 -0
- data/ApiDemos/res/anim/fade.xml +20 -0
- data/ApiDemos/res/anim/hold.xml +20 -0
- data/ApiDemos/res/anim/hyperspace_in.xml +17 -0
- data/ApiDemos/res/anim/hyperspace_out.xml +61 -0
- data/ApiDemos/res/anim/layout_animation_row_left_slide.xml +19 -0
- data/ApiDemos/res/anim/layout_animation_row_right_slide.xml +20 -0
- data/ApiDemos/res/anim/layout_animation_table.xml +19 -0
- data/ApiDemos/res/anim/layout_bottom_to_top_slide.xml +20 -0
- data/ApiDemos/res/anim/layout_grid_fade.xml +20 -0
- data/ApiDemos/res/anim/layout_grid_inverse_fade.xml +21 -0
- data/ApiDemos/res/anim/layout_random_fade.xml +20 -0
- data/ApiDemos/res/anim/layout_wave_scale.xml +21 -0
- data/ApiDemos/res/anim/object_animator.xml +23 -0
- data/ApiDemos/res/anim/push_left_in.xml +20 -0
- data/ApiDemos/res/anim/push_left_out.xml +20 -0
- data/ApiDemos/res/anim/push_up_in.xml +20 -0
- data/ApiDemos/res/anim/push_up_out.xml +20 -0
- data/ApiDemos/res/anim/shake.xml +17 -0
- data/ApiDemos/res/anim/slide_left.xml +20 -0
- data/ApiDemos/res/anim/slide_right.xml +20 -0
- data/ApiDemos/res/anim/slide_top_to_bottom.xml +20 -0
- data/ApiDemos/res/anim/wave_scale.xml +33 -0
- data/ApiDemos/res/anim/zoom_enter.xml +28 -0
- data/ApiDemos/res/anim/zoom_exit.xml +33 -0
- data/ApiDemos/res/animator/fragment_slide_left_enter.xml +32 -0
- data/ApiDemos/res/animator/fragment_slide_left_exit.xml +32 -0
- data/ApiDemos/res/animator/fragment_slide_right_enter.xml +32 -0
- data/ApiDemos/res/animator/fragment_slide_right_exit.xml +32 -0
- data/ApiDemos/res/drawable-hdpi/alert_dialog_icon.png +0 -0
- data/ApiDemos/res/drawable-hdpi/apidemo_androidlogo.png +0 -0
- data/ApiDemos/res/drawable-hdpi/app_sample_code.png +0 -0
- data/ApiDemos/res/drawable-hdpi/arrow_down_float.png +0 -0
- data/ApiDemos/res/drawable-hdpi/arrow_up_float.png +0 -0
- data/ApiDemos/res/drawable-hdpi/btn_check_off.png +0 -0
- data/ApiDemos/res/drawable-hdpi/btn_check_on.png +0 -0
- data/ApiDemos/res/drawable-hdpi/btn_circle_normal.png +0 -0
- data/ApiDemos/res/drawable-hdpi/btn_default_normal.9.png +0 -0
- data/ApiDemos/res/drawable-hdpi/button.9.png +0 -0
- data/ApiDemos/res/drawable-hdpi/ic_contact_picture.png +0 -0
- data/ApiDemos/res/drawable-hdpi/ic_launcher_settings.png +0 -0
- data/ApiDemos/res/drawable-hdpi/ic_popup_reminder.png +0 -0
- data/ApiDemos/res/drawable-hdpi/icon48x48_2.png +0 -0
- data/ApiDemos/res/drawable-hdpi/logo240dpi.png +0 -0
- data/ApiDemos/res/drawable-hdpi/npatch240dpi.9.png +0 -0
- data/ApiDemos/res/drawable-hdpi/progress_circular_background.png +0 -0
- data/ApiDemos/res/drawable-hdpi/progress_particle.png +0 -0
- data/ApiDemos/res/drawable-hdpi/reslogo240dpi.png +0 -0
- data/ApiDemos/res/drawable-hdpi/scrollbar_state2.png +0 -0
- data/ApiDemos/res/drawable-hdpi/smlnpatch240dpi.9.png +0 -0
- data/ApiDemos/res/drawable-hdpi/star_big_on.png +0 -0
- data/ApiDemos/res/drawable-hdpi/stat_happy.png +0 -0
- data/ApiDemos/res/drawable-hdpi/stat_neutral.png +0 -0
- data/ApiDemos/res/drawable-hdpi/stat_sad.png +0 -0
- data/ApiDemos/res/drawable-hdpi/stat_sample.png +0 -0
- data/ApiDemos/res/drawable-hdpi/stylogo240dpi.png +0 -0
- data/ApiDemos/res/drawable-ldpi/logo120dpi.png +0 -0
- data/ApiDemos/res/drawable-ldpi/npatch120dpi.9.png +0 -0
- data/ApiDemos/res/drawable-ldpi/reslogo120dpi.png +0 -0
- data/ApiDemos/res/drawable-ldpi/smlnpatch120dpi.9.png +0 -0
- data/ApiDemos/res/drawable-ldpi/stylogo120dpi.png +0 -0
- data/ApiDemos/res/drawable-mdpi/alert_dialog_icon.png +0 -0
- data/ApiDemos/res/drawable-mdpi/apidemo_androidlogo.png +0 -0
- data/ApiDemos/res/drawable-mdpi/app_sample_code.png +0 -0
- data/ApiDemos/res/drawable-mdpi/arrow_down_float.png +0 -0
- data/ApiDemos/res/drawable-mdpi/arrow_up_float.png +0 -0
- data/ApiDemos/res/drawable-mdpi/btn_check_off.png +0 -0
- data/ApiDemos/res/drawable-mdpi/btn_check_on.png +0 -0
- data/ApiDemos/res/drawable-mdpi/btn_circle_normal.png +0 -0
- data/ApiDemos/res/drawable-mdpi/btn_default_normal.9.png +0 -0
- data/ApiDemos/res/drawable-mdpi/button.9.png +0 -0
- data/ApiDemos/res/drawable-mdpi/ic_contact_picture.png +0 -0
- data/ApiDemos/res/drawable-mdpi/ic_launcher_settings.png +0 -0
- data/ApiDemos/res/drawable-mdpi/ic_popup_reminder.png +0 -0
- data/ApiDemos/res/drawable-mdpi/ic_settings_applications.png +0 -0
- data/ApiDemos/res/drawable-mdpi/ic_settings_display.png +0 -0
- data/ApiDemos/res/drawable-mdpi/icon48x48_2.png +0 -0
- data/ApiDemos/res/drawable-mdpi/progress_circular_background.png +0 -0
- data/ApiDemos/res/drawable-mdpi/progress_particle.png +0 -0
- data/ApiDemos/res/drawable-mdpi/scrollbar_state2.png +0 -0
- data/ApiDemos/res/drawable-mdpi/star_big_on.png +0 -0
- data/ApiDemos/res/drawable-mdpi/stat_happy.png +0 -0
- data/ApiDemos/res/drawable-mdpi/stat_neutral.png +0 -0
- data/ApiDemos/res/drawable-mdpi/stat_sad.png +0 -0
- data/ApiDemos/res/drawable-mdpi/stat_sample.png +0 -0
- data/ApiDemos/res/drawable-nodpi/frantic.jpg +0 -0
- data/ApiDemos/res/drawable-nodpi/logonodpi120.png +0 -0
- data/ApiDemos/res/drawable-nodpi/logonodpi160.png +0 -0
- data/ApiDemos/res/drawable-nodpi/logonodpi240.png +0 -0
- data/ApiDemos/res/drawable-xhdpi/ic_launcher_settings.png +0 -0
- data/ApiDemos/res/drawable/animated_gif.gif +0 -0
- data/ApiDemos/res/drawable/balloons.jpg +0 -0
- data/ApiDemos/res/drawable/beach.jpg +0 -0
- data/ApiDemos/res/drawable/black_box.xml +21 -0
- data/ApiDemos/res/drawable/black_opaque_box.xml +21 -0
- data/ApiDemos/res/drawable/box.xml +24 -0
- data/ApiDemos/res/drawable/circular_progress.xml +29 -0
- data/ApiDemos/res/drawable/filled_box.xml +25 -0
- data/ApiDemos/res/drawable/frog.gif +0 -0
- data/ApiDemos/res/drawable/gallery_background_1.xml +20 -0
- data/ApiDemos/res/drawable/gallery_photo_1.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_2.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_3.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_4.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_5.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_6.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_7.jpg +0 -0
- data/ApiDemos/res/drawable/gallery_photo_8.jpg +0 -0
- data/ApiDemos/res/drawable/hover_background.xml +20 -0
- data/ApiDemos/res/drawable/hover_background_active.xml +23 -0
- data/ApiDemos/res/drawable/hover_background_inactive.xml +23 -0
- data/ApiDemos/res/drawable/icon48x48_1.png +0 -0
- data/ApiDemos/res/drawable/line.xml +21 -0
- data/ApiDemos/res/drawable/logo160dpi.png +0 -0
- data/ApiDemos/res/drawable/magnifying_glass.png +0 -0
- data/ApiDemos/res/drawable/npatch160dpi.9.png +0 -0
- data/ApiDemos/res/drawable/photo1.jpg +0 -0
- data/ApiDemos/res/drawable/photo2.jpg +0 -0
- data/ApiDemos/res/drawable/photo3.jpg +0 -0
- data/ApiDemos/res/drawable/photo4.jpg +0 -0
- data/ApiDemos/res/drawable/photo5.jpg +0 -0
- data/ApiDemos/res/drawable/photo6.jpg +0 -0
- data/ApiDemos/res/drawable/picture_frame.png +0 -0
- data/ApiDemos/res/drawable/reslogo160dpi.png +0 -0
- data/ApiDemos/res/drawable/sample_0.jpg +0 -0
- data/ApiDemos/res/drawable/sample_1.jpg +0 -0
- data/ApiDemos/res/drawable/sample_2.jpg +0 -0
- data/ApiDemos/res/drawable/sample_3.jpg +0 -0
- data/ApiDemos/res/drawable/sample_4.jpg +0 -0
- data/ApiDemos/res/drawable/sample_5.jpg +0 -0
- data/ApiDemos/res/drawable/sample_6.jpg +0 -0
- data/ApiDemos/res/drawable/sample_7.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_0.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_1.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_2.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_3.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_4.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_5.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_6.jpg +0 -0
- data/ApiDemos/res/drawable/sample_thumb_7.jpg +0 -0
- data/ApiDemos/res/drawable/scrollbar_vertical_thumb.xml +21 -0
- data/ApiDemos/res/drawable/scrollbar_vertical_track.xml +21 -0
- data/ApiDemos/res/drawable/shape_1.xml +22 -0
- data/ApiDemos/res/drawable/shape_2.xml +24 -0
- data/ApiDemos/res/drawable/shape_3.xml +24 -0
- data/ApiDemos/res/drawable/shape_4.xml +20 -0
- data/ApiDemos/res/drawable/shape_5.xml +23 -0
- data/ApiDemos/res/drawable/smlnpatch160dpi.9.png +0 -0
- data/ApiDemos/res/drawable/stylogo160dpi.png +0 -0
- data/ApiDemos/res/layout-h550dp/resources_height.xml +53 -0
- data/ApiDemos/res/layout-h670dp/resources_height.xml +63 -0
- data/ApiDemos/res/layout-h974dp/resources_height.xml +83 -0
- data/ApiDemos/res/layout-land/fragment_arguments.xml +57 -0
- data/ApiDemos/res/layout-land/fragment_layout.xml +34 -0
- data/ApiDemos/res/layout-sw480dp/resources_smallest_width_inner.xml +43 -0
- data/ApiDemos/res/layout-sw480dp/resources_smallest_width_row.xml +43 -0
- data/ApiDemos/res/layout-sw600dp/resources_smallest_width_inner.xml +53 -0
- data/ApiDemos/res/layout-sw600dp/resources_smallest_width_row.xml +53 -0
- data/ApiDemos/res/layout-sw720dp/resources_smallest_width_inner.xml +63 -0
- data/ApiDemos/res/layout-sw720dp/resources_smallest_width_row.xml +63 -0
- data/ApiDemos/res/layout-w1024dp/resources_width.xml +83 -0
- data/ApiDemos/res/layout-w600dp/resources_width.xml +53 -0
- data/ApiDemos/res/layout-w720dp/resources_width.xml +63 -0
- data/ApiDemos/res/layout/accessibility_service.xml +36 -0
- data/ApiDemos/res/layout/action_bar_display_options.xml +48 -0
- data/ApiDemos/res/layout/action_bar_display_options_custom.xml +17 -0
- data/ApiDemos/res/layout/action_bar_settings_action_provider.xml +34 -0
- data/ApiDemos/res/layout/action_bar_tab_content.xml +19 -0
- data/ApiDemos/res/layout/action_bar_tabs.xml +49 -0
- data/ApiDemos/res/layout/activity_animation.xml +42 -0
- data/ApiDemos/res/layout/activity_recreate.xml +37 -0
- data/ApiDemos/res/layout/alarm_controller.xml +45 -0
- data/ApiDemos/res/layout/alarm_service.xml +41 -0
- data/ApiDemos/res/layout/alert_dialog.xml +60 -0
- data/ApiDemos/res/layout/alert_dialog_text_entry.xml +67 -0
- data/ApiDemos/res/layout/animation_1.xml +44 -0
- data/ApiDemos/res/layout/animation_2.xml +67 -0
- data/ApiDemos/res/layout/animation_3.xml +44 -0
- data/ApiDemos/res/layout/animation_cloning.xml +28 -0
- data/ApiDemos/res/layout/animation_custom_evaluator.xml +28 -0
- data/ApiDemos/res/layout/animation_loading.xml +28 -0
- data/ApiDemos/res/layout/animation_multi_property.xml +28 -0
- data/ApiDemos/res/layout/animation_reversing.xml +40 -0
- data/ApiDemos/res/layout/animation_seeking.xml +40 -0
- data/ApiDemos/res/layout/animations_main_screen.xml +36 -0
- data/ApiDemos/res/layout/animator_custom_evaluator.xml +34 -0
- data/ApiDemos/res/layout/animator_events.xml +122 -0
- data/ApiDemos/res/layout/appwidget_configure.xml +42 -0
- data/ApiDemos/res/layout/appwidget_provider.xml +24 -0
- data/ApiDemos/res/layout/autocomplete_1.xml +48 -0
- data/ApiDemos/res/layout/autocomplete_2.xml +44 -0
- data/ApiDemos/res/layout/autocomplete_3.xml +165 -0
- data/ApiDemos/res/layout/autocomplete_4.xml +49 -0
- data/ApiDemos/res/layout/autocomplete_5.xml +45 -0
- data/ApiDemos/res/layout/autocomplete_6.xml +48 -0
- data/ApiDemos/res/layout/baseline_1.xml +40 -0
- data/ApiDemos/res/layout/baseline_2.xml +43 -0
- data/ApiDemos/res/layout/baseline_3.xml +56 -0
- data/ApiDemos/res/layout/baseline_4.xml +55 -0
- data/ApiDemos/res/layout/baseline_6.xml +34 -0
- data/ApiDemos/res/layout/baseline_7.xml +36 -0
- data/ApiDemos/res/layout/baseline_nested_1.xml +85 -0
- data/ApiDemos/res/layout/baseline_nested_2.xml +85 -0
- data/ApiDemos/res/layout/baseline_nested_3.xml +96 -0
- data/ApiDemos/res/layout/bouncing_balls.xml +22 -0
- data/ApiDemos/res/layout/buttons_1.xml +47 -0
- data/ApiDemos/res/layout/chronometer.xml +64 -0
- data/ApiDemos/res/layout/clipboard.xml +107 -0
- data/ApiDemos/res/layout/contacts_filter.xml +37 -0
- data/ApiDemos/res/layout/controls_1.xml +153 -0
- data/ApiDemos/res/layout/custom_dialog_activity.xml +24 -0
- data/ApiDemos/res/layout/custom_title.xml +57 -0
- data/ApiDemos/res/layout/custom_title_1.xml +33 -0
- data/ApiDemos/res/layout/custom_view_1.xml +44 -0
- data/ApiDemos/res/layout/custom_view_accessibility.xml +44 -0
- data/ApiDemos/res/layout/date_widgets_example_1.xml +40 -0
- data/ApiDemos/res/layout/date_widgets_example_2.xml +33 -0
- data/ApiDemos/res/layout/density_image_views.xml +37 -0
- data/ApiDemos/res/layout/density_styled_image_views.xml +26 -0
- data/ApiDemos/res/layout/dialog_activity.xml +53 -0
- data/ApiDemos/res/layout/drag_layout.xml +93 -0
- data/ApiDemos/res/layout/external_storage.xml +27 -0
- data/ApiDemos/res/layout/external_storage_item.xml +58 -0
- data/ApiDemos/res/layout/focus_1.xml +42 -0
- data/ApiDemos/res/layout/focus_2.xml +41 -0
- data/ApiDemos/res/layout/focus_3.xml +64 -0
- data/ApiDemos/res/layout/focus_5.xml +60 -0
- data/ApiDemos/res/layout/foreground_dispatch.xml +23 -0
- data/ApiDemos/res/layout/foreground_service_controller.xml +49 -0
- data/ApiDemos/res/layout/forward_target.xml +30 -0
- data/ApiDemos/res/layout/forwarding.xml +37 -0
- data/ApiDemos/res/layout/fragment_arguments.xml +54 -0
- data/ApiDemos/res/layout/fragment_context_menu.xml +38 -0
- data/ApiDemos/res/layout/fragment_dialog.xml +40 -0
- data/ApiDemos/res/layout/fragment_dialog_or_activity.xml +64 -0
- data/ApiDemos/res/layout/fragment_hide_show.xml +57 -0
- data/ApiDemos/res/layout/fragment_layout.xml +27 -0
- data/ApiDemos/res/layout/fragment_menu.xml +46 -0
- data/ApiDemos/res/layout/fragment_pager_support.xml +44 -0
- data/ApiDemos/res/layout/fragment_pager_support_list.xml +52 -0
- data/ApiDemos/res/layout/fragment_retain_instance.xml +46 -0
- data/ApiDemos/res/layout/fragment_stack.xml +38 -0
- data/ApiDemos/res/layout/gallery_1.xml +32 -0
- data/ApiDemos/res/layout/gallery_2.xml +38 -0
- data/ApiDemos/res/layout/game_controller_input.xml +52 -0
- data/ApiDemos/res/layout/game_controller_input_heading.xml +21 -0
- data/ApiDemos/res/layout/game_controller_input_text_column.xml +34 -0
- data/ApiDemos/res/layout/google_login.xml +60 -0
- data/ApiDemos/res/layout/grid_1.xml +29 -0
- data/ApiDemos/res/layout/grid_2.xml +30 -0
- data/ApiDemos/res/layout/grid_layout_1.xml +87 -0
- data/ApiDemos/res/layout/hello_world.xml +26 -0
- data/ApiDemos/res/layout/horizontal_scroll_view1.xml +26 -0
- data/ApiDemos/res/layout/hover.xml +64 -0
- data/ApiDemos/res/layout/image_button_1.xml +36 -0
- data/ApiDemos/res/layout/image_switcher_1.xml +40 -0
- data/ApiDemos/res/layout/image_view_1.xml +144 -0
- data/ApiDemos/res/layout/incoming_message.xml +50 -0
- data/ApiDemos/res/layout/incoming_message_info.xml +38 -0
- data/ApiDemos/res/layout/incoming_message_interstitial.xml +37 -0
- data/ApiDemos/res/layout/incoming_message_panel.xml +42 -0
- data/ApiDemos/res/layout/incoming_message_view.xml +80 -0
- data/ApiDemos/res/layout/install_apk.xml +56 -0
- data/ApiDemos/res/layout/intent_activity_flags.xml +43 -0
- data/ApiDemos/res/layout/intents.xml +37 -0
- data/ApiDemos/res/layout/labeled_text_edit.xml +38 -0
- data/ApiDemos/res/layout/launcher_shortcuts.xml +40 -0
- data/ApiDemos/res/layout/layout_animation_1.xml +30 -0
- data/ApiDemos/res/layout/layout_animation_3.xml +21 -0
- data/ApiDemos/res/layout/layout_animation_4.xml +30 -0
- data/ApiDemos/res/layout/layout_animation_5.xml +30 -0
- data/ApiDemos/res/layout/layout_animation_6.xml +29 -0
- data/ApiDemos/res/layout/layout_animation_7.xml +57 -0
- data/ApiDemos/res/layout/layout_animations.xml +80 -0
- data/ApiDemos/res/layout/layout_animations_by_default.xml +34 -0
- data/ApiDemos/res/layout/layout_animations_hideshow.xml +52 -0
- data/ApiDemos/res/layout/linear_layout_1.xml +46 -0
- data/ApiDemos/res/layout/linear_layout_10.xml +122 -0
- data/ApiDemos/res/layout/linear_layout_2.xml +47 -0
- data/ApiDemos/res/layout/linear_layout_3.xml +51 -0
- data/ApiDemos/res/layout/linear_layout_4.xml +50 -0
- data/ApiDemos/res/layout/linear_layout_5.xml +76 -0
- data/ApiDemos/res/layout/linear_layout_6.xml +53 -0
- data/ApiDemos/res/layout/linear_layout_7.xml +54 -0
- data/ApiDemos/res/layout/linear_layout_8.xml +53 -0
- data/ApiDemos/res/layout/linear_layout_9.xml +38 -0
- data/ApiDemos/res/layout/link.xml +68 -0
- data/ApiDemos/res/layout/list_12.xml +35 -0
- data/ApiDemos/res/layout/list_13.xml +34 -0
- data/ApiDemos/res/layout/list_7.xml +35 -0
- data/ApiDemos/res/layout/list_8.xml +61 -0
- data/ApiDemos/res/layout/list_item_checkbox.xml +22 -0
- data/ApiDemos/res/layout/list_item_icon_text.xml +32 -0
- data/ApiDemos/res/layout/list_position.xml +25 -0
- data/ApiDemos/res/layout/local_sample.xml +37 -0
- data/ApiDemos/res/layout/local_service_binding.xml +42 -0
- data/ApiDemos/res/layout/local_service_controller.xml +42 -0
- data/ApiDemos/res/layout/log_text_box_1.xml +42 -0
- data/ApiDemos/res/layout/mapview.xml +31 -0
- data/ApiDemos/res/layout/marquee.xml +46 -0
- data/ApiDemos/res/layout/mediaplayer_1.xml +31 -0
- data/ApiDemos/res/layout/mediaplayer_2.xml +13 -0
- data/ApiDemos/res/layout/messenger_service_binding.xml +47 -0
- data/ApiDemos/res/layout/morse_code.xml +37 -0
- data/ApiDemos/res/layout/notify_with_text.xml +34 -0
- data/ApiDemos/res/layout/notifying_controller.xml +41 -0
- data/ApiDemos/res/layout/overscan.xml +79 -0
- data/ApiDemos/res/layout/pick_contact.xml +48 -0
- data/ApiDemos/res/layout/popup_menu_1.xml +25 -0
- data/ApiDemos/res/layout/preference_widget_mypreference.xml +25 -0
- data/ApiDemos/res/layout/progressbar_1.xml +74 -0
- data/ApiDemos/res/layout/progressbar_2.xml +41 -0
- data/ApiDemos/res/layout/progressbar_3.xml +32 -0
- data/ApiDemos/res/layout/progressbar_4.xml +27 -0
- data/ApiDemos/res/layout/quick_contacts.xml +47 -0
- data/ApiDemos/res/layout/radio_group_1.xml +49 -0
- data/ApiDemos/res/layout/ratingbar_1.xml +60 -0
- data/ApiDemos/res/layout/read_asset.xml +29 -0
- data/ApiDemos/res/layout/receive_result.xml +50 -0
- data/ApiDemos/res/layout/redirect_enter.xml +36 -0
- data/ApiDemos/res/layout/redirect_getter.xml +42 -0
- data/ApiDemos/res/layout/redirect_main.xml +47 -0
- data/ApiDemos/res/layout/relative_layout_1.xml +54 -0
- data/ApiDemos/res/layout/relative_layout_2.xml +78 -0
- data/ApiDemos/res/layout/remote_binding_options.xml +82 -0
- data/ApiDemos/res/layout/remote_service_binding.xml +52 -0
- data/ApiDemos/res/layout/remote_service_controller.xml +42 -0
- data/ApiDemos/res/layout/reorder_four.xml +38 -0
- data/ApiDemos/res/layout/reorder_on_launch.xml +38 -0
- data/ApiDemos/res/layout/reorder_three.xml +38 -0
- data/ApiDemos/res/layout/reorder_two.xml +38 -0
- data/ApiDemos/res/layout/resources.xml +55 -0
- data/ApiDemos/res/layout/resources_height.xml +33 -0
- data/ApiDemos/res/layout/resources_layout_reference.xml +35 -0
- data/ApiDemos/res/layout/resources_layout_reference_tablet.xml +35 -0
- data/ApiDemos/res/layout/resources_smallest_width.xml +35 -0
- data/ApiDemos/res/layout/resources_smallest_width_inner.xml +33 -0
- data/ApiDemos/res/layout/resources_smallest_width_row.xml +33 -0
- data/ApiDemos/res/layout/resources_width.xml +33 -0
- data/ApiDemos/res/layout/resources_width_and_height.xml +35 -0
- data/ApiDemos/res/layout/rotating_list.xml +37 -0
- data/ApiDemos/res/layout/rotating_view.xml +160 -0
- data/ApiDemos/res/layout/save_restore_state.xml +58 -0
- data/ApiDemos/res/layout/screen_orientation.xml +37 -0
- data/ApiDemos/res/layout/scroll_view_1.xml +90 -0
- data/ApiDemos/res/layout/scroll_view_2.xml +41 -0
- data/ApiDemos/res/layout/scrollbar1.xml +169 -0
- data/ApiDemos/res/layout/scrollbar2.xml +172 -0
- data/ApiDemos/res/layout/scrollbar3.xml +136 -0
- data/ApiDemos/res/layout/search_invoke.xml +96 -0
- data/ApiDemos/res/layout/search_query_results.xml +76 -0
- data/ApiDemos/res/layout/search_view.xml +19 -0
- data/ApiDemos/res/layout/searchview_actionbar.xml +28 -0
- data/ApiDemos/res/layout/searchview_filter.xml +31 -0
- data/ApiDemos/res/layout/secure_view.xml +112 -0
- data/ApiDemos/res/layout/secure_view_overlay.xml +50 -0
- data/ApiDemos/res/layout/seekbar_1.xml +36 -0
- data/ApiDemos/res/layout/select_dialog.xml +29 -0
- data/ApiDemos/res/layout/send_result.xml +45 -0
- data/ApiDemos/res/layout/service_start_arguments_controller.xml +57 -0
- data/ApiDemos/res/layout/shape_drawable_1.xml +73 -0
- data/ApiDemos/res/layout/simple_list_item_checkable_1.xml +29 -0
- data/ApiDemos/res/layout/sms_demo.xml +67 -0
- data/ApiDemos/res/layout/soft_input_modes.xml +64 -0
- data/ApiDemos/res/layout/spinner_1.xml +51 -0
- data/ApiDemos/res/layout/split_touch_view.xml +42 -0
- data/ApiDemos/res/layout/status_bar_balloon.xml +32 -0
- data/ApiDemos/res/layout/status_bar_notifications.xml +157 -0
- data/ApiDemos/res/layout/styled_text.xml +52 -0
- data/ApiDemos/res/layout/surface_view_overlay.xml +84 -0
- data/ApiDemos/res/layout/switches.xml +82 -0
- data/ApiDemos/res/layout/table_layout_1.xml +56 -0
- data/ApiDemos/res/layout/table_layout_10.xml +58 -0
- data/ApiDemos/res/layout/table_layout_11.xml +93 -0
- data/ApiDemos/res/layout/table_layout_12.xml +85 -0
- data/ApiDemos/res/layout/table_layout_2.xml +40 -0
- data/ApiDemos/res/layout/table_layout_3.xml +62 -0
- data/ApiDemos/res/layout/table_layout_4.xml +42 -0
- data/ApiDemos/res/layout/table_layout_5.xml +82 -0
- data/ApiDemos/res/layout/table_layout_6.xml +92 -0
- data/ApiDemos/res/layout/table_layout_7.xml +106 -0
- data/ApiDemos/res/layout/table_layout_8.xml +87 -0
- data/ApiDemos/res/layout/table_layout_9.xml +92 -0
- data/ApiDemos/res/layout/tabs1.xml +39 -0
- data/ApiDemos/res/layout/tabs_right_gravity.xml +37 -0
- data/ApiDemos/res/layout/tabs_scroll.xml +41 -0
- data/ApiDemos/res/layout/tasklist_main.xml +47 -0
- data/ApiDemos/res/layout/tasklist_row.xml +38 -0
- data/ApiDemos/res/layout/text_switcher_1.xml +31 -0
- data/ApiDemos/res/layout/text_to_speech.xml +26 -0
- data/ApiDemos/res/layout/translucent_background.xml +24 -0
- data/ApiDemos/res/layout/videoview.xml +14 -0
- data/ApiDemos/res/layout/visibility_1.xml +71 -0
- data/ApiDemos/res/layout/voice_recognition.xml +61 -0
- data/ApiDemos/res/layout/wallpaper_2.xml +27 -0
- data/ApiDemos/res/layout/webview_1.xml +79 -0
- data/ApiDemos/res/menu/action_bar_settings_action_provider.xml +28 -0
- data/ApiDemos/res/menu/action_bar_share_action_provider.xml +28 -0
- data/ApiDemos/res/menu/actions.xml +48 -0
- data/ApiDemos/res/menu/camera_menu.xml +5 -0
- data/ApiDemos/res/menu/category_order.xml +57 -0
- data/ApiDemos/res/menu/checkable.xml +91 -0
- data/ApiDemos/res/menu/disabled.xml +55 -0
- data/ApiDemos/res/menu/display_options_actions.xml +19 -0
- data/ApiDemos/res/menu/groups.xml +45 -0
- data/ApiDemos/res/menu/list_select_menu.xml +22 -0
- data/ApiDemos/res/menu/order.xml +38 -0
- data/ApiDemos/res/menu/popup.xml +32 -0
- data/ApiDemos/res/menu/searchview_in_menu.xml +22 -0
- data/ApiDemos/res/menu/shortcuts.xml +60 -0
- data/ApiDemos/res/menu/submenu.xml +44 -0
- data/ApiDemos/res/menu/title_icon.xml +31 -0
- data/ApiDemos/res/menu/title_only.xml +25 -0
- data/ApiDemos/res/menu/visible.xml +37 -0
- data/ApiDemos/res/raw/androids.pkm +0 -0
- data/ApiDemos/res/raw/robot.png +0 -0
- data/ApiDemos/res/raw/skycubemap0.jpg +0 -0
- data/ApiDemos/res/raw/skycubemap1.jpg +0 -0
- data/ApiDemos/res/raw/skycubemap2.jpg +0 -0
- data/ApiDemos/res/raw/skycubemap3.jpg +0 -0
- data/ApiDemos/res/raw/skycubemap4.jpg +0 -0
- data/ApiDemos/res/raw/skycubemap5.jpg +0 -0
- data/ApiDemos/res/raw/sound_ringer_normal.ogg +0 -0
- data/ApiDemos/res/raw/sound_ringer_silent.ogg +0 -0
- data/ApiDemos/res/raw/sound_ringer_vibrate.ogg +0 -0
- data/ApiDemos/res/raw/sound_screen_off.ogg +0 -0
- data/ApiDemos/res/raw/sound_screen_on.ogg +0 -0
- data/ApiDemos/res/raw/sound_view_clicked.ogg +0 -0
- data/ApiDemos/res/raw/sound_view_focused_or_selected.ogg +0 -0
- data/ApiDemos/res/raw/sound_view_hover_enter.ogg +0 -0
- data/ApiDemos/res/raw/sound_window_state_changed.ogg +0 -0
- data/ApiDemos/res/raw/test_cbr.mp3 +0 -0
- data/ApiDemos/res/values-hdpi/strings.xml +19 -0
- data/ApiDemos/res/values-ldpi/strings.xml +19 -0
- data/ApiDemos/res/values-mdpi/strings.xml +19 -0
- data/ApiDemos/res/values-sw600dp/layout.xml +22 -0
- data/ApiDemos/res/values-v11/bools.xml +20 -0
- data/ApiDemos/res/values-v11/styles.xml +29 -0
- data/ApiDemos/res/values-v13/bools.xml +20 -0
- data/ApiDemos/res/values-v14/bools.xml +20 -0
- data/ApiDemos/res/values-xhdpi/strings.xml +19 -0
- data/ApiDemos/res/values-xlarge/layout.xml +22 -0
- data/ApiDemos/res/values/arrays.xml +149 -0
- data/ApiDemos/res/values/attrs.xml +55 -0
- data/ApiDemos/res/values/bools.xml +32 -0
- data/ApiDemos/res/values/colors.xml +32 -0
- data/ApiDemos/res/values/ids.xml +19 -0
- data/ApiDemos/res/values/strings.xml +1342 -0
- data/ApiDemos/res/values/styles.xml +124 -0
- data/ApiDemos/res/xml/advanced_preferences.xml +38 -0
- data/ApiDemos/res/xml/appwidget_provider.xml +28 -0
- data/ApiDemos/res/xml/default_values.xml +44 -0
- data/ApiDemos/res/xml/device_admin_encryption.xml +34 -0
- data/ApiDemos/res/xml/device_admin_expiration.xml +53 -0
- data/ApiDemos/res/xml/device_admin_general.xml +40 -0
- data/ApiDemos/res/xml/device_admin_headers.xml +41 -0
- data/ApiDemos/res/xml/device_admin_lock_wipe.xml +50 -0
- data/ApiDemos/res/xml/device_admin_quality.xml +79 -0
- data/ApiDemos/res/xml/device_admin_sample.xml +30 -0
- data/ApiDemos/res/xml/filter_nfc.xml +28 -0
- data/ApiDemos/res/xml/fragmented_preferences.xml +97 -0
- data/ApiDemos/res/xml/fragmented_preferences_inner.xml +26 -0
- data/ApiDemos/res/xml/preference_dependencies.xml +35 -0
- data/ApiDemos/res/xml/preference_headers.xml +44 -0
- data/ApiDemos/res/xml/preference_switch +46 -0
- data/ApiDemos/res/xml/preferences.xml +101 -0
- data/ApiDemos/res/xml/searchable.xml +30 -0
- data/ApiDemos/res/xml/taskbackconfig.xml +24 -0
- data/ApiDemos/src/com/example/android/apis/ApiDemos.java +149 -0
- data/ApiDemos/src/com/example/android/apis/ApiDemosApplication.java +36 -0
- data/ApiDemos/src/com/example/android/apis/Shakespeare.java +223 -0
- data/ApiDemos/src/com/example/android/apis/accessibility/ClockBackActivity.java +55 -0
- data/ApiDemos/src/com/example/android/apis/accessibility/ClockBackService.java +575 -0
- data/ApiDemos/src/com/example/android/apis/accessibility/CustomViewAccessibilityActivity.java +280 -0
- data/ApiDemos/src/com/example/android/apis/accessibility/TaskBackService.java +191 -0
- data/ApiDemos/src/com/example/android/apis/accessibility/TaskListActivity.java +59 -0
- data/ApiDemos/src/com/example/android/apis/accessibility/TaskListView.java +119 -0
- data/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java +148 -0
- data/ApiDemos/src/com/example/android/apis/animation/AnimationLoading.java +165 -0
- data/ApiDemos/src/com/example/android/apis/animation/AnimationSeeking.java +173 -0
- data/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java +237 -0
- data/ApiDemos/src/com/example/android/apis/animation/BouncingBalls.java +184 -0
- data/ApiDemos/src/com/example/android/apis/animation/CustomEvaluator.java +174 -0
- data/ApiDemos/src/com/example/android/apis/animation/FixedGridLayout.java +108 -0
- data/ApiDemos/src/com/example/android/apis/animation/LayoutAnimations.java +210 -0
- data/ApiDemos/src/com/example/android/apis/animation/LayoutAnimationsByDefault.java +61 -0
- data/ApiDemos/src/com/example/android/apis/animation/LayoutAnimationsHideShow.java +178 -0
- data/ApiDemos/src/com/example/android/apis/animation/ListFlipper.java +126 -0
- data/ApiDemos/src/com/example/android/apis/animation/MultiPropertyAnimation.java +178 -0
- data/ApiDemos/src/com/example/android/apis/animation/ReversingAnimation.java +135 -0
- data/ApiDemos/src/com/example/android/apis/animation/Rotate3dAnimation.java +92 -0
- data/ApiDemos/src/com/example/android/apis/animation/ShapeHolder.java +100 -0
- data/ApiDemos/src/com/example/android/apis/animation/Transition3d.java +175 -0
- data/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java +124 -0
- data/ApiDemos/src/com/example/android/apis/app/ActionBarMechanics.java +73 -0
- data/ApiDemos/src/com/example/android/apis/app/ActionBarSettingsActionProviderActivity.java +112 -0
- data/ApiDemos/src/com/example/android/apis/app/ActionBarShareActionProviderActivity.java +125 -0
- data/ApiDemos/src/com/example/android/apis/app/ActionBarTabs.java +131 -0
- data/ApiDemos/src/com/example/android/apis/app/ActionBarUsage.java +93 -0
- data/ApiDemos/src/com/example/android/apis/app/ActivityRecreate.java +73 -0
- data/ApiDemos/src/com/example/android/apis/app/AlarmController.java +168 -0
- data/ApiDemos/src/com/example/android/apis/app/AlarmService.java +89 -0
- data/ApiDemos/src/com/example/android/apis/app/AlarmService_Service.java +131 -0
- data/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java +423 -0
- data/ApiDemos/src/com/example/android/apis/app/Animation.java +74 -0
- data/ApiDemos/src/com/example/android/apis/app/AppUpdateReceiver.java +34 -0
- data/ApiDemos/src/com/example/android/apis/app/ContactsFilter.java +53 -0
- data/ApiDemos/src/com/example/android/apis/app/ContactsFilterInstrumentation.java +73 -0
- data/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java +86 -0
- data/ApiDemos/src/com/example/android/apis/app/CustomDialogActivity.java +48 -0
- data/ApiDemos/src/com/example/android/apis/app/CustomTitle.java +85 -0
- data/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java +938 -0
- data/ApiDemos/src/com/example/android/apis/app/DialogActivity.java +86 -0
- data/ApiDemos/src/com/example/android/apis/app/ForegroundService.java +240 -0
- data/ApiDemos/src/com/example/android/apis/app/ForwardTarget.java +41 -0
- data/ApiDemos/src/com/example/android/apis/app/Forwarding.java +85 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentAlertDialog.java +109 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentArguments.java +108 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentContextMenu.java +77 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentCustomAnimations.java +131 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentDialog.java +168 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentDialogOrActivity.java +82 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentHideShow.java +113 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java +220 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentListArray.java +60 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentMenu.java +132 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentReceiveResult.java +133 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentRetainInstance.java +232 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentStack.java +124 -0
- data/ApiDemos/src/com/example/android/apis/app/FragmentTabs.java +118 -0
- data/ApiDemos/src/com/example/android/apis/app/HelloWorld.java +66 -0
- data/ApiDemos/src/com/example/android/apis/app/IRemoteService.aidl +37 -0
- data/ApiDemos/src/com/example/android/apis/app/IRemoteServiceCallback.aidl +29 -0
- data/ApiDemos/src/com/example/android/apis/app/ISecondary.aidl +36 -0
- data/ApiDemos/src/com/example/android/apis/app/IncomingMessage.java +197 -0
- data/ApiDemos/src/com/example/android/apis/app/IncomingMessageInterstitial.java +64 -0
- data/ApiDemos/src/com/example/android/apis/app/IncomingMessageView.java +59 -0
- data/ApiDemos/src/com/example/android/apis/app/IntentActivityFlags.java +86 -0
- data/ApiDemos/src/com/example/android/apis/app/Intents.java +47 -0
- data/ApiDemos/src/com/example/android/apis/app/LauncherShortcuts.java +141 -0
- data/ApiDemos/src/com/example/android/apis/app/LoaderCursor.java +177 -0
- data/ApiDemos/src/com/example/android/apis/app/LoaderCustom.java +482 -0
- data/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.java +512 -0
- data/ApiDemos/src/com/example/android/apis/app/LocalSample.java +53 -0
- data/ApiDemos/src/com/example/android/apis/app/LocalSampleInstrumentation.java +92 -0
- data/ApiDemos/src/com/example/android/apis/app/LocalService.java +120 -0
- data/ApiDemos/src/com/example/android/apis/app/LocalServiceActivities.java +171 -0
- data/ApiDemos/src/com/example/android/apis/app/MenuInflateFromXml.java +174 -0
- data/ApiDemos/src/com/example/android/apis/app/MessengerService.java +169 -0
- data/ApiDemos/src/com/example/android/apis/app/MessengerServiceActivities.java +178 -0
- data/ApiDemos/src/com/example/android/apis/app/NotificationDisplay.java +82 -0
- data/ApiDemos/src/com/example/android/apis/app/NotifyWithText.java +80 -0
- data/ApiDemos/src/com/example/android/apis/app/NotifyingController.java +61 -0
- data/ApiDemos/src/com/example/android/apis/app/NotifyingService.java +128 -0
- data/ApiDemos/src/com/example/android/apis/app/OneShotAlarm.java +42 -0
- data/ApiDemos/src/com/example/android/apis/app/PersistentState.java +128 -0
- data/ApiDemos/src/com/example/android/apis/app/QuickContactsDemo.java +104 -0
- data/ApiDemos/src/com/example/android/apis/app/ReceiveResult.java +153 -0
- data/ApiDemos/src/com/example/android/apis/app/RedirectEnter.java +59 -0
- data/ApiDemos/src/com/example/android/apis/app/RedirectGetter.java +87 -0
- data/ApiDemos/src/com/example/android/apis/app/RedirectMain.java +122 -0
- data/ApiDemos/src/com/example/android/apis/app/RemoteService.java +652 -0
- data/ApiDemos/src/com/example/android/apis/app/ReorderFour.java +46 -0
- data/ApiDemos/src/com/example/android/apis/app/ReorderOnLaunch.java +44 -0
- data/ApiDemos/src/com/example/android/apis/app/ReorderThree.java +44 -0
- data/ApiDemos/src/com/example/android/apis/app/ReorderTwo.java +44 -0
- data/ApiDemos/src/com/example/android/apis/app/RepeatingAlarm.java +40 -0
- data/ApiDemos/src/com/example/android/apis/app/SaveRestoreState.java +98 -0
- data/ApiDemos/src/com/example/android/apis/app/ScreenOrientation.java +73 -0
- data/ApiDemos/src/com/example/android/apis/app/SearchInvoke.java +241 -0
- data/ApiDemos/src/com/example/android/apis/app/SearchQueryResults.java +118 -0
- data/ApiDemos/src/com/example/android/apis/app/SearchSuggestionSampleProvider.java +50 -0
- data/ApiDemos/src/com/example/android/apis/app/SendResult.java +81 -0
- data/ApiDemos/src/com/example/android/apis/app/ServiceStartArguments.java +272 -0
- data/ApiDemos/src/com/example/android/apis/app/SetWallpaperActivity.java +89 -0
- data/ApiDemos/src/com/example/android/apis/app/SoftInputModes.java +67 -0
- data/ApiDemos/src/com/example/android/apis/app/StatusBarNotifications.java +270 -0
- data/ApiDemos/src/com/example/android/apis/app/TextToSpeechActivity.java +136 -0
- data/ApiDemos/src/com/example/android/apis/app/TranslucentActivity.java +48 -0
- data/ApiDemos/src/com/example/android/apis/app/TranslucentBlurActivity.java +55 -0
- data/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.java +230 -0
- data/ApiDemos/src/com/example/android/apis/app/WallpaperActivity.java +48 -0
- data/ApiDemos/src/com/example/android/apis/appwidget/ExampleAppWidgetConfigure.java +134 -0
- data/ApiDemos/src/com/example/android/apis/appwidget/ExampleAppWidgetProvider.java +122 -0
- data/ApiDemos/src/com/example/android/apis/appwidget/ExampleBroadcastReceiver.java +56 -0
- data/ApiDemos/src/com/example/android/apis/content/ClipboardSample.java +144 -0
- data/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java +376 -0
- data/ApiDemos/src/com/example/android/apis/content/FileProvider.java +115 -0
- data/ApiDemos/src/com/example/android/apis/content/InstallApk.java +179 -0
- data/ApiDemos/src/com/example/android/apis/content/PickContact.java +114 -0
- data/ApiDemos/src/com/example/android/apis/content/ReadAsset.java +73 -0
- data/ApiDemos/src/com/example/android/apis/content/ResourcesLayoutReference.java +33 -0
- data/ApiDemos/src/com/example/android/apis/content/ResourcesSample.java +90 -0
- data/ApiDemos/src/com/example/android/apis/content/ResourcesSmallestWidth.java +33 -0
- data/ApiDemos/src/com/example/android/apis/content/ResourcesWidthAndHeight.java +33 -0
- data/ApiDemos/src/com/example/android/apis/content/StyledText.java +51 -0
- data/ApiDemos/src/com/example/android/apis/graphics/AlphaBitmap.java +91 -0
- data/ApiDemos/src/com/example/android/apis/graphics/AnimateDrawable.java +72 -0
- data/ApiDemos/src/com/example/android/apis/graphics/AnimateDrawables.java +67 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Arcs.java +118 -0
- data/ApiDemos/src/com/example/android/apis/graphics/BitmapDecode.java +144 -0
- data/ApiDemos/src/com/example/android/apis/graphics/BitmapMesh.java +130 -0
- data/ApiDemos/src/com/example/android/apis/graphics/BitmapPixels.java +161 -0
- data/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java +311 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Clipping.java +111 -0
- data/ApiDemos/src/com/example/android/apis/graphics/ColorFilters.java +180 -0
- data/ApiDemos/src/com/example/android/apis/graphics/ColorMatrixSample.java +122 -0
- data/ApiDemos/src/com/example/android/apis/graphics/ColorPickerDialog.java +233 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Compass.java +130 -0
- data/ApiDemos/src/com/example/android/apis/graphics/CompressedTextureActivity.java +157 -0
- data/ApiDemos/src/com/example/android/apis/graphics/CreateBitmap.java +126 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Cube.java +100 -0
- data/ApiDemos/src/com/example/android/apis/graphics/CubeMapActivity.java +416 -0
- data/ApiDemos/src/com/example/android/apis/graphics/CubeRenderer.java +108 -0
- data/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.java +220 -0
- data/ApiDemos/src/com/example/android/apis/graphics/DrawPoints.java +79 -0
- data/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.java +208 -0
- data/ApiDemos/src/com/example/android/apis/graphics/FrameBufferObjectActivity.java +282 -0
- data/ApiDemos/src/com/example/android/apis/graphics/GLES20Activity.java +72 -0
- data/ApiDemos/src/com/example/android/apis/graphics/GLES20TriangleRenderer.java +255 -0
- data/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceViewActivity.java +56 -0
- data/ApiDemos/src/com/example/android/apis/graphics/GradientDrawable1.java +31 -0
- data/ApiDemos/src/com/example/android/apis/graphics/GraphicsActivity.java +43 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Layers.java +65 -0
- data/ApiDemos/src/com/example/android/apis/graphics/MatrixPaletteActivity.java +52 -0
- data/ApiDemos/src/com/example/android/apis/graphics/MatrixPaletteRenderer.java +408 -0
- data/ApiDemos/src/com/example/android/apis/graphics/MeasureText.java +112 -0
- data/ApiDemos/src/com/example/android/apis/graphics/PathEffects.java +121 -0
- data/ApiDemos/src/com/example/android/apis/graphics/PathFillTypes.java +77 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Patterns.java +125 -0
- data/ApiDemos/src/com/example/android/apis/graphics/PictureLayout.java +161 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Pictures.java +81 -0
- data/ApiDemos/src/com/example/android/apis/graphics/PolyToPoly.java +107 -0
- data/ApiDemos/src/com/example/android/apis/graphics/ProxyDrawable.java +102 -0
- data/ApiDemos/src/com/example/android/apis/graphics/PurgeableBitmap.java +118 -0
- data/ApiDemos/src/com/example/android/apis/graphics/PurgeableBitmapView.java +116 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Regions.java +126 -0
- data/ApiDemos/src/com/example/android/apis/graphics/RoundRects.java +113 -0
- data/ApiDemos/src/com/example/android/apis/graphics/ScaleToFit.java +121 -0
- data/ApiDemos/src/com/example/android/apis/graphics/SensorTest.java +213 -0
- data/ApiDemos/src/com/example/android/apis/graphics/ShapeDrawable1.java +136 -0
- data/ApiDemos/src/com/example/android/apis/graphics/StaticTriangleRenderer.java +274 -0
- data/ApiDemos/src/com/example/android/apis/graphics/SurfaceViewOverlay.java +116 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Sweep.java +97 -0
- data/ApiDemos/src/com/example/android/apis/graphics/TextAlign.java +161 -0
- data/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.java +528 -0
- data/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.java +184 -0
- data/ApiDemos/src/com/example/android/apis/graphics/TranslucentGLSurfaceViewActivity.java +63 -0
- data/ApiDemos/src/com/example/android/apis/graphics/TriangleActivity.java +49 -0
- data/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.java +241 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Typefaces.java +55 -0
- data/ApiDemos/src/com/example/android/apis/graphics/UnicodeChart.java +119 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Vertices.java +103 -0
- data/ApiDemos/src/com/example/android/apis/graphics/WindowSurface.java +271 -0
- data/ApiDemos/src/com/example/android/apis/graphics/Xfermodes.java +171 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/Cube.java +57 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/GLColor.java +51 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/GLFace.java +94 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/GLShape.java +102 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/GLVertex.java +89 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/GLWorld.java +98 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/Kube.java +342 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/KubeRenderer.java +116 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/Layer.java +101 -0
- data/ApiDemos/src/com/example/android/apis/graphics/kube/M4.java +80 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/Grid.java +140 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java +411 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/MatrixGrabber.java +63 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/MatrixStack.java +179 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/MatrixTrackingGL.java +1086 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/NumericSprite.java +99 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/Projector.java +84 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/SpriteTextActivity.java +52 -0
- data/ApiDemos/src/com/example/android/apis/graphics/spritetext/SpriteTextRenderer.java +354 -0
- data/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.java +252 -0
- data/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo.java +102 -0
- data/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Audio.java +102 -0
- data/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Video.java +219 -0
- data/ApiDemos/src/com/example/android/apis/media/VideoViewDemo.java +61 -0
- data/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.java +93 -0
- data/ApiDemos/src/com/example/android/apis/nfc/ForegroundNdefPush.java +86 -0
- data/ApiDemos/src/com/example/android/apis/nfc/TechFilter.java +51 -0
- data/ApiDemos/src/com/example/android/apis/os/MorseCode.java +93 -0
- data/ApiDemos/src/com/example/android/apis/os/MorseCodeConverter.java +141 -0
- data/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.java +216 -0
- data/ApiDemos/src/com/example/android/apis/os/Sensors.java +241 -0
- data/ApiDemos/src/com/example/android/apis/os/SmsMessageReceiver.java +78 -0
- data/ApiDemos/src/com/example/android/apis/os/SmsMessagingDemo.java +159 -0
- data/ApiDemos/src/com/example/android/apis/os/SmsReceivedDialog.java +115 -0
- data/ApiDemos/src/com/example/android/apis/preference/AdvancedPreferences.java +94 -0
- data/ApiDemos/src/com/example/android/apis/preference/DefaultValues.java +61 -0
- data/ApiDemos/src/com/example/android/apis/preference/FragmentPreferences.java +52 -0
- data/ApiDemos/src/com/example/android/apis/preference/LaunchingPreferences.java +100 -0
- data/ApiDemos/src/com/example/android/apis/preference/MyPreference.java +171 -0
- data/ApiDemos/src/com/example/android/apis/preference/PreferenceDependencies.java +33 -0
- data/ApiDemos/src/com/example/android/apis/preference/PreferenceWithHeaders.java +108 -0
- data/ApiDemos/src/com/example/android/apis/preference/PreferencesFromCode.java +151 -0
- data/ApiDemos/src/com/example/android/apis/preference/PreferencesFromXml.java +34 -0
- data/ApiDemos/src/com/example/android/apis/preference/SwitchPreference.java +38 -0
- data/ApiDemos/src/com/example/android/apis/text/Link.java +84 -0
- data/ApiDemos/src/com/example/android/apis/text/LogTextBox.java +64 -0
- data/ApiDemos/src/com/example/android/apis/text/LogTextBox1.java +50 -0
- data/ApiDemos/src/com/example/android/apis/text/Marquee.java +31 -0
- data/ApiDemos/src/com/example/android/apis/view/Animation1.java +45 -0
- data/ApiDemos/src/com/example/android/apis/view/Animation2.java +90 -0
- data/ApiDemos/src/com/example/android/apis/view/Animation3.java +101 -0
- data/ApiDemos/src/com/example/android/apis/view/AutoComplete1.java +82 -0
- data/ApiDemos/src/com/example/android/apis/view/AutoComplete2.java +41 -0
- data/ApiDemos/src/com/example/android/apis/view/AutoComplete3.java +43 -0
- data/ApiDemos/src/com/example/android/apis/view/AutoComplete4.java +103 -0
- data/ApiDemos/src/com/example/android/apis/view/AutoComplete5.java +44 -0
- data/ApiDemos/src/com/example/android/apis/view/AutoComplete6.java +83 -0
- data/ApiDemos/src/com/example/android/apis/view/Baseline1.java +35 -0
- data/ApiDemos/src/com/example/android/apis/view/Baseline2.java +35 -0
- data/ApiDemos/src/com/example/android/apis/view/Baseline3.java +36 -0
- data/ApiDemos/src/com/example/android/apis/view/Baseline4.java +35 -0
- data/ApiDemos/src/com/example/android/apis/view/Baseline6.java +35 -0
- data/ApiDemos/src/com/example/android/apis/view/Baseline7.java +35 -0
- data/ApiDemos/src/com/example/android/apis/view/BaselineNested1.java +36 -0
- data/ApiDemos/src/com/example/android/apis/view/BaselineNested2.java +36 -0
- data/ApiDemos/src/com/example/android/apis/view/BaselineNested3.java +36 -0
- data/ApiDemos/src/com/example/android/apis/view/Buttons1.java +36 -0
- data/ApiDemos/src/com/example/android/apis/view/CheckableFrameLayout.java +49 -0
- data/ApiDemos/src/com/example/android/apis/view/Cheeses.java +155 -0
- data/ApiDemos/src/com/example/android/apis/view/ChronometerDemo.java +90 -0
- data/ApiDemos/src/com/example/android/apis/view/Controls1.java +54 -0
- data/ApiDemos/src/com/example/android/apis/view/Controls2.java +19 -0
- data/ApiDemos/src/com/example/android/apis/view/Controls3.java +19 -0
- data/ApiDemos/src/com/example/android/apis/view/Controls4.java +19 -0
- data/ApiDemos/src/com/example/android/apis/view/Controls5.java +19 -0
- data/ApiDemos/src/com/example/android/apis/view/Controls6.java +19 -0
- data/ApiDemos/src/com/example/android/apis/view/CustomView1.java +40 -0
- data/ApiDemos/src/com/example/android/apis/view/DateWidgets1.java +156 -0
- data/ApiDemos/src/com/example/android/apis/view/DateWidgets2.java +68 -0
- data/ApiDemos/src/com/example/android/apis/view/DragAndDropDemo.java +72 -0
- data/ApiDemos/src/com/example/android/apis/view/DraggableDot.java +261 -0
- data/ApiDemos/src/com/example/android/apis/view/ExpandableList1.java +160 -0
- data/ApiDemos/src/com/example/android/apis/view/ExpandableList2.java +138 -0
- data/ApiDemos/src/com/example/android/apis/view/ExpandableList3.java +76 -0
- data/ApiDemos/src/com/example/android/apis/view/Focus1.java +47 -0
- data/ApiDemos/src/com/example/android/apis/view/Focus2.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/Focus3.java +45 -0
- data/ApiDemos/src/com/example/android/apis/view/Focus5.java +31 -0
- data/ApiDemos/src/com/example/android/apis/view/Gallery1.java +139 -0
- data/ApiDemos/src/com/example/android/apis/view/Gallery2.java +61 -0
- data/ApiDemos/src/com/example/android/apis/view/GameControllerInput.java +467 -0
- data/ApiDemos/src/com/example/android/apis/view/GameView.java +747 -0
- data/ApiDemos/src/com/example/android/apis/view/Grid1.java +95 -0
- data/ApiDemos/src/com/example/android/apis/view/Grid2.java +166 -0
- data/ApiDemos/src/com/example/android/apis/view/Grid3.java +164 -0
- data/ApiDemos/src/com/example/android/apis/view/GridLayout0.java +113 -0
- data/ApiDemos/src/com/example/android/apis/view/GridLayout1.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/HorizontalScrollView1.java +33 -0
- data/ApiDemos/src/com/example/android/apis/view/Hover.java +106 -0
- data/ApiDemos/src/com/example/android/apis/view/HoverInterceptorView.java +71 -0
- data/ApiDemos/src/com/example/android/apis/view/ImageButton1.java +33 -0
- data/ApiDemos/src/com/example/android/apis/view/ImageSwitcher1.java +120 -0
- data/ApiDemos/src/com/example/android/apis/view/ImageView1.java +36 -0
- data/ApiDemos/src/com/example/android/apis/view/InternalSelectionFocus.java +74 -0
- data/ApiDemos/src/com/example/android/apis/view/InternalSelectionScroll.java +64 -0
- data/ApiDemos/src/com/example/android/apis/view/InternalSelectionView.java +272 -0
- data/ApiDemos/src/com/example/android/apis/view/LabelView.java +194 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation1.java +81 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation2.java +64 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation3.java +44 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation4.java +81 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation5.java +81 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation6.java +81 -0
- data/ApiDemos/src/com/example/android/apis/view/LayoutAnimation7.java +31 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout1.java +37 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout10.java +37 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout2.java +37 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout3.java +37 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout4.java +38 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout5.java +38 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout6.java +38 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout7.java +38 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout8.java +106 -0
- data/ApiDemos/src/com/example/android/apis/view/LinearLayout9.java +41 -0
- data/ApiDemos/src/com/example/android/apis/view/List1.java +42 -0
- data/ApiDemos/src/com/example/android/apis/view/List10.java +49 -0
- data/ApiDemos/src/com/example/android/apis/view/List11.java +49 -0
- data/ApiDemos/src/com/example/android/apis/view/List12.java +83 -0
- data/ApiDemos/src/com/example/android/apis/view/List13.java +341 -0
- data/ApiDemos/src/com/example/android/apis/view/List14.java +141 -0
- data/ApiDemos/src/com/example/android/apis/view/List15.java +104 -0
- data/ApiDemos/src/com/example/android/apis/view/List16.java +100 -0
- data/ApiDemos/src/com/example/android/apis/view/List17.java +57 -0
- data/ApiDemos/src/com/example/android/apis/view/List2.java +57 -0
- data/ApiDemos/src/com/example/android/apis/view/List3.java +84 -0
- data/ApiDemos/src/com/example/android/apis/view/List4.java +154 -0
- data/ApiDemos/src/com/example/android/apis/view/List5.java +118 -0
- data/ApiDemos/src/com/example/android/apis/view/List6.java +410 -0
- data/ApiDemos/src/com/example/android/apis/view/List7.java +99 -0
- data/ApiDemos/src/com/example/android/apis/view/List8.java +133 -0
- data/ApiDemos/src/com/example/android/apis/view/List9.java +144 -0
- data/ApiDemos/src/com/example/android/apis/view/OverscanActivity.java +184 -0
- data/ApiDemos/src/com/example/android/apis/view/PopupMenu1.java +53 -0
- data/ApiDemos/src/com/example/android/apis/view/ProgressBar1.java +84 -0
- data/ApiDemos/src/com/example/android/apis/view/ProgressBar2.java +44 -0
- data/ApiDemos/src/com/example/android/apis/view/ProgressBar3.java +84 -0
- data/ApiDemos/src/com/example/android/apis/view/ProgressBar4.java +51 -0
- data/ApiDemos/src/com/example/android/apis/view/RadioGroup1.java +74 -0
- data/ApiDemos/src/com/example/android/apis/view/RatingBar1.java +74 -0
- data/ApiDemos/src/com/example/android/apis/view/RelativeLayout1.java +37 -0
- data/ApiDemos/src/com/example/android/apis/view/RelativeLayout2.java +38 -0
- data/ApiDemos/src/com/example/android/apis/view/RotatingButton.java +152 -0
- data/ApiDemos/src/com/example/android/apis/view/ScrollBar1.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/ScrollBar2.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/ScrollBar3.java +35 -0
- data/ApiDemos/src/com/example/android/apis/view/ScrollView1.java +37 -0
- data/ApiDemos/src/com/example/android/apis/view/ScrollView2.java +52 -0
- data/ApiDemos/src/com/example/android/apis/view/SearchViewActionBar.java +115 -0
- data/ApiDemos/src/com/example/android/apis/view/SearchViewAlwaysVisible.java +46 -0
- data/ApiDemos/src/com/example/android/apis/view/SearchViewFilterMode.java +78 -0
- data/ApiDemos/src/com/example/android/apis/view/SecureView.java +144 -0
- data/ApiDemos/src/com/example/android/apis/view/SecureViewOverlay.java +74 -0
- data/ApiDemos/src/com/example/android/apis/view/SeekBar1.java +60 -0
- data/ApiDemos/src/com/example/android/apis/view/Spinner1.java +78 -0
- data/ApiDemos/src/com/example/android/apis/view/SplitTouchView.java +66 -0
- data/ApiDemos/src/com/example/android/apis/view/Switches.java +48 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout1.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout10.java +31 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout11.java +34 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout12.java +34 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout2.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout3.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout4.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout5.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout6.java +32 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout7.java +80 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout8.java +71 -0
- data/ApiDemos/src/com/example/android/apis/view/TableLayout9.java +48 -0
- data/ApiDemos/src/com/example/android/apis/view/Tabs1.java +50 -0
- data/ApiDemos/src/com/example/android/apis/view/Tabs2.java +57 -0
- data/ApiDemos/src/com/example/android/apis/view/Tabs3.java +50 -0
- data/ApiDemos/src/com/example/android/apis/view/Tabs4.java +23 -0
- data/ApiDemos/src/com/example/android/apis/view/Tabs5.java +54 -0
- data/ApiDemos/src/com/example/android/apis/view/Tabs6.java +55 -0
- data/ApiDemos/src/com/example/android/apis/view/TextSwitcher1.java +79 -0
- data/ApiDemos/src/com/example/android/apis/view/Visibility1.java +74 -0
- data/ApiDemos/src/com/example/android/apis/view/WebView1.java +71 -0
- data/ApiDemos/tests/AndroidManifest.xml +37 -0
- data/ApiDemos/tests/ant.properties +18 -0
- data/ApiDemos/tests/build.xml +83 -0
- data/ApiDemos/tests/local.properties +10 -0
- data/ApiDemos/tests/proguard-project.txt +20 -0
- data/ApiDemos/tests/project.properties +14 -0
- data/ApiDemos/tests/src/com/example/android/apis/AllTests.java +53 -0
- data/ApiDemos/tests/src/com/example/android/apis/ApiDemosApplicationTests.java +62 -0
- data/ApiDemos/tests/src/com/example/android/apis/ApiDemosTest.java +40 -0
- data/ApiDemos/tests/src/com/example/android/apis/app/ForwardingTest.java +129 -0
- data/ApiDemos/tests/src/com/example/android/apis/app/LocalServiceTest.java +80 -0
- data/ApiDemos/tests/src/com/example/android/apis/os/MorseCodeConverterTest.java +54 -0
- data/ApiDemos/tests/src/com/example/android/apis/view/Focus2ActivityTest.java +111 -0
- data/ApiDemos/tests/src/com/example/android/apis/view/Focus2AndroidTest.java +113 -0
- data/ChangeLog +2 -0
- data/Gemfile +12 -0
- data/Guardfile +17 -0
- data/LICENSE +22 -0
- data/README.md +59 -0
- data/Rakefile +24 -0
- data/cucumber.yml +6 -0
- data/features/button.feature +16 -0
- data/features/checkbox.feature +9 -0
- data/features/list_item.feature +13 -0
- data/features/main_screen.feature +18 -0
- data/features/radio_button.feature +6 -0
- data/features/step_definitions/button_steps.rb +22 -0
- data/features/step_definitions/calabash_steps.rb +1 -0
- data/features/step_definitions/checkbox_steps.rb +3 -0
- data/features/step_definitions/controls_steps.rb +19 -0
- data/features/step_definitions/list_item_steps.rb +7 -0
- data/features/step_definitions/main_screen_steps.rb +22 -0
- data/features/step_definitions/radio_button_steps.rb +3 -0
- data/features/support/app_installation_hooks.rb +31 -0
- data/features/support/app_life_cycle_hooks.rb +28 -0
- data/features/support/env.rb +8 -0
- data/features/support/hooks.rb +18 -0
- data/features/support/screens/buttons_screen.rb +9 -0
- data/features/support/screens/controls_menu_screen.rb +8 -0
- data/features/support/screens/controls_screen.rb +11 -0
- data/features/support/screens/main_menu_screen.rb +15 -0
- data/features/support/screens/views_menu_screen.rb +40 -0
- data/features/text.feature +7 -0
- data/gametel.gemspec +23 -0
- data/irb_android.sh +2 -0
- data/lib/gametel.rb +55 -0
- data/lib/gametel/accessors.rb +98 -0
- data/lib/gametel/navigation.rb +9 -0
- data/lib/gametel/platforms/calabash.rb +89 -0
- data/lib/gametel/version.rb +3 -0
- data/spec/lib/gametel/accessors_spec.rb +67 -0
- data/spec/lib/gametel_spec.rb +44 -0
- data/spec/spec_helper.rb +19 -0
- metadata +1043 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package com.example.android.apis.app;
|
|
18
|
+
|
|
19
|
+
// Need the following import to get access to the app resources, since this
|
|
20
|
+
// class is in a sub-package.
|
|
21
|
+
import com.example.android.apis.R;
|
|
22
|
+
|
|
23
|
+
import android.app.Activity;
|
|
24
|
+
import android.content.Intent;
|
|
25
|
+
import android.text.Editable;
|
|
26
|
+
import android.os.Bundle;
|
|
27
|
+
import android.view.View;
|
|
28
|
+
import android.view.View.OnClickListener;
|
|
29
|
+
import android.widget.Button;
|
|
30
|
+
import android.widget.TextView;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Shows how an activity can send data to its launching activity when done.y.
|
|
34
|
+
* <p>This can be used, for example, to implement a dialog alowing the user to
|
|
35
|
+
pick an e-mail address or image -- the picking activity sends the selected
|
|
36
|
+
data back to the originating activity when done.</p>
|
|
37
|
+
|
|
38
|
+
<p>The example here is composed of two activities: ReceiveResult launches
|
|
39
|
+
the picking activity and receives its results; SendResult allows the user
|
|
40
|
+
to pick something and sends the selection back to its caller. Implementing
|
|
41
|
+
this functionality involves the
|
|
42
|
+
{@link android.app.Activity#setResult setResult()} method for sending a
|
|
43
|
+
result and
|
|
44
|
+
{@link android.app.Activity#onActivityResult onActivityResult()} to
|
|
45
|
+
receive it.</p>
|
|
46
|
+
|
|
47
|
+
<h4>Demo</h4>
|
|
48
|
+
App/Activity/Receive Result
|
|
49
|
+
|
|
50
|
+
<h4>Source files</h4>
|
|
51
|
+
<table class="LinkTable">
|
|
52
|
+
<tr>
|
|
53
|
+
<td class="LinkColumn">src/com.example.android.apis/app/ReceiveResult.java</td>
|
|
54
|
+
<td class="DescrColumn">Launches pick activity and receives its result</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td class="LinkColumn">src/com.example.android.apis/app/SendResult.java</td>
|
|
58
|
+
<td class="DescrColumn">Allows user to pick an option and sends it back to its caller</td>
|
|
59
|
+
</tr>
|
|
60
|
+
<tr>
|
|
61
|
+
<td class="LinkColumn">/res/any/layout/receive_result.xml</td>
|
|
62
|
+
<td class="DescrColumn">Defines contents of the ReceiveResult screen</td>
|
|
63
|
+
</tr>
|
|
64
|
+
<tr>
|
|
65
|
+
<td class="LinkColumn">/res/any/layout/send_result.xml</td>
|
|
66
|
+
<td class="DescrColumn">Defines contents of the SendResult screen</td>
|
|
67
|
+
</tr>
|
|
68
|
+
</table>
|
|
69
|
+
|
|
70
|
+
*/
|
|
71
|
+
public class ReceiveResult extends Activity {
|
|
72
|
+
/**
|
|
73
|
+
* Initialization of the Activity after it is first created. Must at least
|
|
74
|
+
* call {@link android.app.Activity#setContentView setContentView()} to
|
|
75
|
+
* describe what is to be displayed in the screen.
|
|
76
|
+
*/
|
|
77
|
+
@Override
|
|
78
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
79
|
+
// Be sure to call the super class.
|
|
80
|
+
super.onCreate(savedInstanceState);
|
|
81
|
+
|
|
82
|
+
// See assets/res/any/layout/hello_world.xml for this
|
|
83
|
+
// view layout definition, which is being set here as
|
|
84
|
+
// the content of our screen.
|
|
85
|
+
setContentView(R.layout.receive_result);
|
|
86
|
+
|
|
87
|
+
// Retrieve the TextView widget that will display results.
|
|
88
|
+
mResults = (TextView)findViewById(R.id.results);
|
|
89
|
+
|
|
90
|
+
// This allows us to later extend the text buffer.
|
|
91
|
+
mResults.setText(mResults.getText(), TextView.BufferType.EDITABLE);
|
|
92
|
+
|
|
93
|
+
// Watch for button clicks.
|
|
94
|
+
Button getButton = (Button)findViewById(R.id.get);
|
|
95
|
+
getButton.setOnClickListener(mGetListener);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* This method is called when the sending activity has finished, with the
|
|
100
|
+
* result it supplied.
|
|
101
|
+
*
|
|
102
|
+
* @param requestCode The original request code as given to
|
|
103
|
+
* startActivity().
|
|
104
|
+
* @param resultCode From sending activity as per setResult().
|
|
105
|
+
* @param data From sending activity as per setResult().
|
|
106
|
+
*/
|
|
107
|
+
@Override
|
|
108
|
+
protected void onActivityResult(int requestCode, int resultCode,
|
|
109
|
+
Intent data) {
|
|
110
|
+
// You can use the requestCode to select between multiple child
|
|
111
|
+
// activities you may have started. Here there is only one thing
|
|
112
|
+
// we launch.
|
|
113
|
+
if (requestCode == GET_CODE) {
|
|
114
|
+
|
|
115
|
+
// We will be adding to our text.
|
|
116
|
+
Editable text = (Editable)mResults.getText();
|
|
117
|
+
|
|
118
|
+
// This is a standard resultCode that is sent back if the
|
|
119
|
+
// activity doesn't supply an explicit result. It will also
|
|
120
|
+
// be returned if the activity failed to launch.
|
|
121
|
+
if (resultCode == RESULT_CANCELED) {
|
|
122
|
+
text.append("(cancelled)");
|
|
123
|
+
|
|
124
|
+
// Our protocol with the sending activity is that it will send
|
|
125
|
+
// text in 'data' as its result.
|
|
126
|
+
} else {
|
|
127
|
+
text.append("(okay ");
|
|
128
|
+
text.append(Integer.toString(resultCode));
|
|
129
|
+
text.append(") ");
|
|
130
|
+
if (data != null) {
|
|
131
|
+
text.append(data.getAction());
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
text.append("\n");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Definition of the one requestCode we use for receiving resuls.
|
|
140
|
+
static final private int GET_CODE = 0;
|
|
141
|
+
|
|
142
|
+
private OnClickListener mGetListener = new OnClickListener() {
|
|
143
|
+
public void onClick(View v) {
|
|
144
|
+
// Start the activity whose result we want to retrieve. The
|
|
145
|
+
// result will come back with request code GET_CODE.
|
|
146
|
+
Intent intent = new Intent(ReceiveResult.this, SendResult.class);
|
|
147
|
+
startActivityForResult(intent, GET_CODE);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
private TextView mResults;
|
|
152
|
+
}
|
|
153
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package com.example.android.apis.app;
|
|
18
|
+
|
|
19
|
+
// Need the following import to get access to the app resources, since this
|
|
20
|
+
// class is in a sub-package.
|
|
21
|
+
import com.example.android.apis.R;
|
|
22
|
+
|
|
23
|
+
import android.app.Activity;
|
|
24
|
+
import android.content.Intent;
|
|
25
|
+
import android.os.Bundle;
|
|
26
|
+
import android.view.View;
|
|
27
|
+
import android.view.View.OnClickListener;
|
|
28
|
+
import android.widget.Button;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Entry into our redirection example, describing what will happen.
|
|
33
|
+
*/
|
|
34
|
+
public class RedirectEnter extends Activity
|
|
35
|
+
{
|
|
36
|
+
@Override
|
|
37
|
+
protected void onCreate(Bundle savedInstanceState)
|
|
38
|
+
{
|
|
39
|
+
super.onCreate(savedInstanceState);
|
|
40
|
+
|
|
41
|
+
setContentView(R.layout.redirect_enter);
|
|
42
|
+
|
|
43
|
+
// Watch for button clicks.
|
|
44
|
+
Button goButton = (Button)findViewById(R.id.go);
|
|
45
|
+
goButton.setOnClickListener(mGoListener);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private OnClickListener mGoListener = new OnClickListener()
|
|
49
|
+
{
|
|
50
|
+
public void onClick(View v)
|
|
51
|
+
{
|
|
52
|
+
// Here we start up the main entry point of our redirection
|
|
53
|
+
// example.
|
|
54
|
+
Intent intent = new Intent(RedirectEnter.this, RedirectMain.class);
|
|
55
|
+
startActivity(intent);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package com.example.android.apis.app;
|
|
18
|
+
|
|
19
|
+
import com.example.android.apis.R;
|
|
20
|
+
|
|
21
|
+
import android.app.Activity;
|
|
22
|
+
import android.content.SharedPreferences;
|
|
23
|
+
import android.os.Bundle;
|
|
24
|
+
import android.view.View;
|
|
25
|
+
import android.view.View.OnClickListener;
|
|
26
|
+
import android.widget.Button;
|
|
27
|
+
import android.widget.TextView;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Sub-activity that is executed by the redirection example when input is needed
|
|
31
|
+
* from the user.
|
|
32
|
+
*/
|
|
33
|
+
public class RedirectGetter extends Activity
|
|
34
|
+
{
|
|
35
|
+
private String mTextPref;
|
|
36
|
+
private TextView mText;
|
|
37
|
+
|
|
38
|
+
@Override
|
|
39
|
+
protected void onCreate(Bundle savedInstanceState)
|
|
40
|
+
{
|
|
41
|
+
super.onCreate(savedInstanceState);
|
|
42
|
+
|
|
43
|
+
setContentView(R.layout.redirect_getter);
|
|
44
|
+
|
|
45
|
+
// Watch for button clicks.
|
|
46
|
+
Button applyButton = (Button)findViewById(R.id.apply);
|
|
47
|
+
applyButton.setOnClickListener(mApplyListener);
|
|
48
|
+
|
|
49
|
+
// The text being set.
|
|
50
|
+
mText = (TextView)findViewById(R.id.text);
|
|
51
|
+
|
|
52
|
+
// Display the stored values, or if not stored initialize with an empty String
|
|
53
|
+
loadPrefs();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private final void loadPrefs()
|
|
57
|
+
{
|
|
58
|
+
// Retrieve the current redirect values.
|
|
59
|
+
// NOTE: because this preference is shared between multiple
|
|
60
|
+
// activities, you must be careful about when you read or write
|
|
61
|
+
// it in order to keep from stepping on yourself.
|
|
62
|
+
SharedPreferences preferences = getSharedPreferences("RedirectData", 0);
|
|
63
|
+
|
|
64
|
+
mTextPref = preferences.getString("text", null);
|
|
65
|
+
if (mTextPref != null) {
|
|
66
|
+
mText.setText(mTextPref);
|
|
67
|
+
} else {
|
|
68
|
+
mText.setText("");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private OnClickListener mApplyListener = new OnClickListener()
|
|
73
|
+
{
|
|
74
|
+
public void onClick(View v)
|
|
75
|
+
{
|
|
76
|
+
SharedPreferences preferences = getSharedPreferences("RedirectData", 0);
|
|
77
|
+
SharedPreferences.Editor editor = preferences.edit();
|
|
78
|
+
editor.putString("text", mText.getText().toString());
|
|
79
|
+
|
|
80
|
+
if (editor.commit()) {
|
|
81
|
+
setResult(RESULT_OK);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
finish();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package com.example.android.apis.app;
|
|
18
|
+
|
|
19
|
+
import com.example.android.apis.R;
|
|
20
|
+
|
|
21
|
+
import android.app.Activity;
|
|
22
|
+
import android.content.Intent;
|
|
23
|
+
import android.content.SharedPreferences;
|
|
24
|
+
import android.os.Bundle;
|
|
25
|
+
import android.view.View;
|
|
26
|
+
import android.view.View.OnClickListener;
|
|
27
|
+
import android.widget.Button;
|
|
28
|
+
import android.widget.TextView;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Entry into our redirection example, describing what will happen.
|
|
32
|
+
*/
|
|
33
|
+
public class RedirectMain extends Activity {
|
|
34
|
+
static final int INIT_TEXT_REQUEST = 0;
|
|
35
|
+
static final int NEW_TEXT_REQUEST = 1;
|
|
36
|
+
|
|
37
|
+
@Override
|
|
38
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
39
|
+
super.onCreate(savedInstanceState);
|
|
40
|
+
|
|
41
|
+
setContentView(R.layout.redirect_main);
|
|
42
|
+
|
|
43
|
+
// Watch for button clicks.
|
|
44
|
+
Button clearButton = (Button)findViewById(R.id.clear);
|
|
45
|
+
clearButton.setOnClickListener(mClearListener);
|
|
46
|
+
Button newButton = (Button)findViewById(R.id.newView);
|
|
47
|
+
newButton.setOnClickListener(mNewListener);
|
|
48
|
+
|
|
49
|
+
// Retrieve the current text preference. If there is no text
|
|
50
|
+
// preference set, we need to get it from the user by invoking the
|
|
51
|
+
// activity that retrieves it. To do this cleanly, we will
|
|
52
|
+
// temporarily hide our own activity so it is not displayed until the
|
|
53
|
+
// result is returned.
|
|
54
|
+
if (!loadPrefs()) {
|
|
55
|
+
Intent intent = new Intent(this, RedirectGetter.class);
|
|
56
|
+
startActivityForResult(intent, INIT_TEXT_REQUEST);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Override
|
|
61
|
+
protected void onActivityResult(int requestCode, int resultCode,
|
|
62
|
+
Intent data) {
|
|
63
|
+
if (requestCode == INIT_TEXT_REQUEST) {
|
|
64
|
+
|
|
65
|
+
// If the request was cancelled, then we are cancelled as well.
|
|
66
|
+
if (resultCode == RESULT_CANCELED) {
|
|
67
|
+
finish();
|
|
68
|
+
|
|
69
|
+
// Otherwise, there now should be text... reload the prefs,
|
|
70
|
+
// and show our UI. (Optionally we could verify that the text
|
|
71
|
+
// is now set and exit if it isn't.)
|
|
72
|
+
} else {
|
|
73
|
+
loadPrefs();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
} else if (requestCode == NEW_TEXT_REQUEST) {
|
|
77
|
+
|
|
78
|
+
// In this case we are just changing the text, so if it was
|
|
79
|
+
// cancelled then we can leave things as-is.
|
|
80
|
+
if (resultCode != RESULT_CANCELED) {
|
|
81
|
+
loadPrefs();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private final boolean loadPrefs() {
|
|
88
|
+
// Retrieve the current redirect values.
|
|
89
|
+
// NOTE: because this preference is shared between multiple
|
|
90
|
+
// activities, you must be careful about when you read or write
|
|
91
|
+
// it in order to keep from stepping on yourself.
|
|
92
|
+
SharedPreferences preferences = getSharedPreferences("RedirectData", 0);
|
|
93
|
+
|
|
94
|
+
mTextPref = preferences.getString("text", null);
|
|
95
|
+
if (mTextPref != null) {
|
|
96
|
+
TextView text = (TextView)findViewById(R.id.text);
|
|
97
|
+
text.setText(mTextPref);
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
private OnClickListener mClearListener = new OnClickListener() {
|
|
105
|
+
public void onClick(View v) {
|
|
106
|
+
// Erase the preferences and exit!
|
|
107
|
+
SharedPreferences preferences = getSharedPreferences("RedirectData", 0);
|
|
108
|
+
preferences.edit().remove("text").commit();
|
|
109
|
+
finish();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
private OnClickListener mNewListener = new OnClickListener() {
|
|
114
|
+
public void onClick(View v) {
|
|
115
|
+
// Retrieve new text preferences.
|
|
116
|
+
Intent intent = new Intent(RedirectMain.this, RedirectGetter.class);
|
|
117
|
+
startActivityForResult(intent, NEW_TEXT_REQUEST);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
private String mTextPref;
|
|
122
|
+
}
|
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package com.example.android.apis.app;
|
|
18
|
+
|
|
19
|
+
import android.app.Activity;
|
|
20
|
+
import android.app.Notification;
|
|
21
|
+
import android.app.NotificationManager;
|
|
22
|
+
import android.app.PendingIntent;
|
|
23
|
+
import android.app.Service;
|
|
24
|
+
import android.content.ComponentName;
|
|
25
|
+
import android.content.Context;
|
|
26
|
+
import android.content.Intent;
|
|
27
|
+
import android.content.ServiceConnection;
|
|
28
|
+
import android.os.Bundle;
|
|
29
|
+
import android.os.RemoteException;
|
|
30
|
+
import android.os.Handler;
|
|
31
|
+
import android.os.IBinder;
|
|
32
|
+
import android.os.Message;
|
|
33
|
+
import android.os.Process;
|
|
34
|
+
import android.os.RemoteCallbackList;
|
|
35
|
+
import android.view.View;
|
|
36
|
+
import android.view.View.OnClickListener;
|
|
37
|
+
import android.widget.Button;
|
|
38
|
+
import android.widget.TextView;
|
|
39
|
+
import android.widget.Toast;
|
|
40
|
+
|
|
41
|
+
// Need the following import to get access to the app resources, since this
|
|
42
|
+
// class is in a sub-package.
|
|
43
|
+
import com.example.android.apis.R;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* This is an example of implementing an application service that runs in a
|
|
47
|
+
* different process than the application. Because it can be in another
|
|
48
|
+
* process, we must use IPC to interact with it. The
|
|
49
|
+
* {@link Controller} and {@link Binding} classes
|
|
50
|
+
* show how to interact with the service.
|
|
51
|
+
*
|
|
52
|
+
* <p>Note that most applications <strong>do not</strong> need to deal with
|
|
53
|
+
* the complexity shown here. If your application simply has a service
|
|
54
|
+
* running in its own process, the {@link LocalService} sample shows a much
|
|
55
|
+
* simpler way to interact with it.
|
|
56
|
+
*/
|
|
57
|
+
public class RemoteService extends Service {
|
|
58
|
+
/**
|
|
59
|
+
* This is a list of callbacks that have been registered with the
|
|
60
|
+
* service. Note that this is package scoped (instead of private) so
|
|
61
|
+
* that it can be accessed more efficiently from inner classes.
|
|
62
|
+
*/
|
|
63
|
+
final RemoteCallbackList<IRemoteServiceCallback> mCallbacks
|
|
64
|
+
= new RemoteCallbackList<IRemoteServiceCallback>();
|
|
65
|
+
|
|
66
|
+
int mValue = 0;
|
|
67
|
+
NotificationManager mNM;
|
|
68
|
+
|
|
69
|
+
@Override
|
|
70
|
+
public void onCreate() {
|
|
71
|
+
mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
|
|
72
|
+
|
|
73
|
+
// Display a notification about us starting.
|
|
74
|
+
showNotification();
|
|
75
|
+
|
|
76
|
+
// While this service is running, it will continually increment a
|
|
77
|
+
// number. Send the first message that is used to perform the
|
|
78
|
+
// increment.
|
|
79
|
+
mHandler.sendEmptyMessage(REPORT_MSG);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@Override
|
|
83
|
+
public void onDestroy() {
|
|
84
|
+
// Cancel the persistent notification.
|
|
85
|
+
mNM.cancel(R.string.remote_service_started);
|
|
86
|
+
|
|
87
|
+
// Tell the user we stopped.
|
|
88
|
+
Toast.makeText(this, R.string.remote_service_stopped, Toast.LENGTH_SHORT).show();
|
|
89
|
+
|
|
90
|
+
// Unregister all callbacks.
|
|
91
|
+
mCallbacks.kill();
|
|
92
|
+
|
|
93
|
+
// Remove the next pending message to increment the counter, stopping
|
|
94
|
+
// the increment loop.
|
|
95
|
+
mHandler.removeMessages(REPORT_MSG);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@Override
|
|
100
|
+
public IBinder onBind(Intent intent) {
|
|
101
|
+
// Select the interface to return. If your service only implements
|
|
102
|
+
// a single interface, you can just return it here without checking
|
|
103
|
+
// the Intent.
|
|
104
|
+
if (IRemoteService.class.getName().equals(intent.getAction())) {
|
|
105
|
+
return mBinder;
|
|
106
|
+
}
|
|
107
|
+
if (ISecondary.class.getName().equals(intent.getAction())) {
|
|
108
|
+
return mSecondaryBinder;
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The IRemoteInterface is defined through IDL
|
|
115
|
+
*/
|
|
116
|
+
private final IRemoteService.Stub mBinder = new IRemoteService.Stub() {
|
|
117
|
+
public void registerCallback(IRemoteServiceCallback cb) {
|
|
118
|
+
if (cb != null) mCallbacks.register(cb);
|
|
119
|
+
}
|
|
120
|
+
public void unregisterCallback(IRemoteServiceCallback cb) {
|
|
121
|
+
if (cb != null) mCallbacks.unregister(cb);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A secondary interface to the service.
|
|
127
|
+
*/
|
|
128
|
+
private final ISecondary.Stub mSecondaryBinder = new ISecondary.Stub() {
|
|
129
|
+
public int getPid() {
|
|
130
|
+
return Process.myPid();
|
|
131
|
+
}
|
|
132
|
+
public void basicTypes(int anInt, long aLong, boolean aBoolean,
|
|
133
|
+
float aFloat, double aDouble, String aString) {
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@Override
|
|
139
|
+
public void onTaskRemoved(Intent rootIntent) {
|
|
140
|
+
Toast.makeText(this, "Task removed: " + rootIntent, Toast.LENGTH_LONG).show();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
private static final int REPORT_MSG = 1;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Our Handler used to execute operations on the main thread. This is used
|
|
147
|
+
* to schedule increments of our value.
|
|
148
|
+
*/
|
|
149
|
+
private final Handler mHandler = new Handler() {
|
|
150
|
+
@Override public void handleMessage(Message msg) {
|
|
151
|
+
switch (msg.what) {
|
|
152
|
+
|
|
153
|
+
// It is time to bump the value!
|
|
154
|
+
case REPORT_MSG: {
|
|
155
|
+
// Up it goes.
|
|
156
|
+
int value = ++mValue;
|
|
157
|
+
|
|
158
|
+
// Broadcast to all clients the new value.
|
|
159
|
+
final int N = mCallbacks.beginBroadcast();
|
|
160
|
+
for (int i=0; i<N; i++) {
|
|
161
|
+
try {
|
|
162
|
+
mCallbacks.getBroadcastItem(i).valueChanged(value);
|
|
163
|
+
} catch (RemoteException e) {
|
|
164
|
+
// The RemoteCallbackList will take care of removing
|
|
165
|
+
// the dead object for us.
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
mCallbacks.finishBroadcast();
|
|
169
|
+
|
|
170
|
+
// Repeat every 1 second.
|
|
171
|
+
sendMessageDelayed(obtainMessage(REPORT_MSG), 1*1000);
|
|
172
|
+
} break;
|
|
173
|
+
default:
|
|
174
|
+
super.handleMessage(msg);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Show a notification while this service is running.
|
|
181
|
+
*/
|
|
182
|
+
private void showNotification() {
|
|
183
|
+
// In this sample, we'll use the same text for the ticker and the expanded notification
|
|
184
|
+
CharSequence text = getText(R.string.remote_service_started);
|
|
185
|
+
|
|
186
|
+
// Set the icon, scrolling text and timestamp
|
|
187
|
+
Notification notification = new Notification(R.drawable.stat_sample, text,
|
|
188
|
+
System.currentTimeMillis());
|
|
189
|
+
|
|
190
|
+
// The PendingIntent to launch our activity if the user selects this notification
|
|
191
|
+
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
|
|
192
|
+
new Intent(this, Controller.class), 0);
|
|
193
|
+
|
|
194
|
+
// Set the info for the views that show in the notification panel.
|
|
195
|
+
notification.setLatestEventInfo(this, getText(R.string.remote_service_label),
|
|
196
|
+
text, contentIntent);
|
|
197
|
+
|
|
198
|
+
// Send the notification.
|
|
199
|
+
// We use a string id because it is a unique number. We use it later to cancel.
|
|
200
|
+
mNM.notify(R.string.remote_service_started, notification);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ----------------------------------------------------------------------
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* <p>Example of explicitly starting and stopping the remove service.
|
|
207
|
+
* This demonstrates the implementation of a service that runs in a different
|
|
208
|
+
* process than the rest of the application, which is explicitly started and stopped
|
|
209
|
+
* as desired.</p>
|
|
210
|
+
*
|
|
211
|
+
* <p>Note that this is implemented as an inner class only keep the sample
|
|
212
|
+
* all together; typically this code would appear in some separate class.
|
|
213
|
+
*/
|
|
214
|
+
public static class Controller extends Activity {
|
|
215
|
+
@Override
|
|
216
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
217
|
+
super.onCreate(savedInstanceState);
|
|
218
|
+
|
|
219
|
+
setContentView(R.layout.remote_service_controller);
|
|
220
|
+
|
|
221
|
+
// Watch for button clicks.
|
|
222
|
+
Button button = (Button)findViewById(R.id.start);
|
|
223
|
+
button.setOnClickListener(mStartListener);
|
|
224
|
+
button = (Button)findViewById(R.id.stop);
|
|
225
|
+
button.setOnClickListener(mStopListener);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private OnClickListener mStartListener = new OnClickListener() {
|
|
229
|
+
public void onClick(View v) {
|
|
230
|
+
// Make sure the service is started. It will continue running
|
|
231
|
+
// until someone calls stopService().
|
|
232
|
+
// We use an action code here, instead of explictly supplying
|
|
233
|
+
// the component name, so that other packages can replace
|
|
234
|
+
// the service.
|
|
235
|
+
startService(new Intent(
|
|
236
|
+
"com.example.android.apis.app.REMOTE_SERVICE"));
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
private OnClickListener mStopListener = new OnClickListener() {
|
|
241
|
+
public void onClick(View v) {
|
|
242
|
+
// Cancel a previous call to startService(). Note that the
|
|
243
|
+
// service will not actually stop at this point if there are
|
|
244
|
+
// still bound clients.
|
|
245
|
+
stopService(new Intent(
|
|
246
|
+
"com.example.android.apis.app.REMOTE_SERVICE"));
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// ----------------------------------------------------------------------
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Example of binding and unbinding to the remote service.
|
|
255
|
+
* This demonstrates the implementation of a service which the client will
|
|
256
|
+
* bind to, interacting with it through an aidl interface.</p>
|
|
257
|
+
*
|
|
258
|
+
* <p>Note that this is implemented as an inner class only keep the sample
|
|
259
|
+
* all together; typically this code would appear in some separate class.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
public static class Binding extends Activity {
|
|
263
|
+
/** The primary interface we will be calling on the service. */
|
|
264
|
+
IRemoteService mService = null;
|
|
265
|
+
/** Another interface we use on the service. */
|
|
266
|
+
ISecondary mSecondaryService = null;
|
|
267
|
+
|
|
268
|
+
Button mKillButton;
|
|
269
|
+
TextView mCallbackText;
|
|
270
|
+
|
|
271
|
+
private boolean mIsBound;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Standard initialization of this activity. Set up the UI, then wait
|
|
275
|
+
* for the user to poke it before doing anything.
|
|
276
|
+
*/
|
|
277
|
+
@Override
|
|
278
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
279
|
+
super.onCreate(savedInstanceState);
|
|
280
|
+
|
|
281
|
+
setContentView(R.layout.remote_service_binding);
|
|
282
|
+
|
|
283
|
+
// Watch for button clicks.
|
|
284
|
+
Button button = (Button)findViewById(R.id.bind);
|
|
285
|
+
button.setOnClickListener(mBindListener);
|
|
286
|
+
button = (Button)findViewById(R.id.unbind);
|
|
287
|
+
button.setOnClickListener(mUnbindListener);
|
|
288
|
+
mKillButton = (Button)findViewById(R.id.kill);
|
|
289
|
+
mKillButton.setOnClickListener(mKillListener);
|
|
290
|
+
mKillButton.setEnabled(false);
|
|
291
|
+
|
|
292
|
+
mCallbackText = (TextView)findViewById(R.id.callback);
|
|
293
|
+
mCallbackText.setText("Not attached.");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Class for interacting with the main interface of the service.
|
|
298
|
+
*/
|
|
299
|
+
private ServiceConnection mConnection = new ServiceConnection() {
|
|
300
|
+
public void onServiceConnected(ComponentName className,
|
|
301
|
+
IBinder service) {
|
|
302
|
+
// This is called when the connection with the service has been
|
|
303
|
+
// established, giving us the service object we can use to
|
|
304
|
+
// interact with the service. We are communicating with our
|
|
305
|
+
// service through an IDL interface, so get a client-side
|
|
306
|
+
// representation of that from the raw service object.
|
|
307
|
+
mService = IRemoteService.Stub.asInterface(service);
|
|
308
|
+
mKillButton.setEnabled(true);
|
|
309
|
+
mCallbackText.setText("Attached.");
|
|
310
|
+
|
|
311
|
+
// We want to monitor the service for as long as we are
|
|
312
|
+
// connected to it.
|
|
313
|
+
try {
|
|
314
|
+
mService.registerCallback(mCallback);
|
|
315
|
+
} catch (RemoteException e) {
|
|
316
|
+
// In this case the service has crashed before we could even
|
|
317
|
+
// do anything with it; we can count on soon being
|
|
318
|
+
// disconnected (and then reconnected if it can be restarted)
|
|
319
|
+
// so there is no need to do anything here.
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// As part of the sample, tell the user what happened.
|
|
323
|
+
Toast.makeText(Binding.this, R.string.remote_service_connected,
|
|
324
|
+
Toast.LENGTH_SHORT).show();
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
public void onServiceDisconnected(ComponentName className) {
|
|
328
|
+
// This is called when the connection with the service has been
|
|
329
|
+
// unexpectedly disconnected -- that is, its process crashed.
|
|
330
|
+
mService = null;
|
|
331
|
+
mKillButton.setEnabled(false);
|
|
332
|
+
mCallbackText.setText("Disconnected.");
|
|
333
|
+
|
|
334
|
+
// As part of the sample, tell the user what happened.
|
|
335
|
+
Toast.makeText(Binding.this, R.string.remote_service_disconnected,
|
|
336
|
+
Toast.LENGTH_SHORT).show();
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Class for interacting with the secondary interface of the service.
|
|
342
|
+
*/
|
|
343
|
+
private ServiceConnection mSecondaryConnection = new ServiceConnection() {
|
|
344
|
+
public void onServiceConnected(ComponentName className,
|
|
345
|
+
IBinder service) {
|
|
346
|
+
// Connecting to a secondary interface is the same as any
|
|
347
|
+
// other interface.
|
|
348
|
+
mSecondaryService = ISecondary.Stub.asInterface(service);
|
|
349
|
+
mKillButton.setEnabled(true);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
public void onServiceDisconnected(ComponentName className) {
|
|
353
|
+
mSecondaryService = null;
|
|
354
|
+
mKillButton.setEnabled(false);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
private OnClickListener mBindListener = new OnClickListener() {
|
|
359
|
+
public void onClick(View v) {
|
|
360
|
+
// Establish a couple connections with the service, binding
|
|
361
|
+
// by interface names. This allows other applications to be
|
|
362
|
+
// installed that replace the remote service by implementing
|
|
363
|
+
// the same interface.
|
|
364
|
+
bindService(new Intent(IRemoteService.class.getName()),
|
|
365
|
+
mConnection, Context.BIND_AUTO_CREATE);
|
|
366
|
+
bindService(new Intent(ISecondary.class.getName()),
|
|
367
|
+
mSecondaryConnection, Context.BIND_AUTO_CREATE);
|
|
368
|
+
mIsBound = true;
|
|
369
|
+
mCallbackText.setText("Binding.");
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
private OnClickListener mUnbindListener = new OnClickListener() {
|
|
374
|
+
public void onClick(View v) {
|
|
375
|
+
if (mIsBound) {
|
|
376
|
+
// If we have received the service, and hence registered with
|
|
377
|
+
// it, then now is the time to unregister.
|
|
378
|
+
if (mService != null) {
|
|
379
|
+
try {
|
|
380
|
+
mService.unregisterCallback(mCallback);
|
|
381
|
+
} catch (RemoteException e) {
|
|
382
|
+
// There is nothing special we need to do if the service
|
|
383
|
+
// has crashed.
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Detach our existing connection.
|
|
388
|
+
unbindService(mConnection);
|
|
389
|
+
unbindService(mSecondaryConnection);
|
|
390
|
+
mKillButton.setEnabled(false);
|
|
391
|
+
mIsBound = false;
|
|
392
|
+
mCallbackText.setText("Unbinding.");
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
private OnClickListener mKillListener = new OnClickListener() {
|
|
398
|
+
public void onClick(View v) {
|
|
399
|
+
// To kill the process hosting our service, we need to know its
|
|
400
|
+
// PID. Conveniently our service has a call that will return
|
|
401
|
+
// to us that information.
|
|
402
|
+
if (mSecondaryService != null) {
|
|
403
|
+
try {
|
|
404
|
+
int pid = mSecondaryService.getPid();
|
|
405
|
+
// Note that, though this API allows us to request to
|
|
406
|
+
// kill any process based on its PID, the kernel will
|
|
407
|
+
// still impose standard restrictions on which PIDs you
|
|
408
|
+
// are actually able to kill. Typically this means only
|
|
409
|
+
// the process running your application and any additional
|
|
410
|
+
// processes created by that app as shown here; packages
|
|
411
|
+
// sharing a common UID will also be able to kill each
|
|
412
|
+
// other's processes.
|
|
413
|
+
Process.killProcess(pid);
|
|
414
|
+
mCallbackText.setText("Killed service process.");
|
|
415
|
+
} catch (RemoteException ex) {
|
|
416
|
+
// Recover gracefully from the process hosting the
|
|
417
|
+
// server dying.
|
|
418
|
+
// Just for purposes of the sample, put up a notification.
|
|
419
|
+
Toast.makeText(Binding.this,
|
|
420
|
+
R.string.remote_call_failed,
|
|
421
|
+
Toast.LENGTH_SHORT).show();
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// ----------------------------------------------------------------------
|
|
428
|
+
// Code showing how to deal with callbacks.
|
|
429
|
+
// ----------------------------------------------------------------------
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* This implementation is used to receive callbacks from the remote
|
|
433
|
+
* service.
|
|
434
|
+
*/
|
|
435
|
+
private IRemoteServiceCallback mCallback = new IRemoteServiceCallback.Stub() {
|
|
436
|
+
/**
|
|
437
|
+
* This is called by the remote service regularly to tell us about
|
|
438
|
+
* new values. Note that IPC calls are dispatched through a thread
|
|
439
|
+
* pool running in each process, so the code executing here will
|
|
440
|
+
* NOT be running in our main thread like most other things -- so,
|
|
441
|
+
* to update the UI, we need to use a Handler to hop over there.
|
|
442
|
+
*/
|
|
443
|
+
public void valueChanged(int value) {
|
|
444
|
+
mHandler.sendMessage(mHandler.obtainMessage(BUMP_MSG, value, 0));
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
private static final int BUMP_MSG = 1;
|
|
449
|
+
|
|
450
|
+
private Handler mHandler = new Handler() {
|
|
451
|
+
@Override public void handleMessage(Message msg) {
|
|
452
|
+
switch (msg.what) {
|
|
453
|
+
case BUMP_MSG:
|
|
454
|
+
mCallbackText.setText("Received from service: " + msg.arg1);
|
|
455
|
+
break;
|
|
456
|
+
default:
|
|
457
|
+
super.handleMessage(msg);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
// ----------------------------------------------------------------------
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Examples of behavior of different bind flags.</p>
|
|
469
|
+
*/
|
|
470
|
+
|
|
471
|
+
public static class BindingOptions extends Activity {
|
|
472
|
+
ServiceConnection mCurConnection;
|
|
473
|
+
TextView mCallbackText;
|
|
474
|
+
|
|
475
|
+
class MyServiceConnection implements ServiceConnection {
|
|
476
|
+
final boolean mUnbindOnDisconnect;
|
|
477
|
+
|
|
478
|
+
public MyServiceConnection() {
|
|
479
|
+
mUnbindOnDisconnect = false;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
public MyServiceConnection(boolean unbindOnDisconnect) {
|
|
483
|
+
mUnbindOnDisconnect = unbindOnDisconnect;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
public void onServiceConnected(ComponentName className,
|
|
487
|
+
IBinder service) {
|
|
488
|
+
if (mCurConnection != this) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
mCallbackText.setText("Attached.");
|
|
492
|
+
Toast.makeText(BindingOptions.this, R.string.remote_service_connected,
|
|
493
|
+
Toast.LENGTH_SHORT).show();
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
public void onServiceDisconnected(ComponentName className) {
|
|
497
|
+
if (mCurConnection != this) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
mCallbackText.setText("Disconnected.");
|
|
501
|
+
Toast.makeText(BindingOptions.this, R.string.remote_service_disconnected,
|
|
502
|
+
Toast.LENGTH_SHORT).show();
|
|
503
|
+
if (mUnbindOnDisconnect) {
|
|
504
|
+
unbindService(this);
|
|
505
|
+
mCurConnection = null;
|
|
506
|
+
Toast.makeText(BindingOptions.this, R.string.remote_service_unbind_disconn,
|
|
507
|
+
Toast.LENGTH_SHORT).show();
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Standard initialization of this activity. Set up the UI, then wait
|
|
514
|
+
* for the user to poke it before doing anything.
|
|
515
|
+
*/
|
|
516
|
+
@Override
|
|
517
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
518
|
+
super.onCreate(savedInstanceState);
|
|
519
|
+
|
|
520
|
+
setContentView(R.layout.remote_binding_options);
|
|
521
|
+
|
|
522
|
+
// Watch for button clicks.
|
|
523
|
+
Button button = (Button)findViewById(R.id.bind_normal);
|
|
524
|
+
button.setOnClickListener(mBindNormalListener);
|
|
525
|
+
button = (Button)findViewById(R.id.bind_not_foreground);
|
|
526
|
+
button.setOnClickListener(mBindNotForegroundListener);
|
|
527
|
+
button = (Button)findViewById(R.id.bind_above_client);
|
|
528
|
+
button.setOnClickListener(mBindAboveClientListener);
|
|
529
|
+
button = (Button)findViewById(R.id.bind_allow_oom);
|
|
530
|
+
button.setOnClickListener(mBindAllowOomListener);
|
|
531
|
+
button = (Button)findViewById(R.id.bind_waive_priority);
|
|
532
|
+
button.setOnClickListener(mBindWaivePriorityListener);
|
|
533
|
+
button = (Button)findViewById(R.id.bind_important);
|
|
534
|
+
button.setOnClickListener(mBindImportantListener);
|
|
535
|
+
button = (Button)findViewById(R.id.bind_with_activity);
|
|
536
|
+
button.setOnClickListener(mBindWithActivityListener);
|
|
537
|
+
button = (Button)findViewById(R.id.unbind);
|
|
538
|
+
button.setOnClickListener(mUnbindListener);
|
|
539
|
+
|
|
540
|
+
mCallbackText = (TextView)findViewById(R.id.callback);
|
|
541
|
+
mCallbackText.setText("Not attached.");
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
private OnClickListener mBindNormalListener = new OnClickListener() {
|
|
545
|
+
public void onClick(View v) {
|
|
546
|
+
if (mCurConnection != null) {
|
|
547
|
+
unbindService(mCurConnection);
|
|
548
|
+
mCurConnection = null;
|
|
549
|
+
}
|
|
550
|
+
ServiceConnection conn = new MyServiceConnection();
|
|
551
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
552
|
+
conn, Context.BIND_AUTO_CREATE)) {
|
|
553
|
+
mCurConnection = conn;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
private OnClickListener mBindNotForegroundListener = new OnClickListener() {
|
|
559
|
+
public void onClick(View v) {
|
|
560
|
+
if (mCurConnection != null) {
|
|
561
|
+
unbindService(mCurConnection);
|
|
562
|
+
mCurConnection = null;
|
|
563
|
+
}
|
|
564
|
+
ServiceConnection conn = new MyServiceConnection();
|
|
565
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
566
|
+
conn, Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND)) {
|
|
567
|
+
mCurConnection = conn;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
private OnClickListener mBindAboveClientListener = new OnClickListener() {
|
|
573
|
+
public void onClick(View v) {
|
|
574
|
+
if (mCurConnection != null) {
|
|
575
|
+
unbindService(mCurConnection);
|
|
576
|
+
mCurConnection = null;
|
|
577
|
+
}
|
|
578
|
+
ServiceConnection conn = new MyServiceConnection();
|
|
579
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
580
|
+
conn, Context.BIND_AUTO_CREATE | Context.BIND_ABOVE_CLIENT)) {
|
|
581
|
+
mCurConnection = conn;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
private OnClickListener mBindAllowOomListener = new OnClickListener() {
|
|
587
|
+
public void onClick(View v) {
|
|
588
|
+
if (mCurConnection != null) {
|
|
589
|
+
unbindService(mCurConnection);
|
|
590
|
+
mCurConnection = null;
|
|
591
|
+
}
|
|
592
|
+
ServiceConnection conn = new MyServiceConnection();
|
|
593
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
594
|
+
conn, Context.BIND_AUTO_CREATE | Context.BIND_ALLOW_OOM_MANAGEMENT)) {
|
|
595
|
+
mCurConnection = conn;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
private OnClickListener mBindWaivePriorityListener = new OnClickListener() {
|
|
601
|
+
public void onClick(View v) {
|
|
602
|
+
if (mCurConnection != null) {
|
|
603
|
+
unbindService(mCurConnection);
|
|
604
|
+
mCurConnection = null;
|
|
605
|
+
}
|
|
606
|
+
ServiceConnection conn = new MyServiceConnection(true);
|
|
607
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
608
|
+
conn, Context.BIND_AUTO_CREATE | Context.BIND_WAIVE_PRIORITY)) {
|
|
609
|
+
mCurConnection = conn;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
private OnClickListener mBindImportantListener = new OnClickListener() {
|
|
615
|
+
public void onClick(View v) {
|
|
616
|
+
if (mCurConnection != null) {
|
|
617
|
+
unbindService(mCurConnection);
|
|
618
|
+
mCurConnection = null;
|
|
619
|
+
}
|
|
620
|
+
ServiceConnection conn = new MyServiceConnection();
|
|
621
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
622
|
+
conn, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT)) {
|
|
623
|
+
mCurConnection = conn;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
private OnClickListener mBindWithActivityListener = new OnClickListener() {
|
|
629
|
+
public void onClick(View v) {
|
|
630
|
+
if (mCurConnection != null) {
|
|
631
|
+
unbindService(mCurConnection);
|
|
632
|
+
mCurConnection = null;
|
|
633
|
+
}
|
|
634
|
+
ServiceConnection conn = new MyServiceConnection();
|
|
635
|
+
if (bindService(new Intent(IRemoteService.class.getName()),
|
|
636
|
+
conn, Context.BIND_AUTO_CREATE | Context.BIND_ADJUST_WITH_ACTIVITY
|
|
637
|
+
| Context.BIND_WAIVE_PRIORITY)) {
|
|
638
|
+
mCurConnection = conn;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
private OnClickListener mUnbindListener = new OnClickListener() {
|
|
644
|
+
public void onClick(View v) {
|
|
645
|
+
if (mCurConnection != null) {
|
|
646
|
+
unbindService(mCurConnection);
|
|
647
|
+
mCurConnection = null;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
}
|