1 2<h3>Activity</h3> 3<dl> 4 <dt><a href="HelloWorld.html">Hello World</a></dt> 5 <dd>Demonstrates a basic screen activity. 6 <dl> 7 <dt>Code: 8 <dd> <a href="HelloWorld.html">HelloWorld.java</a> 9 <dt>Layout: 10 <dd> <a href="/guide/samples/ApiDemos/res/layout/hello_world.html"> 11 hello_world.xml</a> 12 </dl> 13 </dd> 14 <dt><a href="SaveRestoreState.html">Save & Restore State</a></dt> 15 <dd>Demonstrates how an activity should save state when it is paused.</dd> 16 17 <dt><a href="PersistentState.html">Persistent State</a></dt> 18 <dd>Demonstrates how you can save and restore preferences, which are stored 19 even after the user closes the application. </dd> 20 21 <dt><a href="ReceiveResult.html">Receive Result</a></dt> 22 <dd>Demonstrates how an activity screen can return a result to the 23 activity that opened it. </dd> 24 25 <dt><a href="Forwarding.html">Forwarding</a></dt> 26 <dd>Demonstrates opening a new activity and removing the current activity 27 from the history stack, so that when the user later presses BACK they will 28 not see the intermediate activity.</dd> 29 30 <dt><a href="RedirectEnter.html">Redirection</a></dt> 31 <dd>Demonstrates how to save data to preferences and use it to determine 32 which activity to open next.</dd> 33 34 <dt><a href="TranslucentActivity.html">Translucent</a></dt> 35 <dd>Demonstrates how to make an activity with a transparent background. </dd> 36 37 <dt><a href="TranslucentBlurActivity.html">TranslucentBlur</a></dt> 38 <dd>Demonstrates how to make an activity with a transparent background with 39 a special effect (blur). </dd> 40</dl> 41 42<h3>Service</h3> 43<dl> 44 <dt><a href="LocalServiceController.html">Local Service Controller</a></dt> 45 <dd>Starts and stops the service class 46 <a href="LocalService.html">LocalService</a> that runs in the same 47 process as the activity, to demonstrate a service's 48 lifecycle when using {@link android.content.Context#startService 49 Context.startService} and {@link android.content.Context#stopService 50 Context.stopService}.</dd> 51 52 <dt><a href="LocalServiceBinding.html">Local Service Binding</a></dt> 53 <dd>Demonstrates binding to a service class 54 <a href="LocalService.html">LocalService</a> that runs in the same 55 process as the activity, to demonstrate using the 56 {@link android.content.Context#bindService Context.bindService} and 57 {@link android.content.Context#unbindService Context.unindService} 58 methods with a service. This also shows how you can simplify working 59 with a service when you know it will only run in your own process.</dd> 60 61 <dt><a href="RemoteServiceController.html">Remote Service Controller</a></dt> 62 <dd>Demonstrates starting a service in a separate process, by assigning 63 <code>android:process=":remote"</code> to the service in the 64 AndroidManifest.xml file. </dd> 65 66 <dt><a href="RemoteServiceBinding.html">Remote Service Binding</a></dt> 67 <dd>Demonstrates binding to a remote service, similar to the Local Service 68 Binding sample, but illustrating the additional work (defining aidl 69 interfaces) needed to interact with a service in another process. Also 70 shows how a service can publish multiple interfaces and implement 71 callbacks to its clients.</dd> 72 73 <dt><a href="ServiceStartArgumentsController.html">Service Start Arguments Controller</a></dt> 74 <dd>Demonstrates how you can use a Service as a job queue, where you 75 submit jobs to it with {@link android.content.Context#startService 76 Context.startService} instead of binding to the service. Such a service 77 automatically stops itself once all jobs have been processed. This can be 78 a very convenient way to interact with a service when you do not need 79 a result back from it. 80 <dl> 81 <dt>Code: 82 <dd> <a href="ServiceStartArgumentsController.html">ServiceStartArgumentsController.java</a> 83 <dd> <a href="ServiceStartArguments.html">ServiceStartArguments.java</a> 84 <dt>Layout: 85 <dd> <a href="/guide/samples/ApiDemos/res/layout/service_start_arguments_controller.html"> 86 service_start_arguments_controller.xml</a> 87 </dl> 88 </dd> 89</dl> 90 91<h3>Alarm</h3> 92<dl> 93 <dt><a href="AlarmController.html">Alarm Controller</a></dt> 94 <dd>Demonstrates two ways you can schedule alarms: a one-shot alarm that 95 will happen once at a given time, and a repeating alarm that will happen 96 first at a given time and then continually trigger at regular intervals 97 after that. 98 <dl> 99 <dt>Code: 100 <dd> <a href="AlarmController.html">AlarmController.java</a> 101 <dd> <a href="OneShotAlarm.html">OneShotAlarm.java</a> 102 <dd> <a href="RepeatingAlarm.html">RepeatingAlarm.java</a> 103 <dt>Layout: 104 <dd> <a href="/guide/samples/ApiDemos/res/layout/alarm_controller.html"> 105 alarm_controller.xml</a> 106 </dl> 107 </dd> 108 109 <dt><a href="AlarmService.html">Alarm Service</a></dt> 110 <dd>Demonstrates how you can schedule an alarm that causes a service to 111 be started. This is useful when you want to schedule alarms that initiate 112 long-running operations, such as retrieving recent e-mails. 113 <dl> 114 <dt>Code: 115 <dd> <a href="AlarmService.html">AlarmService.java</a> 116 <dd> <a href="AlarmService_Service.html">AlarmService_Service.java</a> 117 <dt>Layout: 118 <dd> <a href="/guide/samples/ApiDemos/res/layout/alarm_service.html"> 119 alarm_service.xml</a> 120 </dl> 121 </dd> 122</dl> 123 124<h3>Notification</h3> 125<dl> 126 <dt><a href="NotifyWithText.html">NotifyWithText</a></dt> 127 <dd>Demonstrates popup notifications of varying length.</dd> 128 129 <dt><a href="IncomingMessage.html">IncomingMessage</a></dt> 130 <dd> Demonstrates sending persistent and transient notifications, with a View object in the notification. It also demonstrated inflating a View object from an XML layout resource. </dd> 131</dl> 132 133<h3>Search</h3> 134<dl> 135 <dt><a href="SearchInvoke.html">SearchInvoke</a></dt> 136 <dd>Demonstrates various ways in which activities can launch the Search UI.</dd> 137 138 <dt><a href="SearchQueryResults.html">SearchQueryResults</a></dt> 139 <dd>Demonstrates an activity that receives Search intents and handles them.</dd> 140 141 <dt><a href="SearchSuggestionSampleProvider.html">SearchSuggestionSampleProvider</a></dt> 142 <dd>Demonstrates how to configure and use the built-in "recent queries" suggestion provider.</dd> 143</dl> 144 145 146