diff options
| -rw-r--r-- | Android.mk | 3 | ||||
| -rw-r--r-- | core/java/android/hardware/Sensor.java | 67 | ||||
| -rw-r--r-- | core/java/android/hardware/SensorEventListener2.java | 13 | ||||
| -rw-r--r-- | core/java/android/hardware/SensorManager.java | 251 | ||||
| -rw-r--r-- | docs/html/about/versions/kitkat.jd | 2 | ||||
| -rw-r--r-- | docs/html/preview/index.html | 10 | ||||
| -rw-r--r-- | docs/html/robots.txt | 1 | ||||
| -rw-r--r-- | docs/html/samples/admin.jd | 11 | ||||
| -rw-r--r-- | docs/html/samples/new/index.jd | 134 | ||||
| -rw-r--r-- | docs/html/tools/sdk/ndk/index.jd | 155 | ||||
| -rw-r--r-- | docs/html/training/wearables/apps/creating.jd | 50 | ||||
| -rw-r--r-- | docs/html/training/wearables/data-layer/index.jd | 9 | ||||
| -rw-r--r-- | docs/html/training/wearables/ui/confirm.jd | 9 | ||||
| -rw-r--r-- | docs/html/training/wearables/ui/exit.jd | 6 | ||||
| -rw-r--r-- | docs/html/training/wearables/ui/layouts.jd | 2 | ||||
| -rw-r--r-- | docs/html/training/wearables/ui/lists.jd | 4 |
16 files changed, 414 insertions, 313 deletions
@@ -727,7 +727,8 @@ samples_dir := development/samples/browseable # Whitelist of valid groups, used for default TOC grouping. Each sample must # belong to one (and only one) group. Assign samples to groups by setting # a sample.group var to one of these groups in the sample's _index.jd. -sample_groups := -samplegroup Background \ +sample_groups := -samplegroup Admin \ + -samplegroup Background \ -samplegroup Connectivity \ -samplegroup Content \ -samplegroup Input \ diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java index f514e42..cf6a779 100644 --- a/core/java/android/hardware/Sensor.java +++ b/core/java/android/hardware/Sensor.java @@ -329,7 +329,11 @@ public final class Sensor { * A sensor of this type triggers an event each time a step is taken by the user. The only * allowed value to return is 1.0 and an event is generated for each step. Like with any other * event, the timestamp indicates when the event (here the step) occurred, this corresponds to - * when the foot hit the ground, generating a high variation in acceleration. + * when the foot hit the ground, generating a high variation in acceleration. This sensor is + * only for detecting every individual step as soon as it is taken, for example to perform dead + * reckoning. If you only need aggregate number of steps taken over a period of time, register + * for {@link #TYPE_STEP_COUNTER} instead. It is defined as a + * {@link Sensor#REPORTING_MODE_SPECIAL_TRIGGER} sensor. * <p> * See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details. */ @@ -349,7 +353,12 @@ public final class Sensor { * while activated. The value is returned as a float (with the fractional part set to zero) and * is reset to zero only on a system reboot. The timestamp of the event is set to the time when * the last step for that event was taken. This sensor is implemented in hardware and is - * expected to be low power. + * expected to be low power. If you want to continuously track the number of steps over a long + * period of time, do NOT unregister for this sensor, so that it keeps counting steps in the + * background even when the AP is in suspend mode and report the aggregate count when the AP + * is awake. Application needs to stay registered for this sensor because step counter does not + * count steps if it is not activated. This sensor is ideal for fitness tracking applications. + * It is defined as an {@link Sensor#REPORTING_MODE_ON_CHANGE} sensor. * <p> * See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details. */ @@ -750,31 +759,41 @@ public final class Sensor { } /** - * Returns whether this sensor is a wake-up sensor. + * Returns true if the sensor is a wake-up sensor. * <p> - * Wake up sensors wake the application processor up when they have events to deliver. When a - * wake up sensor is registered to without batching enabled, each event will wake the - * application processor up. - * <p> - * When a wake up sensor is registered to with batching enabled, it - * wakes the application processor up when maxReportingLatency has elapsed or when the hardware - * FIFO storing the events from wake up sensors is getting full. - * <p> - * Non-wake up sensors never wake the application processor up. Their events are only reported - * when the application processor is awake, for example because the application holds a wake - * lock, or another source woke the application processor up. + * <b>Application Processor Power modes</b> <p> + * Application Processor(AP), is the processor on which applications run. When no wake lock is held + * and the user is not interacting with the device, this processor can enter a “Suspend” mode, + * reducing the power consumption by 10 times or more. + * </p> * <p> - * When a non-wake up sensor is registered to without batching enabled, the measurements made - * while the application processor is asleep might be lost and never returned. + * <b>Non-wake-up sensors</b> <p> + * Non-wake-up sensors are sensors that do not wake the AP out of suspend to report data. While + * the AP is in suspend mode, the sensors continue to function and generate events, which are + * put in a hardware FIFO. The events in the FIFO are delivered to the application when the AP + * wakes up. If the FIFO was too small to store all events generated while the AP was in + * suspend mode, the older events are lost: the oldest data is dropped to accommodate the newer + * data. In the extreme case where the FIFO is non-existent {@code maxFifoEventCount() == 0}, + * all events generated while the AP was in suspend mode are lost. Applications using + * non-wake-up sensors should usually: + * <ul> + * <li>Either unregister from the sensors when they do not need them, usually in the activity’s + * {@code onPause} method. This is the most common case. + * <li>Or realize that the sensors are consuming some power while the AP is in suspend mode and + * that even then, some events might be lost. + * </ul> + * </p> * <p> - * When a non-wake up sensor is registered to with batching enabled, the measurements made while - * the application processor is asleep are stored in the hardware FIFO for non-wake up sensors. - * When this FIFO gets full, new events start overwriting older events. When the application - * then wakes up, the latest events are returned, and some old events might be lost. The number - * of events actually returned depends on the hardware FIFO size, as well as on what other - * sensors are activated. If losing sensor events is not acceptable during batching, you must - * use the wake-up version of the sensor. - * @return true if this is a wake up sensor, false otherwise. + * <b>Wake-up sensors</b> <p> + * In opposition to non-wake-up sensors, wake-up sensors ensure that their data is delivered + * independently of the state of the AP. While the AP is awake, the wake-up sensors behave + * like non-wake-up-sensors. When the AP is asleep, wake-up sensors wake up the AP to deliver + * events. That is, the AP will wake up and the sensor will deliver the events before the + * maximum reporting latency is elapsed or the hardware FIFO gets full. See {@link + * SensorManager#registerListener(SensorEventListener, Sensor, int, int)} for more details. + * </p> + * + * @return <code>true</code> if this is a wake-up sensor, <code>false</code> otherwise. */ public boolean isWakeUpSensor() { return (mFlags & SENSOR_FLAG_WAKE_UP_SENSOR) != 0; diff --git a/core/java/android/hardware/SensorEventListener2.java b/core/java/android/hardware/SensorEventListener2.java index 70eff08..fd3e62b 100644 --- a/core/java/android/hardware/SensorEventListener2.java +++ b/core/java/android/hardware/SensorEventListener2.java @@ -21,15 +21,16 @@ package android.hardware; */ public interface SensorEventListener2 extends SensorEventListener { /** - * Called after flush() is completed. All the events in the batch at the point when - * the flush was called have been delivered to the applications registered for those - * sensor events. Flush Complete Events are sent ONLY to the application that has - * explicitly called flush(). If the hardware FIFO is flushed due to some other - * application calling flush(), flush complete event is not delivered to this application. + * Called after flush() is completed. All the events in the batch at the point when the flush + * was called have been delivered to the applications registered for those sensor events. In + * {@link android.os.Build.VERSION_CODES#KITKAT}, applications may receive flush complete events + * even if some other application has called flush() on the same sensor. Starting with + * {@link android.os.Build.VERSION_CODES#LOLLIPOP}, flush Complete events are sent ONLY to the + * application that has explicitly called flush(). If the hardware FIFO is flushed due to some + * other application calling flush(), flush complete event is not delivered to this application. * <p> * * @param sensor The {@link android.hardware.Sensor Sensor} on which flush was called. - * * @see android.hardware.SensorManager#flush(SensorEventListener) */ public void onFlushCompleted(Sensor sensor); diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index cccd624..e4e5a8c 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -626,73 +626,90 @@ public abstract class SensorManager { protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor); /** - * Registers a {@link android.hardware.SensorEventListener - * SensorEventListener} for the given sensor. - * - * <p class="note"></p> - * Note: Don't use this method with a one shot trigger sensor such as - * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. - * Use {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. + * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given + * sensor at the given sampling frequency. + * <p> + * The events will be delivered to the provided {@code SensorEventListener} as soon as they are + * available. To reduce the power consumption, applications can use + * {@link #registerListener(SensorEventListener, Sensor, int, int)} instead and specify a + * positive non-zero maximum reporting latency. + * </p> + * <p> + * In the case of non-wake-up sensors, the events are only delivered while the Application + * Processor (AP) is not in suspend mode. See {@link Sensor#isWakeUpSensor()} for more details. + * To ensure delivery of events from non-wake-up sensors even when the screen is OFF, the + * application registering to the sensor must hold a partial wake-lock to keep the AP awake, + * otherwise some events might be lost while the AP is asleep. Note that although events might + * be lost while the AP is asleep, the sensor will still consume power if it is not explicitly + * deactivated by the application. Applications must unregister their {@code + * SensorEventListener}s in their activity's {@code onPause()} method to avoid consuming power + * while the device is inactive. See {@link #registerListener(SensorEventListener, Sensor, int, + * int)} for more details on hardware FIFO (queueing) capabilities and when some sensor events + * might be lost. + * </p> + * <p> + * In the case of wake-up sensors, each event generated by the sensor will cause the AP to + * wake-up, ensuring that each event can be delivered. Because of this, registering to a wake-up + * sensor has very significant power implications. Call {@link Sensor#isWakeUpSensor()} to check + * whether a sensor is a wake-up sensor. See + * {@link #registerListener(SensorEventListener, Sensor, int, int)} for information on how to + * reduce the power impact of registering to wake-up sensors. + * </p> + * <p class="note"> + * Note: Don't use this method with one-shot trigger sensors such as + * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. Use + * {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. Use + * {@link Sensor#getReportingMode()} to obtain the reporting mode of a given sensor. * </p> * - * @param listener - * A {@link android.hardware.SensorEventListener SensorEventListener} - * object. - * - * @param sensor - * The {@link android.hardware.Sensor Sensor} to register to. - * - * @param rateUs - * The rate {@link android.hardware.SensorEvent sensor events} are - * delivered at. This is only a hint to the system. Events may be - * received faster or slower than the specified rate. Usually events - * are received faster. The value must be one of - * {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI}, - * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST} - * or, the desired delay between events in microseconds. - * Specifying the delay in microseconds only works from Android - * 2.3 (API level 9) onwards. For earlier releases, you must use - * one of the {@code SENSOR_DELAY_*} constants. - * - * @return <code>true</code> if the sensor is supported and successfully - * enabled. - * + * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object. + * @param sensor The {@link android.hardware.Sensor Sensor} to register to. + * @param samplingPeriodUs The rate {@link android.hardware.SensorEvent sensor events} are + * delivered at. This is only a hint to the system. Events may be received faster or + * slower than the specified rate. Usually events are received faster. The value must + * be one of {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI}, + * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST} or, the desired delay + * between events in microseconds. Specifying the delay in microseconds only works + * from Android 2.3 (API level 9) onwards. For earlier releases, you must use one of + * the {@code SENSOR_DELAY_*} constants. + * @return <code>true</code> if the sensor is supported and successfully enabled. * @see #registerListener(SensorEventListener, Sensor, int, Handler) * @see #unregisterListener(SensorEventListener) * @see #unregisterListener(SensorEventListener, Sensor) - * */ - public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs) { - return registerListener(listener, sensor, rateUs, null); + public boolean registerListener(SensorEventListener listener, Sensor sensor, + int samplingPeriodUs) { + return registerListener(listener, sensor, samplingPeriodUs, null); } /** - * Enables batch mode for a sensor with the given rate and maxBatchReportLatency. If the - * underlying hardware does not support batch mode, this defaults to - * {@link #registerListener(SensorEventListener, Sensor, int)} and other parameters are - * ignored. In non-batch mode, all sensor events must be reported as soon as they are detected. - * While in batch mode, sensor events do not need to be reported as soon as they are detected. - * They can be temporarily stored in batches and reported in batches, as long as no event is - * delayed by more than "maxBatchReportLatency" microseconds. That is, all events since the - * previous batch are recorded and returned all at once. This allows to reduce the amount of - * interrupts sent to the SoC, and allows the SoC to switch to a lower power state (Idle) while - * the sensor is capturing and batching data. - * <p> - * Registering to a sensor in batch mode will not prevent the SoC from going to suspend mode. In - * this case, the sensor will continue to gather events and store it in a hardware FIFO. If the - * FIFO gets full before the AP wakes up again, some events will be lost, as the older events - * get overwritten by new events in the hardware FIFO. This can be avoided by holding a wake - * lock. If the application holds a wake lock, the SoC will not go to suspend mode, so no events - * will be lost, as the events will be reported before the FIFO gets full. - * </p> + * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given + * sensor at the given sampling frequency and the given maximum reporting latency. * <p> - * Batching is always best effort. If a different application requests updates in continuous - * mode, this application will also get events in continuous mode. Batch mode updates can be - * unregistered by calling {@link #unregisterListener(SensorEventListener)}. + * This function is similar to {@link #registerListener(SensorEventListener, Sensor, int)} but + * it allows events to stay temporarily in the hardware FIFO (queue) before being delivered. The + * events can be stored in the hardware FIFO up to {@code maxReportLatencyUs} microseconds. Once + * one of the events in the FIFO needs to be reported, all of the events in the FIFO are + * reported sequentially. This means that some events will be reported before the maximum + * reporting latency has elapsed. + * </p><p> + * When {@code maxReportLatencyUs} is 0, the call is equivalent to a call to + * {@link #registerListener(SensorEventListener, Sensor, int)}, as it requires the events to be + * delivered as soon as possible. + * </p><p> + * When {@code sensor.maxFifoEventCount()} is 0, the sensor does not use a FIFO, so the call + * will also be equivalent to {@link #registerListener(SensorEventListener, Sensor, int)}. + * </p><p> + * Setting {@code maxReportLatencyUs} to a positive value allows to reduce the number of + * interrupts the AP (Application Processor) receives, hence reducing power consumption, as the + * AP can switch to a lower power state while the sensor is capturing the data. This is + * especially important when registering to wake-up sensors, for which each interrupt causes the + * AP to wake up if it was in suspend mode. See {@link Sensor#isWakeUpSensor()} for more + * information on wake-up sensors. * </p> * <p class="note"> * </p> - * Note: Don't use this method with a one shot trigger sensor such as + * Note: Don't use this method with one-shot trigger sensors such as * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. Use * {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. </p> * @@ -701,118 +718,104 @@ public abstract class SensorManager { * flush complete notifications, it should register with * {@link android.hardware.SensorEventListener SensorEventListener2} instead. * @param sensor The {@link android.hardware.Sensor Sensor} to register to. - * @param rateUs The desired delay between two consecutive events in microseconds. This is only - * a hint to the system. Events may be received faster or slower than the specified - * rate. Usually events are received faster. Can be one of + * @param samplingPeriodUs The desired delay between two consecutive events in microseconds. + * This is only a hint to the system. Events may be received faster or slower than + * the specified rate. Usually events are received faster. Can be one of * {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI}, * {@link #SENSOR_DELAY_GAME}, {@link #SENSOR_DELAY_FASTEST} or the delay in * microseconds. - * @param maxBatchReportLatencyUs An event in the batch can be delayed by at most - * maxBatchReportLatency microseconds. More events can be batched if this value is - * large. If this is set to zero, batch mode is disabled and events are delivered in - * continuous mode as soon as they are available which is equivalent to calling + * @param maxReportLatencyUs Maximum time in microseconds that events can be delayed before + * being reported to the application. A large value allows reducing the power + * consumption associated with the sensor. If maxReportLatencyUs is set to zero, + * events are delivered as soon as they are available, which is equivalent to calling * {@link #registerListener(SensorEventListener, Sensor, int)}. - * @return <code>true</code> if batch mode is successfully enabled for this sensor, - * <code>false</code> otherwise. + * @return <code>true</code> if the sensor is supported and successfully enabled. * @see #registerListener(SensorEventListener, Sensor, int) * @see #unregisterListener(SensorEventListener) * @see #flush(SensorEventListener) */ - public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs, - int maxBatchReportLatencyUs) { - int delay = getDelay(rateUs); - return registerListenerImpl(listener, sensor, delay, null, maxBatchReportLatencyUs, 0); + public boolean registerListener(SensorEventListener listener, Sensor sensor, + int samplingPeriodUs, int maxReportLatencyUs) { + int delay = getDelay(samplingPeriodUs); + return registerListenerImpl(listener, sensor, delay, null, maxReportLatencyUs, 0); } /** * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given * sensor. Events are delivered in continuous mode as soon as they are available. To reduce the - * battery usage, use {@link #registerListener(SensorEventListener, Sensor, int, int)} which - * enables batch mode for the sensor. - * - * <p class="note"></p> - * Note: Don't use this method with a one shot trigger sensor such as - * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. - * Use {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. + * power consumption, applications can use + * {@link #registerListener(SensorEventListener, Sensor, int, int)} instead and specify a + * positive non-zero maximum reporting latency. + * <p class="note"> * </p> + * Note: Don't use this method with a one shot trigger sensor such as + * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. Use + * {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. </p> * - * @param listener - * A {@link android.hardware.SensorEventListener SensorEventListener} - * object. - * - * @param sensor - * The {@link android.hardware.Sensor Sensor} to register to. - * - * @param rateUs - * The rate {@link android.hardware.SensorEvent sensor events} are - * delivered at. This is only a hint to the system. Events may be - * received faster or slower than the specified rate. Usually events - * are received faster. The value must be one of - * {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI}, - * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST}. - * or, the desired delay between events in microseconds. - * Specifying the delay in microseconds only works from Android - * 2.3 (API level 9) onwards. For earlier releases, you must use - * one of the {@code SENSOR_DELAY_*} constants. - * - * @param handler - * The {@link android.os.Handler Handler} the - * {@link android.hardware.SensorEvent sensor events} will be - * delivered to. - * + * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object. + * @param sensor The {@link android.hardware.Sensor Sensor} to register to. + * @param samplingPeriodUs The rate {@link android.hardware.SensorEvent sensor events} are + * delivered at. This is only a hint to the system. Events may be received faster or + * slower than the specified rate. Usually events are received faster. The value must + * be one of {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI}, + * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST} or, the desired + * delay between events in microseconds. Specifying the delay in microseconds only + * works from Android 2.3 (API level 9) onwards. For earlier releases, you must use + * one of the {@code SENSOR_DELAY_*} constants. + * @param handler The {@link android.os.Handler Handler} the {@link android.hardware.SensorEvent + * sensor events} will be delivered to. * @return <code>true</code> if the sensor is supported and successfully enabled. - * * @see #registerListener(SensorEventListener, Sensor, int) * @see #unregisterListener(SensorEventListener) * @see #unregisterListener(SensorEventListener, Sensor) */ - public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs, - Handler handler) { - int delay = getDelay(rateUs); + public boolean registerListener(SensorEventListener listener, Sensor sensor, + int samplingPeriodUs, Handler handler) { + int delay = getDelay(samplingPeriodUs); return registerListenerImpl(listener, sensor, delay, handler, 0, 0); } /** - * Enables batch mode for a sensor with the given rate and maxBatchReportLatency. + * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given + * sensor at the given sampling frequency and the given maximum reporting latency. + * * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object * that will receive the sensor events. If the application is interested in receiving * flush complete notifications, it should register with * {@link android.hardware.SensorEventListener SensorEventListener2} instead. * @param sensor The {@link android.hardware.Sensor Sensor} to register to. - * @param rateUs The desired delay between two consecutive events in microseconds. This is only - * a hint to the system. Events may be received faster or slower than the specified - * rate. Usually events are received faster. Can be one of + * @param samplingPeriodUs The desired delay between two consecutive events in microseconds. + * This is only a hint to the system. Events may be received faster or slower than + * the specified rate. Usually events are received faster. Can be one of * {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI}, * {@link #SENSOR_DELAY_GAME}, {@link #SENSOR_DELAY_FASTEST} or the delay in * microseconds. - * @param maxBatchReportLatencyUs An event in the batch can be delayed by at most - * maxBatchReportLatency microseconds. More events can be batched if this value is - * large. If this is set to zero, batch mode is disabled and events are delivered in - * continuous mode as soon as they are available which is equivalent to calling + * @param maxReportLatencyUs Maximum time in microseconds that events can be delayed before + * being reported to the application. A large value allows reducing the power + * consumption associated with the sensor. If maxReportLatencyUs is set to zero, + * events are delivered as soon as they are available, which is equivalent to calling * {@link #registerListener(SensorEventListener, Sensor, int)}. - * @param handler The {@link android.os.Handler Handler} the - * {@link android.hardware.SensorEvent sensor events} will be delivered to. - * - * @return <code>true</code> if batch mode is successfully enabled for this sensor, - * <code>false</code> otherwise. + * @param handler The {@link android.os.Handler Handler} the {@link android.hardware.SensorEvent + * sensor events} will be delivered to. + * @return <code>true</code> if the sensor is supported and successfully enabled. * @see #registerListener(SensorEventListener, Sensor, int, int) */ - public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs, - int maxBatchReportLatencyUs, Handler handler) { - int delayUs = getDelay(rateUs); - return registerListenerImpl(listener, sensor, delayUs, handler, maxBatchReportLatencyUs, 0); + public boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs, + int maxReportLatencyUs, Handler handler) { + int delayUs = getDelay(samplingPeriodUs); + return registerListenerImpl(listener, sensor, delayUs, handler, maxReportLatencyUs, 0); } /** @hide */ protected abstract boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, - int delayUs, Handler handler, int maxBatchReportLatencyUs, int reservedFlags); + int delayUs, Handler handler, int maxReportLatencyUs, int reservedFlags); /** - * Flushes the batch FIFO of all the sensors registered for this listener. If there are events - * in the FIFO of the sensor, they are returned as if the batch timeout in the FIFO of the - * sensors had expired. Events are returned in the usual way through the SensorEventListener. - * This call doesn't affect the batch timeout for this sensor. This call is asynchronous and + * Flushes the FIFO of all the sensors registered for this listener. If there are events + * in the FIFO of the sensor, they are returned as if the maxReportLantecy of the FIFO has + * expired. Events are returned in the usual way through the SensorEventListener. + * This call doesn't affect the maxReportLantecy for this sensor. This call is asynchronous and * returns immediately. * {@link android.hardware.SensorEventListener2#onFlushCompleted onFlushCompleted} is called * after all the events in the batch at the time of calling this method have been delivered diff --git a/docs/html/about/versions/kitkat.jd b/docs/html/about/versions/kitkat.jd index 4237c98..dff3508 100644 --- a/docs/html/about/versions/kitkat.jd +++ b/docs/html/about/versions/kitkat.jd @@ -148,7 +148,7 @@ window.onhashchange = function () { </p> <p> - New tools give also give you powerful insight into your app's memory use. The + New tools also give you powerful insight into your app's memory use. The <strong>procstats tool</strong> details memory use over time, with run times and memory footprint for foreground apps and background services. An on-device view is also available as a new developer option. The diff --git a/docs/html/preview/index.html b/docs/html/preview/index.html index 4f7722c..7cd029f 100644 --- a/docs/html/preview/index.html +++ b/docs/html/preview/index.html @@ -272,13 +272,11 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). style="position:absolute;z-index:100;right:215px;top:375px">Android 5.0 API Overview</a> <div style="width:440px"> -<p>Android 5.0 (Lollipop) is almost here and users will begin receiving -device updates in November. To help you prepare, the Android 5.0 SDK is now available -with final APIs.</p> +<p>Android 5.0 (Lollipop) is now out of preview and available to users.</p> -<p>Since the L Developer Preview began, various APIs and behaviors have changed, -so if you've been using the Preview SDK -you should update now to test your apps and take advantage of new features.</p> +<p>If you previously developed apps with the L Developer Preview, be aware that various APIs and +behaviors have changed, so you should update your SDK now to test your apps and take advantage of +new features in Android 5.0.</p> <p>To get the latest Android 5.0 SDK:</p> diff --git a/docs/html/robots.txt b/docs/html/robots.txt index f522220..ab379bb 100644 --- a/docs/html/robots.txt +++ b/docs/html/robots.txt @@ -15,4 +15,5 @@ Disallow: /shareables/ Disallow: /guide/tutorials/ Disallow: /guide/samples/ Disallow: /community/ +Disallow: /preview/ Sitemap: http://developer.android.com/sitemap.txt diff --git a/docs/html/samples/admin.jd b/docs/html/samples/admin.jd new file mode 100644 index 0000000..c6637d8 --- /dev/null +++ b/docs/html/samples/admin.jd @@ -0,0 +1,11 @@ +page.title=Admin +@jd:body + + +<div id="samples" class="admin"> +</div> + + +<script> + $(document).ready(showSamples); +</script> diff --git a/docs/html/samples/new/index.jd b/docs/html/samples/new/index.jd index ba75072..279b910 100644 --- a/docs/html/samples/new/index.jd +++ b/docs/html/samples/new/index.jd @@ -2,19 +2,18 @@ page.title=What's New @jd:body -<p>The following code samples were recently published for the L Developer Preview. You can +<p>The following code samples were recently published. You can download them in the Android SDK Manager under the <b>SDK Samples</b> component -for the L Developer Preview.</p> +for API 21.</p> <p class="note"> - <strong>Note:</strong> At this time, the downloadable projects are designed + <strong>Note:</strong> The downloadable projects are designed for use with Gradle and Android Studio. </p> - <!-- NOTE TO EDITORS: add most recent samples first --> -<h3 id="MediaBrowserService">Media Browser Service</h3> +<h3 id="MediaBrowserService"><a href="/samples/MediaBrowserService/index.html">Media Browser Service</a></h3> <p> This sample is a simple audio media app that exposes its media @@ -29,10 +28,8 @@ when not connected to a car. href="http://android.com/auto">Android Auto</a>. </p> -<p><a href="http://github.com/googlesamples/android-MediaBrowserService">Get it on GitHub</a></p> - -<h3 id="MessagingService">Messaging Service</h3> +<h3 id="MessagingService"><a href="/samples/MessagingService/index.html">Messaging Service</a></h3> <p> This sample shows a simple service that sends notifications using @@ -46,10 +43,8 @@ Each unread conversation from a user is sent as a distinct notification. href="http://android.com/auto">Android Auto</a>. </p> -<p><a href="http://github.com/googlesamples/android-MessagingService">Get it on GitHub</a></p> - -<h3 id="SpeedTracker">Speed Tracker (Wear)</h3> +<h3 id="SpeedTracker"><a href="/samples/SpeedTracker/index.html">Speed Tracker (Wear)</a></h3> <p> This sample uses the FusedLocation APIs of Google Play Services on Android Wear @@ -62,10 +57,8 @@ is synced with the phone component of the app and user can see a track made of those coordinates on a map on the phone. </p> -<p><a href="http://github.com/googlesamples/android-SpeedTracker">Get it on GitHub</a></p> - -<h3 id="AppRestrictionSchema">AppRestrictionSchema</h3> +<h3 id="AppRestrictionSchema"><a href="/samples/AppRestrictionSchema/index.html">AppRestrictionSchema</a></h3> <p> This sample shows how to use app restrictions. This application has one boolean @@ -74,29 +67,23 @@ app (press the button to show "Hello" message) is enabled or disabled. Use AppRestrictionEnforcer sample to toggle the restriction. </p> -<p><a href="http://github.com/googlesamples/android-AppRestrictionSchema">Get it on GitHub</a></p> - -<h3 id="AppRestrictionEnforcer">AppRestrictionEnforcer</h3> +<h3 id="AppRestrictionEnforcer"><a href="/samples/AppRestrictionEnforcer/index.html">AppRestrictionEnforcer</a></h3> <p> This sample demonstrates how to set restrictions to other apps as a profile owner. Use AppRestrictionSchema sample as a app with available restrictions. </p> -<p><a href="http://github.com/googlesamples/android-AppRestrictionEnforcer">Get it on GitHub</a></p> - -<h3 id="DocumentCentricRelinquishIdentity">DocumentCentricRelinquishIdentity</h3> +<h3 id="DocumentCentricRelinquishIdentity"><a href="/samples/DocumentCentricRelinquishIdentity/index.html">DocumentCentricRelinquishIdentity</a></h3> <p> This sample shows how to relinquish identity to activities above it in the task stack. </p> -<p><a href="http://github.com/googlesamples/android-DocumentCentricRelinquishIdentity">Get it on GitHub</a></p> - -<h3 id="DocumentCentricApps">DocumentCentricApps</h3> +<h3 id="DocumentCentricApps"><a href="/samples/DocumentCentricApps/index.html">DocumentCentricApps</a></h3> <p> This sample shows the basic usage of the new "Document Centric Apps" API. @@ -105,10 +92,8 @@ state through reboots. If "Task per document" is checked a new task will be created for every new document in the overview menu. </p> -<p><a href="http://github.com/googlesamples/android-DocumentCentricApps">Get it on GitHub</a></p> - -<h3 id="HdrViewfinder">HdrViewfinder</h3> +<h3 id="HdrViewfinder"><a href="/samples/HdrViewfinder/index.html">HdrViewfinder</a></h3> <p> This demo implements a real-time high-dynamic-range camera viewfinder, by alternating @@ -116,10 +101,8 @@ the sensor's exposure time between two exposure values on even and odd frames, a compositing together the latest two frames whenever a new frame is captured. </p> -<p><a href="http://github.com/googlesamples/android-HdrViewfinder">Get it on GitHub</a></p> - -<h3 id="Interpolator">Interpolator</h3> +<h3 id="Interpolator"><a href="/samples/Interpolator/index.html">Interpolator</a></h3> <p> This sample demonstrates the use of animation interpolators and path animations for @@ -127,10 +110,8 @@ Material Design. It shows how an ObjectAnimator is used to animate two propertie view (scale X and Y) along a path. </p> -<p><a href="http://github.com/googlesamples/android-Interpolator">Get it on GitHub</a></p> - -<h3 id="DrawableTinting">DrawableTinting</h3> +<h3 id="DrawableTinting"><a href="/samples/DrawableTinting/index.html">DrawableTinting</a></h3> <p>Sample that shows applying tinting and color filters to Drawables both programmatically and as Drawable resources in XML.</p> @@ -141,54 +122,43 @@ states of a View (for example disabled/enabled, focused, pressed or selected).</ with a reference to a color and a PorterDuff blend mode. The color and blend mode can be changed from the UI to see the effect of different options.</p> -<p><a href="http://github.com/googlesamples/android-DrawableTinting">Get it on GitHub</a></p> - -<h3 id="LNotifications">LNotifications</h3> +<h3 id="LNotifications"><a href="/samples/LNotifications/index.html">LNotifications</a></h3> <p> This sample demonstrates how new features for notifications introduced in Android 5.0 are used such as Heads-Up notifications, visibility, people, category and priority metadata. </p> -<p><a href="http://github.com/googlesamples/android-LNotifications">Get it on GitHub</a></p> -<h3 id="CardView">CardView</h3> +<h3 id="CardView"><a href="/samples/CardView/index.html">CardView</a></h3> <p> This sample demonstrates how to use the CardView UI widget introduced in Android 5.0, using the support library for backward compatibility. </p> -<p><a href="http://github.com/googlesamples/android-CardView">Get it on GitHub</a></p> - -<h3 id="RecyclerView">RecyclerView</h3> +<h3 id="RecyclerView"><a href="/samples/RecyclerView/index.html">RecyclerView</a></h3> <p> Demonstration of using RecyclerView with a LayoutManager to create a vertical ListView. </p> -<p><a href="http://github.com/googlesamples/android-RecyclerView">Get it on GitHub</a></p> - -<h3 id="RevealEffectBasic">RevealEffectBasic</h3> +<h3 id="RevealEffectBasic"><a href="/samples/RevealEffectBasic/index.html">RevealEffectBasic</a></h3> <p> A sample demonstrating how to perform a reveal effect for UI elements within the Material Design framework. </p> -<p><a href="http://github.com/googlesamples/android-RevealEffectBasic">Get it on GitHub</a></p> - -<h3 id="FloatingActionButtonBasic">FloatingActionButtonBasic</h3> +<h3 id="FloatingActionButtonBasic"><a href="/samples/FloatingActionButtonBasic/index.html">FloatingActionButtonBasic</a></h3> <p> This sample shows the two sizes of Floating Action Buttons and how to interact with them. </p> -<p><a href="http://github.com/googlesamples/android-FloatingActionButtonBasic">Get it on GitHub</a></p> - <!-- <h3 id="">SampleName</h3> @@ -205,36 +175,15 @@ them. </p> --> - -<h3 id="NavigationDrawerSample">NavigationDrawerSample</h3> -<!-- -<div class="figure" style="width:220px"> - <img src="" srcset="@2x.png 2x" alt="" height="375" /> - <p class="img-caption"> - <strong>Figure n.</strong> Single sentence summarizing the figure. - </p> -</div> ---> - -<p> -This sample illustrates a common usage of the Android support library's -{@link android.support.v4.widget.DrawerLayout} widget. -</p> - -<p><a href="http://github.com/googlesamples/android-NavigationDrawer">Get it on GitHub</a></p> - - -<h3 id="JobSchedulerSample">JobSchedulerSample</h3> +<h3 id="JobSchedulerSample"><a href="/samples/JobScheduler/index.html">JobScheduler</a></h3> <p> This sample app allows the user to schedule jobs through the UI, and shows visual cues when the jobs are executed. </p> -<p><a href="http://github.com/googlesamples/android-JobScheduler">Get it on GitHub</a></p> - -<h3 id="AndroidTVLeanbackSample">AndroidTVLeanbackSample</h3> +<h3 id="AndroidTVLeanbackSample"><a href="https://github.com/googlesamples/androidtv-leanback">AndroidTVLeanbackSample</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -248,10 +197,7 @@ visual cues when the jobs are executed. This sample demonstrates use of the Android TV Leanback Support Library. </p> -<p><a href="http://github.com/googlesamples/androidtv-Leanback">Get it on GitHub</a></p> - - -<h3 id="Visual-Game-Controller">Visual-Game-Controller</h3> +<h3 id="Visual-Game-Controller"><a href="https://github.com/googlesamples/androidtv-VisualGameController">Visual-Game-Controller</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -265,10 +211,8 @@ This sample demonstrates use of the Android TV Leanback Support Library. This sample displays events received from a game controller shown on the screen. </p> -<p><a href="http://github.com/googlesamples/androidtv-VisualGameController">Get it on GitHub</a></p> - -<h3 id="GameControllerSample">GameControllerSample</h3> +<h3 id="GameControllerSample"><a href="https://github.com/googlesamples/androidtv-GameController/">GameControllerSample</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -283,10 +227,8 @@ This sample implements a multi-player game, demonstrating game controller input handling. </p> -<p><a href="http://github.com/googlesamples/androidtv-GameController">Get it on GitHub</a></p> - -<h3 id="ClippingBasic">ClippingBasic</h3> +<h3 id="ClippingBasic"><a href="/samples/ClippingBasic/index.html">ClippingBasic</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -300,19 +242,17 @@ handling. This sample demonstrates clipping on a {@link android.view.View}. </p> -<p><a href="http://github.com/googlesamples/android-ClippingBasic">Get it on GitHub</a></p> - <div class="figure" style="width:220px"> <img src="{@docRoot}samples/images/JobSchedulerSample.png" srcset="{@docRoot}samples/images/JobSchedulerSample@2x.png 2x" alt="" height="375" /> <p class="img-caption"> - <strong>Figure 3.</strong> The JobSchedulerSample sample app. + <strong>Figure 1.</strong> The JobSchedulerSample sample app. </p> </div> -<h3 id="ElevationDrag">ElevationDrag</h3> +<h3 id="ElevationDrag"><a href="/samples/ElevationDrag/index.html">ElevationDrag</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -326,10 +266,8 @@ This sample demonstrates clipping on a {@link android.view.View}. Elevation and z-translation are used to render the shadows. The views are clipped using different outlines.</p> -<p><a href="http://github.com/googlesamples/android-ElevationDrag">Get it on GitHub</a></p> - -<h3 id="ElevationBasic">ElevationBasic</h3> +<h3 id="ElevationBasic"><a href="/samples/ElevationBasic/index.html">ElevationBasic</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -348,10 +286,8 @@ This sample demonstrates two alternative ways to move a view in the z-axis:</p> <code>setTranslationZ()</code>.</li> </ul> -<p><a href="http://github.com/googlesamples/android-ElevationBasic">Get it on GitHub</a></p> - -<h3 id="ActivitySceneTransitionBasic">ActivitySceneTransitionBasic</h3> +<h3 id="ActivitySceneTransitionBasic"><a href="/samples/ActivitySceneTransitionBasic/index.html">ActivitySceneTransitionBasic</a></h3> <div class="figure" style="width:220px"> <img src="{@docRoot}samples/images/ActivitySceneTransitionBasic.png" srcset="{@docRoot}samples/images/ActivitySceneTransitionBasic@2x.png 2x" @@ -366,10 +302,8 @@ transitions when transitioning from one activity to another. Uses a combination of <code>moveImage</code> and <code>changeBounds</code> to nicely transition from a grid of images to an activity with a large image and detail text. </p> -<p><a href="http://github.com/googlesamples/android-ActivitySceneTransition">Get it on GitHub</a></p> - -<h3 id="Camera2Video">Camera2Video</h3> +<h3 id="Camera2Video"><a href="/samples/Camera2Video/index.html">Camera2Video</a></h3> <!-- <div class="figure" style="width:220px"> <img src="" srcset="@2x.png 2x" alt="" height="375" /> @@ -381,10 +315,8 @@ from a grid of images to an activity with a large image and detail text. </p> <p>This sample demonstrates how to record video using the Camera2 API.</p> -<p><a href="http://github.com/googlesamples/android-Camera2Video">Get it on GitHub</a></p> - -<h3 id="Camera2Basic">Camera2Basic</h3> +<h3 id="Camera2Basic"><a href="/samples/Camera2Basic/index.html">Camera2Basic</a></h3> <!-- <div class="figure" style="width:220px"> @@ -398,16 +330,14 @@ from a grid of images to an activity with a large image and detail text. </p> <p>This sample demonstrates the basic use of the Camera2 API. The sample code demonstrates how you can display camera preview and take pictures.</p> -<p><a href="http://github.com/googlesamples/android-Camera2Basic">Get it on GitHub</a></p> - -<h3 id="BasicManagedProfile">BasicManagedProfile</h3> +<h3 id="BasicManagedProfile"><a href="/samples/BasicManagedProfile/index.html">BasicManagedProfile</a></h3> <div class="figure" style="width:220px"> <img src="{@docRoot}samples/images/BasicManagedProfile.png" srcset="{@docRoot}samples/images/BasicManagedProfile@2x.png 2x" alt="" height="375" /> <p class="img-caption"> - <strong>Figure 1.</strong> The BasicManagedProfile sample app. + <strong>Figure 3.</strong> The BasicManagedProfile sample app. </p> </div> @@ -422,5 +352,3 @@ demonstrates how you can display camera preview and take pictures.</p> <p class="note"><strong>Note:</strong> There can be only one managed profile on a device at a time.</p> -<p><a href="http://github.com/googlesamples/android-BasicManagedProfile">Get it on GitHub</a></p> - diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd index 06474dc..48dceb6 100644 --- a/docs/html/tools/sdk/ndk/index.jd +++ b/docs/html/tools/sdk/ndk/index.jd @@ -3,28 +3,28 @@ page.template=sdk ndk.mac64_download=android-ndk-r10c-darwin-x86_64.bin -ndk.mac64_bytes=436952863 -ndk.mac64_checksum=bc04ef44b920cf6cd2157b6f2c3531d6 +ndk.mac64_bytes=442691567 +ndk.mac64_checksum=cb101e1e62d56ea75b215f6bc6c27fae ndk.mac32_download=android-ndk-r10c-darwin-x86.bin -ndk.mac32_bytes=435858709 -ndk.mac32_checksum=6b3e143f7e64d5cd337b727513e27913 +ndk.mac32_bytes=441545213 +ndk.mac32_checksum=0aeb3dc062dc457a4cd01e72eadb2379 ndk.linux64_download=android-ndk-r10c-linux-x86_64.bin -ndk.linux64_bytes=449013322 -ndk.linux64_checksum=792c61706cd9ec6713fa1b69b2f42996 +ndk.linux64_bytes=459151600 +ndk.linux64_checksum=263b83071e6bca15f67898548d8d236e ndk.linux32_download=android-ndk-r10c-linux-x86.bin -ndk.linux32_bytes=438555265 -ndk.linux32_checksum=d1595d9ca5e15484e047f1ac326c4ceb +ndk.linux32_bytes=449997190 +ndk.linux32_checksum=70ed6d8c34e7e620c145b791e8eeef89 ndk.win64_download=android-ndk-r10c-windows-x86_64.exe -ndk.win64_bytes=458925419 -ndk.win64_checksum=af8edf5d316e1bf1a5a72e04a9faec41 +ndk.win64_bytes=472613732 +ndk.win64_checksum=9a33f96da58a7e0b70e47d27b4a880b4 ndk.win32_download=android-ndk-r10c-windows-x86.exe -ndk.win32_bytes=433102815 -ndk.win32_checksum=805a04810719886674d3c7bff5eca53f +ndk.win32_bytes=455427281 +ndk.win32_checksum=c0930abfae0c990c4d191cc4ebd46b68 @@ -388,6 +388,133 @@ $('#Downloads').after($('#download-table')); <p> <a href="#" onclick="return toggleContent(this)"> <img src="/assets/images/triangle-opened.png" class="toggle-content-img" alt="" + >Android NDK, Revision 10d</a> <em>(December 2014)</em> + </p> + <div class="toggle-content-toggleme"> + <dl> + <dt>Important changes:</dt> + <dd> + <ul> + <li>Made GCC 4.8 the default for all 32-bit ABIs. Deprecated GCC 4.6, and + will remove it next release. To restore previous behavior, either add + <code>NDK_TOOLCHAIN_VERSION=4.6</code> to ndk-build, or + add <code>--toolchain=arm-linux-androideabi-4.6</code> when executing + <code>make-standalone-toolchain.sh</code> on the command line. GCC 4.9 remains the + default for 64-bit ABIs.</li> + + <li>Stopped all x86[_64] toolchains from adding <code>-mstackrealign</code> by default. The + NDK toolchain assumes a 16-byte stack alignment. The tools and options used by default + enforce this rule. A user writing assembly code must make sure to preserve stack + alignment, and ensure that other compilers also comply with this rule. + (GCC bug <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496">38496</a>)</li> + + <li>Added Address Sanitizer functionality to Clang 3.5 support to the ARM and x86 ABIs. + For more information on this change, see the + <a href="https://code.google.com/p/address-sanitizer/wiki/Android">Address + Sanitizer</a> project.</li> + + <li>Introduced the requirement, starting from API level 21, to use <code>-fPIE -pie + </code> when building. In API levels 16 and higher, ndk-build uses <code>PIE</code> + when building. This change has a number of implications, which are discussed in + <a href="https://code.google.com/p/android-developer-preview/issues/detail?id=888"> + Developer Preview Issue 888</a>. + These implications do not apply to shared libraries.</li> + </ul> + </dd> + <dl> + + + <dt>Important bug fixes:</dt> + <dd> + <ul> + <li>Made more fixes related to + <a href="https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00906.html"> + A53 Errata #835769</a> in the aarch64-linux-android-4.9 linker. As part of this, GCC + passes a new option, <code>--fix-cortex-a53-835769</code>, when + <code>-mfix-cortex-a53-835769</code> (enabled by default) is specified. + For more information, see this + <a href="https://sourceware.org/ml/binutils/2014-10/msg00198.html">binutils message</a> + and this + <a href="https://sourceware.org/ml/binutils/2014-11/msg00287.html">binutils message</a>. + </li> + + <li>Documented a fix to a libc++ <code>sscanf/vsscanf</code> hang that occurred in API level + 21. The fix itself had been implemented in r10c. + (Issue <a href="http://b.android.com/77988">77988</a>)</li> + + <li>Fixed an AutoFDO (<code>-fauto-profile</code>) crash that occurred with GCC 4.9 when + <code>-Os</code> was specified. (Issue <a href="http://b.android.com/77571">77571</a>)</li> + </ul> + </dd> + + + <dt>Other bug fixes:</dt> + <dd> + <ul> + <li>Made the following header and library fixes:</li> + <ul> + <li>Added <code>posix_memalign</code> to API level 16. Also, added a prototype in + <code>stdlib.h</code> to API levels 16 to 19. + (Issue <a href="http://b.android.com/77861">77861</a>)</li> + <li>Fixed <code>stdatomic.h</code> so that it includes <code><atomic></code> only for + C++11.</li> + <li>Modified the following headers for standalone use: <code>sys/user.h</code>, and + <code>gl2ext.h</code>, <code>dlext.h</code>, <code>fts.h</code>, <code>sgidefs.h</code> + for API level 21.</li> + <li>Modified <code>sys/user.h</code> to rename <code>mxcsr_mask</code> as <code>mxcr_mask</code>, + and to change the data type for <code>u_ar0</code></li> from <code>unsigned long</code> + to </code>struct user_regs_struct*</code>. + <li>Changed <code>sysconf()</code> return value type from <code>int</code> to + <code>long</code>.</li> + </ul> + + <li>Fixed ndk-build's handling of <code>thumb</code> for <code>LOCAL_ARM_MODE</code>: In + r10d, ndk-build adds <code>LOCAL_LDFLAGS+=-mthumb</code> by default, unless one of the + following conditions applies:</li> + <ul> + <li>You have set <code>LOCAL_ARM_MODE</code> equal to <code>arm</code>.</li> + <li>You are doing a debug build (with settings such as <code>APP_OPTIM=debug</code> and + <code>AndroidManifest.xml</code> containing <code>android:debuggable="true"</code>), + where ARM mode is the default in order to retain compatibility with earlier toolchains. + (Issue <a href="http://b.android.com/74040">74040</a>)</li> + </ul> + + <li>Fixed <code>LOCAL_SRC_FILES</code> in ndk-build to use Windows absolute paths. + (Issue <a href="http://b.android.com/74333">74333</a>)</li> + + <li>Removed bash-specific code from ndk-gdb. (Issue <a href="http://b.android.com/73338">73338</a>)</li> + + <li>Removed bash-specific code from <code>make-standalone-toolchain.sh</code>. + (Issue <a href="http://b.android.com/74145">74145)</a></li> + + <li>Revised documentation concerning a fix for <code>System.loadLibrary()</code> transitive + dependencies. (Issue <a href="http://b.android.com/41790">41790</a>)</li> + + <li>Fixed a problem that was preventing 64-bit packages from extracting on Ubuntu 14.04 and + OS X 10.10 (Yosemite). (Issue <a href="http://b.android.com/78148">78148</a>)</li> + + <li>Fixed an issue with <code>LOCAL_PCH</code> to improve Clang support. (Issue + <a href="http://b.android.com/77575">77575</a>)</li> + + <li>Clarified "requires executable stack" warning from ld.gold. (Issue + <a href="http://b.android.com/79115">79115</a>)</li> + </ul> + </dd> + + </dl> + </div> +</div> + + + + + + + +<div class="toggle-content closed"> + <p> + <a href="#" onclick="return toggleContent(this)"> <img + src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" >Android NDK, Revision 10c</a> <em>(October 2014)</em> </p> <div class="toggle-content-toggleme"> @@ -570,10 +697,6 @@ Symbol not found: _environ </div> </div> - - - - <div class="toggle-content closed"> <p> <a href="#" onclick="return toggleContent(this)"> <img diff --git a/docs/html/training/wearables/apps/creating.jd b/docs/html/training/wearables/apps/creating.jd index 018d9f7..683dd31 100644 --- a/docs/html/training/wearables/apps/creating.jd +++ b/docs/html/training/wearables/apps/creating.jd @@ -6,6 +6,7 @@ page.title=Creating and Running a Wearable App <div id="tb"> <h2>This lesson teaches you to</h2> <ol> + <li><a href="#UpdateSDK">Update Your SDK</a></li> <li><a href="#SetupEmulator">Set Up an Android Wear Emulator</a></li> <li><a href="#SetupDevice">Set Up an Android Wear Device</a></li> <li><a href="#CreateProject">Create a Project</a></li> @@ -13,7 +14,7 @@ page.title=Creating and Running a Wearable App </ol> <h2>Dependencies and Prerequisites</h2> <ul> - <li>Android Studio 0.8 or later and Gradle 0.12 or later</li> + <li>Android Studio 0.8.12 or later and Gradle 0.12 or later</li> </ul> </div> </div> @@ -34,6 +35,24 @@ sending the results to the wearable. both your wearable and handheld apps. </p> +<h2 id="UpdateSDK">Update Your SDK</h2> + +<p>Before you begin building wearable apps, you must:</p> + +<ul> + <li><strong>Update your SDK tools to version 23.0.0 or higher</strong> + <br> + The updated SDK tools enable you to build and test wearable apps. + </li> + <li><strong>Update your SDK with Android 4.4W.2 (API 20) or higher</strong> + <br> + The updated platform version provides new APIs for wearable apps. + </li> +</ul> + +<p>To update your SDK with these components, see +<a href="{@docRoot}sdk/installing/adding-packages.html#GetTools"> Get the latest SDK tools</a>.</p> + <h2 id="SetupEmulator">Set Up an Android Wear Emulator or Device</h2> <p>We recommend that you develop on real hardware so you can better @@ -45,29 +64,24 @@ types of screen shapes, which is useful for testing.</p> <p>To set up an Android Wear virtual device:</p> <ol> <li>Click <b>Tools > Android > AVD Manager</b>.</li> - <li>Click <b>Create...</b>.</li> - <li>Fill in the following details for the AVD you want to specify and leave the rest - of the fields with their default values: - <ul> - <li><b>AVD Name</b> - A name for your AVD</li> - <li><b>Device</b> - Android Wear Round or Square device types</li> - <li><b>Target</b> - Android 4.4W - API Level 20</li> - <li><b>CPU/ABI</b> - Android Wear ARM (armeabi-v7a)</li> - <li><b>Keyboard</b> - Select <b>Hardware keyboard present</b></li> - <li><b>Skin</b> - AndroidWearRound or AndroidWearSquare depending on the selected device type</li> - <li><b>Snapshot</b> - Not selected</li> - <li><b>Use Host GPU</b> - Selected, to support custom activities for wearable notifications</li> - </ul> - </li> - <li>Click <b>OK</b>.</li> + <li>Click <b>Create Virtual Device...</b>.</li> + <ol> + <li>Click <b>Wear</b> in the Category list:</li> + <li>Select Android Wear Square or Android Wear Round.</li> + <li>Click <b>Next</b>.</li> + <li>Select a release name (for example, KitKat Wear).</li> + <li>Click <b>Next</b>.</li> + <li>(Optional) Change any preferences for your virtual device.</li> + <li>Click <b>Finish</b>.</li> + </ol> <li>Start the emulator: <ol> <li>Select the virtual device you just created.</li> - <li>Click <b>Start...</b>, then click <b>Launch</b>.</li> + <li>Click the <b>Play</b> button.</li> <li>Wait until the emulator initializes and shows the Android Wear home screen.</li> </ol> </li> -<li>Pair Your handheld with the emulator: +<li>Pair your handheld with the emulator: <ol> <li>On your handheld, install the Android Wear app from Google Play.</li> <li>Connect the handheld to your machine through USB.</li> diff --git a/docs/html/training/wearables/data-layer/index.jd b/docs/html/training/wearables/data-layer/index.jd index 8d42ae3..85b2c33 100644 --- a/docs/html/training/wearables/data-layer/index.jd +++ b/docs/html/training/wearables/data-layer/index.jd @@ -30,9 +30,12 @@ the data layer:</p> <dd>The <a href="{@docRoot}reference/com/google/android/gms/wearable/MessageApi.html"><code>MessageApi</code></a> class can send messages and is good for remote procedure calls (RPC), such as controlling a handheld's media player from the wearable or starting an intent on the wearable from the handheld. - The system always delivers the message when the handheld and wearable are connected and delivers - an error when the devices are disconnected. Messages are great for one-way requests or for a - request/response communication model.</dd> + Messages are also great for one-way requests or for a request/response communication model. + If the handheld and wearable are connected, the system queues the message for delivery and + returns a successful result code. If the devices are not connected, an error is returned. A + successful result code does not indicate that the message was delivered successfully as the + devices may disconnect after receiving the result code. +</p></dd> <dt><b>Asset</b></dt> <dd><a href="{@docRoot}reference/com/google/android/gms/wearable/Asset.html"><code>Asset</code></a> objects are for diff --git a/docs/html/training/wearables/ui/confirm.jd b/docs/html/training/wearables/ui/confirm.jd index 36330a6..07a352f 100644 --- a/docs/html/training/wearables/ui/confirm.jd +++ b/docs/html/training/wearables/ui/confirm.jd @@ -116,15 +116,14 @@ mDelayedView.setTotalTimeMs(2000); mDelayedView.start(); </pre> - -<h2 id="show-confirmation">Show Confirmation Animations</h2> - -<div style="float:right;margin-left:25px;width:200px"> +<div style="float:right;margin-left:25px;width:210px;margin-top:15px"> <img src="{@docRoot}wear/images/08_uilib.png" width="200" height="200" alt=""/> -<p class="img-caption" style="text-align:center"><strong>Figure 2:</strong> +<p class="img-caption" style="text-align:center;margin-left:-5px"><strong>Figure 2:</strong> A confirmation animation.</p> </div> +<h2 id="show-confirmation">Show Confirmation Animations</h2> + <p>To show a confirmation animation when users complete an action in your app, create an intent that starts <code>ConfirmationActivity</code> from one of your activities. You can specify one of the these animations with the <code>EXTRA_ANIMATION_TYPE</code> intent extra:</p> diff --git a/docs/html/training/wearables/ui/exit.jd b/docs/html/training/wearables/ui/exit.jd index 84e1e45..6b205a5 100644 --- a/docs/html/training/wearables/ui/exit.jd +++ b/docs/html/training/wearables/ui/exit.jd @@ -67,7 +67,7 @@ For example:</p> android:id="@+id/dismiss_overlay" android:layout_height="match_parent" android:layout_width="match_parent"/> -<FrameLayout> +</FrameLayout> </pre> <p>In your activity, obtain the <code>DismissOverlayView</code> element and set some introductory @@ -100,8 +100,8 @@ public class WearActivity extends Activity { // Capture long presses @Override - public boolean onTouchEvent(MotionEvent ev) { - return mDetector.onTouchEvent(ev) || super.onTouchEvent(ev); + public boolean dispatchTouchEvent(MotionEvent e) { + return mDetector.onTouchEvent(e) || super.dispatchTouchEvent(e); } } </pre> diff --git a/docs/html/training/wearables/ui/layouts.jd b/docs/html/training/wearables/ui/layouts.jd index 14b9403..130f1c4 100644 --- a/docs/html/training/wearables/ui/layouts.jd +++ b/docs/html/training/wearables/ui/layouts.jd @@ -166,7 +166,7 @@ protected void onCreate(Bundle savedInstanceState) { <h2 id="same-layout">Use a Shape-Aware Layout</h2> -<div style="float:right;margin-left:25px;width:250px"> +<div style="float:right;margin-left:25px;width:260px"> <img src="{@docRoot}wear/images/02_uilib.png" width="250" height="250" alt=""/> <p class="img-caption"><strong>Figure 2.</strong> Window insets on a round screen.</p> </div> diff --git a/docs/html/training/wearables/ui/lists.jd b/docs/html/training/wearables/ui/lists.jd index e8aaed4..1d6e8ed 100644 --- a/docs/html/training/wearables/ui/lists.jd +++ b/docs/html/training/wearables/ui/lists.jd @@ -36,9 +36,9 @@ the <code>android-sdk/samples/android-20/wearable/Notifications</code> directory <li>Add a <code>WearableListView</code> element to your activity's layout definition.</li> <li>Create a custom layout implementation for your list items.</li> <li>Use this implementation to create a layout definition file for your list items.</li> -<div style="float:right;margin-left:25px;width:215px;margin-top:-20px"> +<div style="float:right;margin-left:25px;width:220px;margin-top:-25px"> <img src="{@docRoot}wear/images/06_uilib.png" width="200" height="200" alt=""/> -<p class="img-caption" style="text-align:center"><strong>Figure 3:</strong> +<p class="img-caption" style="text-align:center;margin-left:-10px"><strong>Figure 3:</strong> A list view on Android Wear.</p> </div> <li>Create an adapter to populate the list.</li> |
