diff options
60 files changed, 2737 insertions, 1464 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index 00bd54eb5975..26901829e932 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -935,6 +935,7 @@ void CameraService::Client::handleShutter( mHardware->getRawHeap()); mSurface->registerBuffers(buffers); + IPCThreadState::self()->flushCommands(); } } diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java index a8c6f9b59990..31acb5b177e8 100644 --- a/core/java/android/net/SSLCertificateSocketFactory.java +++ b/core/java/android/net/SSLCertificateSocketFactory.java @@ -35,6 +35,11 @@ import java.security.cert.Certificate; import java.security.cert.X509Certificate; import javax.net.SocketFactory; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; @@ -48,17 +53,33 @@ import org.apache.harmony.xnet.provider.jsse.SSLParameters; /** * SSLSocketFactory implementation with several extra features: + * * <ul> * <li>Timeout specification for SSL handshake operations + * <li>Hostname verification in most cases (see WARNINGs below) * <li>Optional SSL session caching with {@link SSLSessionCache} * <li>Optionally bypass all SSL certificate checks * </ul> - * Note that the handshake timeout does not apply to actual connection. - * If you want a connection timeout as well, use {@link #createSocket()} and - * {@link Socket#connect(SocketAddress, int)}. - * <p> - * On development devices, "setprop socket.relaxsslcheck yes" bypasses all - * SSL certificate checks, for testing with development servers. + * + * The handshake timeout does not apply to actual TCP socket connection. + * If you want a connection timeout as well, use {@link #createSocket()} + * and {@link Socket#connect(SocketAddress, int)}, after which you + * must verify the identity of the server you are connected to. + * + * <p class="caution"><b>Most {@link SSLSocketFactory} implementations do not + * verify the server's identity, allowing man-in-the-middle attacks.</b> + * This implementation does check the server's certificate hostname, but only + * for createSocket variants that specify a hostname. When using methods that + * use {@link InetAddress} or which return an unconnected socket, you MUST + * verify the server's identity yourself to ensure a secure connection.</p> + * + * <p>One way to verify the server's identity is to use + * {@link HttpsURLConnection#getDefaultHostnameVerifier()} to get a + * {@link HostnameVerifier} to verify the certificate hostname. + * + * <p>On development devices, "setprop socket.relaxsslcheck yes" bypasses all + * SSL certificate and hostname checks for testing purposes. This setting + * requires root access. */ public class SSLCertificateSocketFactory extends SSLSocketFactory { private static final String TAG = "SSLCertificateSocketFactory"; @@ -71,6 +92,9 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { } }; + private static final HostnameVerifier HOSTNAME_VERIFIER = + HttpsURLConnection.getDefaultHostnameVerifier(); + private SSLSocketFactory mInsecureFactory = null; private SSLSocketFactory mSecureFactory = null; @@ -95,7 +119,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { * * @param handshakeTimeoutMillis to use for SSL connection handshake, or 0 * for none. The socket timeout is reset to 0 after the handshake. - * @return a new SocketFactory with the specified parameters + * @return a new SSLSocketFactory with the specified parameters */ public static SocketFactory getDefault(int handshakeTimeoutMillis) { return new SSLCertificateSocketFactory(handshakeTimeoutMillis, null, true); @@ -108,7 +132,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { * @param handshakeTimeoutMillis to use for SSL connection handshake, or 0 * for none. The socket timeout is reset to 0 after the handshake. * @param cache The {@link SSLClientSessionCache} to use, or null for no cache. - * @return a new SocketFactory with the specified parameters + * @return a new SSLSocketFactory with the specified parameters */ public static SSLSocketFactory getDefault(int handshakeTimeoutMillis, SSLSessionCache cache) { return new SSLCertificateSocketFactory(handshakeTimeoutMillis, cache, true); @@ -117,13 +141,14 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { /** * Returns a new instance of a socket factory with all SSL security checks * disabled, using an optional handshake timeout and SSL session cache. - * Sockets created using this factory are vulnerable to man-in-the-middle - * attacks! + * + * <p class="caution"><b>Warning:</b> Sockets created using this factory + * are vulnerable to man-in-the-middle attacks!</p> * * @param handshakeTimeoutMillis to use for SSL connection handshake, or 0 * for none. The socket timeout is reset to 0 after the handshake. * @param cache The {@link SSLClientSessionCache} to use, or null for no cache. - * @return an insecure SocketFactory with the specified parameters + * @return an insecure SSLSocketFactory with the specified parameters */ public static SSLSocketFactory getInsecure(int handshakeTimeoutMillis, SSLSessionCache cache) { return new SSLCertificateSocketFactory(handshakeTimeoutMillis, cache, false); @@ -145,6 +170,44 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { new SSLCertificateSocketFactory(handshakeTimeoutMillis, cache, true)); } + /** + * Verify the hostname of the certificate used by the other end of a + * connected socket. You MUST call this if you did not supply a hostname + * to {@link #createSocket()}. It is harmless to call this method + * redundantly if the hostname has already been verified. + * + * <p>Wildcard certificates are allowed to verify any matching hostname, + * so "foo.bar.example.com" is verified if the peer has a certificate + * for "*.example.com". + * + * @param socket An SSL socket which has been connected to a server + * @param hostname The expected hostname of the remote server + * @throws IOException if something goes wrong handshaking with the server + * @throws SSLPeerUnverifiedException if the server cannot prove its identity + * + * @hide + */ + public static void verifyHostname(Socket socket, String hostname) throws IOException { + if (!(socket instanceof SSLSocket)) { + throw new IllegalArgumentException("Attempt to verify non-SSL socket"); + } + + if (!isSslCheckRelaxed()) { + // The code at the start of OpenSSLSocketImpl.startHandshake() + // ensures that the call is idempotent, so we can safely call it. + SSLSocket ssl = (SSLSocket) socket; + ssl.startHandshake(); + + SSLSession session = ssl.getSession(); + if (session == null) { + throw new SSLException("Cannot verify SSL socket without session"); + } + if (!HOSTNAME_VERIFIER.verify(hostname, session)) { + throw new SSLPeerUnverifiedException("Cannot verify hostname: " + hostname); + } + } + } + private SSLSocketFactory makeSocketFactory(TrustManager[] trustManagers) { try { SSLContextImpl sslContext = new SSLContextImpl(); @@ -156,10 +219,14 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { } } + private static boolean isSslCheckRelaxed() { + return "1".equals(SystemProperties.get("ro.debuggable")) && + "yes".equals(SystemProperties.get("socket.relaxsslcheck")); + } + private synchronized SSLSocketFactory getDelegate() { // Relax the SSL check if instructed (for this factory, or systemwide) - if (!mSecure || ("1".equals(SystemProperties.get("ro.debuggable")) && - "yes".equals(SystemProperties.get("socket.relaxsslcheck")))) { + if (!mSecure || isSslCheckRelaxed()) { if (mInsecureFactory == null) { if (mSecure) { Log.w(TAG, "*** BYPASSING SSL SECURITY CHECKS (socket.relaxsslcheck=yes) ***"); @@ -177,13 +244,30 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { } } + /** + * {@inheritDoc} + * + * <p>This method verifies the peer's certificate hostname after connecting + * (unless created with {@link #getInsecure(int, SSLSessionCache)}). + */ @Override public Socket createSocket(Socket k, String host, int port, boolean close) throws IOException { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(k, host, port, close); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + if (mSecure) { + verifyHostname(s, host); + } return s; } + /** + * Creates a new socket which is not connected to any remote host. + * You must use {@link Socket#connect} to connect the socket. + * + * <p class="caution"><b>Warning:</b> Hostname verification is not performed + * with this method. You MUST verify the server's identity after connecting + * the socket to avoid man-in-the-middle attacks.</p> + */ @Override public Socket createSocket() throws IOException { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(); @@ -191,6 +275,13 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { return s; } + /** + * {@inheritDoc} + * + * <p class="caution"><b>Warning:</b> Hostname verification is not performed + * with this method. You MUST verify the server's identity after connecting + * the socket to avoid man-in-the-middle attacks.</p> + */ @Override public Socket createSocket(InetAddress addr, int port, InetAddress localAddr, int localPort) throws IOException { @@ -200,6 +291,13 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { return s; } + /** + * {@inheritDoc} + * + * <p class="caution"><b>Warning:</b> Hostname verification is not performed + * with this method. You MUST verify the server's identity after connecting + * the socket to avoid man-in-the-middle attacks.</p> + */ @Override public Socket createSocket(InetAddress addr, int port) throws IOException { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(addr, port); @@ -207,19 +305,37 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { return s; } + /** + * {@inheritDoc} + * + * <p>This method verifies the peer's certificate hostname after connecting + * (unless created with {@link #getInsecure(int, SSLSessionCache)}). + */ @Override public Socket createSocket(String host, int port, InetAddress localAddr, int localPort) throws IOException { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket( host, port, localAddr, localPort); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + if (mSecure) { + verifyHostname(s, host); + } return s; } + /** + * {@inheritDoc} + * + * <p>This method verifies the peer's certificate hostname after connecting + * (unless created with {@link #getInsecure(int, SSLSessionCache)}). + */ @Override public Socket createSocket(String host, int port) throws IOException { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(host, port); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + if (mSecure) { + verifyHostname(s, host); + } return s; } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 11e5ad138807..f9abe60b47c6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -7890,7 +7890,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * without resorting to another data structure. * * The specified key should be an id declared in the resources of the - * application to ensure it is unique. Keys identified as belonging to + * application to ensure it is unique (see the <a + * href={@docRoot}guide/topics/resources/more-resources.html#Id">ID resource type</a>). + * Keys identified as belonging to * the Android framework or not associated with any package will cause * an {@link IllegalArgumentException} to be thrown. * diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 921d0f559118..2df250d0ba48 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -236,14 +236,14 @@ import junit.framework.Assert; * * <h3>Building web pages to support different screen densities</h3> * - * <p>The screen density of a device is based on the screen resolution. A screen with low density - * has fewer available pixels per inch, where a screen with high density - * has more — sometimes significantly more — pixels per inch. The density of a + * <p>A screen's density is based on it's screen resolution and physical size. A screen with low + * density has fewer available pixels per inch, where a screen with high density + * has more -- sometimes significantly more -- pixels per inch. The density of a * screen is important because, other things being equal, a UI element (such as a button) whose * height and width are defined in terms of screen pixels will appear larger on the lower density - * screen and smaller on the higher density screen. - * For simplicity, Android collapses all actual screen densities into three generalized densities: - * high, medium, and low.</p> + * screen and smaller on the higher density screen. For simplicity, Android collapses all + * actual screen densities into three generalized densities:high, medium, and low. </p> + * * <p>By default, WebView scales a web page so that it is drawn at a size that matches the default * appearance on a medium density screen. So, it applies 1.5x scaling on a high density screen * (because its pixels are smaller) and 0.75x scaling on a low density screen (because its pixels diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp index b0b0cb8200fd..3f14c3a6e276 100644 --- a/core/jni/android_bluetooth_HeadsetBase.cpp +++ b/core/jni/android_bluetooth_HeadsetBase.cpp @@ -169,7 +169,7 @@ again: // never receive non-ASCII UTF-8). // This was added because of the BMW 2005 E46 which sends binary junk. if (is_ascii(buf)) { - LOG(LOG_INFO, "Bluetooth AT recv", buf); + IF_LOGV() LOG(LOG_VERBOSE, "Bluetooth AT recv", buf); } else { LOGW("Ignoring invalid AT command: %s", buf); buf[0] = NULL; @@ -494,7 +494,7 @@ static void pretty_log_urc(const char *urc) { } } } - LOG(LOG_INFO, "Bluetooth AT sent", buf); + IF_LOGV() LOG(LOG_VERBOSE, "Bluetooth AT sent", buf); free(buf); } diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml index 218054d86b2d..11095c0067c3 100644 --- a/core/res/res/values-de/strings.xml +++ b/core/res/res/values-de/strings.xml @@ -132,7 +132,7 @@ <string name="turn_off_radio" msgid="8198784949987062346">"Funk ausschalten"</string> <string name="screen_lock" msgid="799094655496098153">"Display-Sperre"</string> <string name="power_off" msgid="4266614107412865048">"Ausschalten"</string> - <string name="shutdown_progress" msgid="2281079257329981203">"Fährt herunter..."</string> + <string name="shutdown_progress" msgid="2281079257329981203">"Wird heruntergefahren..."</string> <string name="shutdown_confirm" msgid="649792175242821353">"Ihr Telefon wird heruntergefahren."</string> <string name="recent_tasks_title" msgid="3691764623638127888">"Zuletzt verwendet"</string> <string name="no_recent_tasks" msgid="279702952298056674">"Keine zuletzt verwendeten Anwendungen"</string> diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml index 33cb9fb451d5..d0b3b8a06f7b 100644 --- a/core/res/res/values-it/strings.xml +++ b/core/res/res/values-it/strings.xml @@ -734,7 +734,7 @@ <string name="chooseActivity" msgid="1009246475582238425">"Seleziona un\'azione"</string> <string name="noApplications" msgid="1691104391758345586">"Nessuna applicazione è in grado di svolgere questa azione."</string> <string name="aerr_title" msgid="653922989522758100">"Spiacenti."</string> - <string name="aerr_application" msgid="4683614104336409186">"Interruzione imprevista dell\'applicazione <xliff:g id="APPLICATION">%1$s</xliff:g> (processo<xliff:g id="PROCESS">%2$s</xliff:g>). Riprova."</string> + <string name="aerr_application" msgid="4683614104336409186">"Interruzione imprevista dell\'applicazione <xliff:g id="APPLICATION">%1$s</xliff:g> (processo <xliff:g id="PROCESS">%2$s</xliff:g>). Riprova."</string> <string name="aerr_process" msgid="1551785535966089511">"Interruzione imprevista del processo <xliff:g id="PROCESS">%1$s</xliff:g>. Riprova."</string> <string name="anr_title" msgid="3100070910664756057">"Spiacenti."</string> <string name="anr_activity_application" msgid="3538242413112507636">"L\'attività <xliff:g id="ACTIVITY">%1$s</xliff:g> (nell\'applicazione <xliff:g id="APPLICATION">%2$s</xliff:g>) non risponde."</string> diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml index afe7b670c2aa..8aaf76106e46 100644 --- a/core/res/res/values-ko/strings.xml +++ b/core/res/res/values-ko/strings.xml @@ -148,7 +148,7 @@ <string name="safeMode" msgid="2788228061547930246">"안전 모드"</string> <string name="android_system_label" msgid="6577375335728551336">"Android 시스템"</string> <string name="permgrouplab_costMoney" msgid="5429808217861460401">"요금이 부과되는 서비스"</string> - <string name="permgroupdesc_costMoney" msgid="8193824940620517189">"응용프로그램이 요금이 부과될 수 있는 작업을 할 수 있도록 합니다."</string> + <string name="permgroupdesc_costMoney" msgid="8193824940620517189">"애플리케이션이 요금이 부과될 수 있는 작업을 할 수 있도록 합니다."</string> <string name="permgrouplab_messages" msgid="7521249148445456662">"메시지"</string> <string name="permgroupdesc_messages" msgid="7045736972019211994">"SMS, 이메일 및 기타 메시지를 읽고 씁니다."</string> <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"개인정보"</string> @@ -156,7 +156,7 @@ <string name="permgrouplab_location" msgid="635149742436692049">"위치"</string> <string name="permgroupdesc_location" msgid="2430258821648348660">"실제 위치 모니터링"</string> <string name="permgrouplab_network" msgid="5808983377727109831">"네트워크 통신"</string> - <string name="permgroupdesc_network" msgid="5035763698958415998">"응용프로그램이 다양한 네트워크 기능에 액세스할 수 있도록 합니다."</string> + <string name="permgroupdesc_network" msgid="5035763698958415998">"애플리케이션이 다양한 네트워크 기능에 액세스할 수 있도록 합니다."</string> <string name="permgrouplab_accounts" msgid="3359646291125325519">"계정"</string> <string name="permgroupdesc_accounts" msgid="4948732641827091312">"사용 가능한 계정에 액세스합니다."</string> <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"하드웨어 제어"</string> @@ -166,261 +166,261 @@ <string name="permgrouplab_systemTools" msgid="4652191644082714048">"시스템 도구"</string> <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"시스템을 하위 수준에서 액세스하고 제어합니다."</string> <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"개발 도구"</string> - <string name="permgroupdesc_developmentTools" msgid="9056431193893809814">"응용프로그램 개발자에게만 필요한 기능입니다."</string> + <string name="permgroupdesc_developmentTools" msgid="9056431193893809814">"애플리케이션 개발자에게만 필요한 기능입니다."</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"저장"</string> <string name="permgroupdesc_storage" msgid="9203302214915355774">"SD 카드에 액세스합니다."</string> <string name="permlab_statusBar" msgid="7417192629601890791">"상태 표시줄 사용 중지 또는 수정"</string> - <string name="permdesc_statusBar" msgid="1365473595331989732">"응용프로그램이 상태 표시줄을 사용 중지하거나 시스템 아이콘을 추가 및 제거할 수 있도록 합니다."</string> + <string name="permdesc_statusBar" msgid="1365473595331989732">"애플리케이션이 상태 표시줄을 사용 중지하거나 시스템 아이콘을 추가 및 제거할 수 있도록 합니다."</string> <string name="permlab_expandStatusBar" msgid="1148198785937489264">"상태 표시줄 확장/축소"</string> - <string name="permdesc_expandStatusBar" msgid="7088604400110768665">"응용프로그램이 상태 표시줄을 확장하거나 축소할 수 있도록 합니다."</string> + <string name="permdesc_expandStatusBar" msgid="7088604400110768665">"애플리케이션이 상태 표시줄을 확장하거나 축소할 수 있도록 합니다."</string> <string name="permlab_processOutgoingCalls" msgid="1136262550878335980">"발신전화 가로채기"</string> - <string name="permdesc_processOutgoingCalls" msgid="2228988201852654461">"응용프로그램이 발신전화를 처리하고 전화를 걸 번호를 변경할 수 있도록 합니다. 이 경우 악성 응용프로그램이 발신전화를 모니터링하거나, 다른 방향으로 돌리거나, 중단시킬 수 있습니다."</string> + <string name="permdesc_processOutgoingCalls" msgid="2228988201852654461">"애플리케이션이 발신전화를 처리하고 전화를 걸 번호를 변경할 수 있도록 합니다. 이 경우 악성 애플리케이션이 발신전화를 모니터링하거나, 다른 방향으로 돌리거나, 중단시킬 수 있습니다."</string> <string name="permlab_receiveSms" msgid="2697628268086208535">"SMS 수신"</string> - <string name="permdesc_receiveSms" msgid="6298292335965966117">"응용프로그램이 SMS 메시지를 받고 처리할 수 있도록 합니다. 이 경우 악성 응용프로그램이 메시지를 모니터링하거나 사용자가 보기 전에 삭제할 수 있습니다."</string> + <string name="permdesc_receiveSms" msgid="6298292335965966117">"애플리케이션이 SMS 메시지를 받고 처리할 수 있도록 합니다. 이 경우 악성 애플리케이션이 메시지를 모니터링하거나 사용자가 보기 전에 삭제할 수 있습니다."</string> <string name="permlab_receiveMms" msgid="8894700916188083287">"MMS 수신"</string> - <string name="permdesc_receiveMms" msgid="4563346832000174373">"응용프로그램이 MMS 메시지를 받고 처리할 수 있도록 합니다. 이 경우 악성 응용프로그램이 메시지를 모니터링하거나 사용자가 보기 전에 삭제할 수 있습니다."</string> + <string name="permdesc_receiveMms" msgid="4563346832000174373">"애플리케이션이 MMS 메시지를 받고 처리할 수 있도록 합니다. 이 경우 악성 애플리케이션이 메시지를 모니터링하거나 사용자가 보기 전에 삭제할 수 있습니다."</string> <string name="permlab_sendSms" msgid="5600830612147671529">"SMS 메시지 보내기"</string> - <string name="permdesc_sendSms" msgid="1946540351763502120">"응용프로그램이 SMS 메시지를 보낼 수 있도록 합니다. 이 경우 악성 응용프로그램이 사용자의 확인 없이 메시지를 전송하여 요금을 부과할 수 있습니다."</string> + <string name="permdesc_sendSms" msgid="1946540351763502120">"애플리케이션이 SMS 메시지를 보낼 수 있도록 합니다. 이 경우 악성 애플리케이션이 사용자의 확인 없이 메시지를 전송하여 요금을 부과할 수 있습니다."</string> <string name="permlab_readSms" msgid="4085333708122372256">"SMS 또는 MMS 읽기"</string> - <string name="permdesc_readSms" msgid="3002170087197294591">"응용프로그램이 휴대전화 또는 SIM 카드에 저장된 SMS 메시지를 읽을 수 있도록 합니다. 이 경우 악성 응용프로그램이 기밀 메시지를 읽을 수 있습니다."</string> + <string name="permdesc_readSms" msgid="3002170087197294591">"애플리케이션이 휴대전화 또는 SIM 카드에 저장된 SMS 메시지를 읽을 수 있도록 합니다. 이 경우 악성 애플리케이션이 기밀 메시지를 읽을 수 있습니다."</string> <string name="permlab_writeSms" msgid="6881122575154940744">"SMS 또는 MMS 편집"</string> - <string name="permdesc_writeSms" msgid="6299398896177548095">"응용프로그램이 휴대전화 또는 SIM 카드에 저장된 SMS 메시지에 쓸 수 있도록 합니다. 단, 악성 응용프로그램이 이 기능을 이용하여 메시지를 삭제할 수 있습니다."</string> + <string name="permdesc_writeSms" msgid="6299398896177548095">"애플리케이션이 휴대전화 또는 SIM 카드에 저장된 SMS 메시지에 쓸 수 있도록 합니다. 단, 악성 애플리케이션이 이 기능을 이용하여 메시지를 삭제할 수 있습니다."</string> <string name="permlab_receiveWapPush" msgid="8258226427716551388">"WAP 수신"</string> - <string name="permdesc_receiveWapPush" msgid="5979623826128082171">"응용프로그램이 WAP 메시지를 받고 처리할 수 있도록 합니다. 이 경우 악성 응용프로그램이 메시지를 모니터링하거나 사용자가 보기 전에 삭제할 수 있습니다."</string> - <string name="permlab_getTasks" msgid="5005277531132573353">"실행 중인 응용프로그램 검색"</string> - <string name="permdesc_getTasks" msgid="7048711358713443341">"응용프로그램이 현재 실행 중이거나 최근에 실행된 작업에 대한 정보를 검색할 수 있도록 합니다. 이 경우 악성 응용프로그램이 다른 응용프로그램에 대한 개인 정보를 검색할 수 있습니다."</string> - <string name="permlab_reorderTasks" msgid="5669588525059921549">"실행 중인 응용프로그램 순서 재지정"</string> - <string name="permdesc_reorderTasks" msgid="126252774270522835">"응용프로그램이 작업을 포그라운드나 백그라운드로 이동할 수 있도록 합니다. 이 경우 악성 응용프로그램이 사용자의 조작 없이 앞으로 이동할 수 있습니다."</string> - <string name="permlab_setDebugApp" msgid="4339730312925176742">"응용프로그램 디버깅 사용"</string> - <string name="permdesc_setDebugApp" msgid="5584310661711990702">"응용프로그램이 다른 응용프로그램에 대해 디버깅을 사용할 수 있도록 합니다. 이 경우 악성 응용프로그램이 다른 응용프로그램을 중지시킬 수 있습니다."</string> + <string name="permdesc_receiveWapPush" msgid="5979623826128082171">"애플리케이션이 WAP 메시지를 받고 처리할 수 있도록 합니다. 이 경우 악성 애플리케이션이 메시지를 모니터링하거나 사용자가 보기 전에 삭제할 수 있습니다."</string> + <string name="permlab_getTasks" msgid="5005277531132573353">"실행 중인 애플리케이션 검색"</string> + <string name="permdesc_getTasks" msgid="7048711358713443341">"애플리케이션이 현재 실행 중이거나 최근에 실행된 작업에 대한 정보를 검색할 수 있도록 합니다. 이 경우 악성 애플리케이션이 다른 애플리케이션에 대한 개인 정보를 검색할 수 있습니다."</string> + <string name="permlab_reorderTasks" msgid="5669588525059921549">"실행 중인 애플리케이션 순서 재지정"</string> + <string name="permdesc_reorderTasks" msgid="126252774270522835">"애플리케이션이 작업을 포그라운드나 백그라운드로 이동할 수 있도록 합니다. 이 경우 악성 애플리케이션이 사용자의 조작 없이 앞으로 이동할 수 있습니다."</string> + <string name="permlab_setDebugApp" msgid="4339730312925176742">"애플리케이션 디버깅 사용"</string> + <string name="permdesc_setDebugApp" msgid="5584310661711990702">"애플리케이션이 다른 애플리케이션에 대해 디버깅을 사용할 수 있도록 합니다. 이 경우 악성 애플리케이션이 다른 애플리케이션을 중지시킬 수 있습니다."</string> <string name="permlab_changeConfiguration" msgid="8214475779521218295">"UI 설정 변경"</string> - <string name="permdesc_changeConfiguration" msgid="3465121501528064399">"응용프로그램이 로케일 또는 전체 글꼴 크기와 같은 현재 구성을 변경할 수 있도록 합니다."</string> + <string name="permdesc_changeConfiguration" msgid="3465121501528064399">"애플리케이션이 로케일 또는 전체 글꼴 크기와 같은 현재 구성을 변경할 수 있도록 합니다."</string> <string name="permlab_enableCarMode" msgid="5684504058192921098">"차량 모드 사용"</string> - <string name="permdesc_enableCarMode" msgid="5673461159384850628">"응용프로그램이 차량 모드를 사용할 수 있도록 합니다."</string> + <string name="permdesc_enableCarMode" msgid="5673461159384850628">"애플리케이션이 차량 모드를 사용할 수 있도록 합니다."</string> <string name="permlab_killBackgroundProcesses" msgid="8373714752793061963">"백그라운드 프로세스 종료"</string> - <string name="permdesc_killBackgroundProcesses" msgid="2908829602869383753">"메모리가 부족하지 않은 경우에도 응용프로그램이 다른 응용프로그램의 백그라운드 프로세스를 중단할 수 있도록 합니다."</string> - <string name="permlab_forceStopPackages" msgid="1447830113260156236">"다른 응용프로그램 강제 종료"</string> - <string name="permdesc_forceStopPackages" msgid="7263036616161367402">"응용프로그램이 다른 응용프로그램을 강제로 종료할 수 있도록 합니다."</string> - <string name="permlab_forceBack" msgid="1804196839880393631">"강제로 응용프로그램 닫기"</string> - <string name="permdesc_forceBack" msgid="6534109744159919013">"응용프로그램이 포그라운드에 있는 활동을 강제로 닫고 되돌아갈 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_killBackgroundProcesses" msgid="2908829602869383753">"메모리가 부족하지 않은 경우에도 애플리케이션이 다른 애플리케이션의 백그라운드 프로세스를 중단할 수 있도록 합니다."</string> + <string name="permlab_forceStopPackages" msgid="1447830113260156236">"다른 애플리케이션 강제 종료"</string> + <string name="permdesc_forceStopPackages" msgid="7263036616161367402">"애플리케이션이 다른 애플리케이션을 강제로 종료할 수 있도록 합니다."</string> + <string name="permlab_forceBack" msgid="1804196839880393631">"강제로 애플리케이션 닫기"</string> + <string name="permdesc_forceBack" msgid="6534109744159919013">"애플리케이션이 포그라운드에 있는 활동을 강제로 닫고 되돌아갈 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_dump" msgid="1681799862438954752">"시스템 내부 상태 검색"</string> - <string name="permdesc_dump" msgid="2198776174276275220">"응용프로그램이 시스템의 내부 상태를 검색할 수 있도록 합니다. 단, 악성 응용프로그램이 이 기능을 이용하여 일반적으로 필요하지 않은 다양한 개인정보와 보안정보를 검색할 수 있습니다."</string> + <string name="permdesc_dump" msgid="2198776174276275220">"애플리케이션이 시스템의 내부 상태를 검색할 수 있도록 합니다. 단, 악성 애플리케이션이 이 기능을 이용하여 일반적으로 필요하지 않은 다양한 개인정보와 보안정보를 검색할 수 있습니다."</string> <string name="permlab_shutdown" msgid="7185747824038909016">"부분 종료"</string> <string name="permdesc_shutdown" msgid="7046500838746291775">"작업 관리자를 종료 상태로 설정합니다. 전체 종료를 수행하지는 않습니다."</string> - <string name="permlab_stopAppSwitches" msgid="4138608610717425573">"응용프로그램 전환 방지"</string> - <string name="permdesc_stopAppSwitches" msgid="3857886086919033794">"사용자가 다른 응용프로그램으로 전환하지 못하게 합니다."</string> - <string name="permlab_runSetActivityWatcher" msgid="7811586187574696296">"실행 중인 모든 응용프로그램 모니터링 및 제어"</string> - <string name="permdesc_runSetActivityWatcher" msgid="3228701938345388092">"응용프로그램이 시스템에서 활동이 시작되는 방식을 모니터링하고 제어할 수 있도록 합니다. 단, 악성 응용프로그램이 이 기능을 이용하여 시스템을 완전히 손상시킬 수 있습니다. 이 권한은 개발 과정에만 필요하며 일반 휴대전화 사용 시에는 필요하지 않습니다."</string> + <string name="permlab_stopAppSwitches" msgid="4138608610717425573">"애플리케이션 전환 방지"</string> + <string name="permdesc_stopAppSwitches" msgid="3857886086919033794">"사용자가 다른 애플리케이션으로 전환하지 못하게 합니다."</string> + <string name="permlab_runSetActivityWatcher" msgid="7811586187574696296">"실행 중인 모든 애플리케이션 모니터링 및 제어"</string> + <string name="permdesc_runSetActivityWatcher" msgid="3228701938345388092">"애플리케이션이 시스템에서 활동이 시작되는 방식을 모니터링하고 제어할 수 있도록 합니다. 단, 악성 애플리케이션이 이 기능을 이용하여 시스템을 완전히 손상시킬 수 있습니다. 이 권한은 개발 과정에만 필요하며 일반 휴대전화 사용 시에는 필요하지 않습니다."</string> <string name="permlab_broadcastPackageRemoved" msgid="2576333434893532475">"패키지 제거 브로드캐스트 보내기"</string> - <string name="permdesc_broadcastPackageRemoved" msgid="3453286591439891260">"응용프로그램이 응용프로그램 패키지가 삭제되었다는 알림을 브로드캐스트할 수 있도록 합니다. 이 경우 악성 응용프로그램이 실행 중인 다른 응용프로그램을 중지시킬 수 있습니다."</string> + <string name="permdesc_broadcastPackageRemoved" msgid="3453286591439891260">"애플리케이션이 애플리케이션 패키지가 삭제되었다는 알림을 브로드캐스트할 수 있도록 합니다. 이 경우 악성 애플리케이션이 실행 중인 다른 애플리케이션을 중지시킬 수 있습니다."</string> <string name="permlab_broadcastSmsReceived" msgid="5689095009030336593">"SMS 수신 브로드캐스트 보내기"</string> - <string name="permdesc_broadcastSmsReceived" msgid="9122419277306740155">"응용프로그램이 SMS 메시지를 받았다는 알림을 브로드캐스트할 수 있도록 합니다. 이 경우 악성 응용프로그램이 수신된 SMS 메시지처럼 위장할 수 있습니다."</string> + <string name="permdesc_broadcastSmsReceived" msgid="9122419277306740155">"애플리케이션이 SMS 메시지를 받았다는 알림을 브로드캐스트할 수 있도록 합니다. 이 경우 악성 애플리케이션이 수신된 SMS 메시지처럼 위장할 수 있습니다."</string> <string name="permlab_broadcastWapPush" msgid="3145347413028582371">"WAP-PUSH-수신 브로드캐스트 보내기"</string> - <string name="permdesc_broadcastWapPush" msgid="3955303669461378091">"응용프로그램이 WAP PUSH 메시지를 받았다는 알림을 브로드캐스트할 수 있도록 합니다. 이 경우 악성 응용프로그램이 MMS 메시지를 받은 것처럼 위장하거나 웹페이지의 콘텐츠를 악성 변종으로 몰래 바꿀 수 있습니다."</string> + <string name="permdesc_broadcastWapPush" msgid="3955303669461378091">"애플리케이션이 WAP PUSH 메시지를 받았다는 알림을 브로드캐스트할 수 있도록 합니다. 이 경우 악성 애플리케이션이 MMS 메시지를 받은 것처럼 위장하거나 웹페이지의 콘텐츠를 악성 변종으로 몰래 바꿀 수 있습니다."</string> <string name="permlab_setProcessLimit" msgid="2451873664363662666">"실행 중인 프로세스 수 제한"</string> - <string name="permdesc_setProcessLimit" msgid="7824786028557379539">"응용프로그램이 실행할 최대 프로세스 수를 제어할 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> - <string name="permlab_setAlwaysFinish" msgid="5342837862439543783">"모든 백그라운드 응용프로그램이 닫히도록 하기"</string> - <string name="permdesc_setAlwaysFinish" msgid="8773936403987091620">"응용프로그램이 백그라운드로 이동한 활동을 항상 바로 종료할지 여부를 제어할 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_setProcessLimit" msgid="7824786028557379539">"애플리케이션이 실행할 최대 프로세스 수를 제어할 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> + <string name="permlab_setAlwaysFinish" msgid="5342837862439543783">"모든 백그라운드 애플리케이션이 닫히도록 하기"</string> + <string name="permdesc_setAlwaysFinish" msgid="8773936403987091620">"애플리케이션이 백그라운드로 이동한 활동을 항상 바로 종료할지 여부를 제어할 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_batteryStats" msgid="7863923071360031652">"배터리 통계 수정"</string> - <string name="permdesc_batteryStats" msgid="5847319823772230560">"수집된 배터리 통계를 수정할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_batteryStats" msgid="5847319823772230560">"수집된 배터리 통계를 수정할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_backup" msgid="470013022865453920">"시스템 백업 및 복원 관리"</string> - <string name="permdesc_backup" msgid="4837493065154256525">"응용프로그램이 시스템의 백업 및 복원 매커니즘을 제어할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_backup" msgid="4837493065154256525">"애플리케이션이 시스템의 백업 및 복원 매커니즘을 제어할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_internalSystemWindow" msgid="2148563628140193231">"인증되지 않은 창 표시"</string> - <string name="permdesc_internalSystemWindow" msgid="5895082268284998469">"내부 시스템 사용자 인터페이스에서 사용하는 창을 만들 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_internalSystemWindow" msgid="5895082268284998469">"내부 시스템 사용자 인터페이스에서 사용하는 창을 만들 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_systemAlertWindow" msgid="3372321942941168324">"시스템 수준 경고 표시"</string> - <string name="permdesc_systemAlertWindow" msgid="5109622689323490558">"응용프로그램이 시스템 경고 창을 표시할 수 있도록 합니다. 이 경우 악성 응용프로그램이 휴대전화 화면 전체를 차지할 수 있습니다."</string> + <string name="permdesc_systemAlertWindow" msgid="5109622689323490558">"애플리케이션이 시스템 경고 창을 표시할 수 있도록 합니다. 이 경우 악성 애플리케이션이 휴대전화 화면 전체를 차지할 수 있습니다."</string> <string name="permlab_setAnimationScale" msgid="2805103241153907174">"전체 애니메이션 속도 수정"</string> - <string name="permdesc_setAnimationScale" msgid="7181522138912391988">"응용프로그램이 언제든지 전체 애니메이션 속도를 빠르게 또는 느리게 변경할 수 있도록 합니다."</string> - <string name="permlab_manageAppTokens" msgid="17124341698093865">"응용프로그램 토큰 관리"</string> - <string name="permdesc_manageAppTokens" msgid="977127907524195988">"응용프로그램이 일반적인 Z-순서를 무시하여 자체 토큰을 만들고 관리할 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_setAnimationScale" msgid="7181522138912391988">"애플리케이션이 언제든지 전체 애니메이션 속도를 빠르게 또는 느리게 변경할 수 있도록 합니다."</string> + <string name="permlab_manageAppTokens" msgid="17124341698093865">"애플리케이션 토큰 관리"</string> + <string name="permdesc_manageAppTokens" msgid="977127907524195988">"애플리케이션이 일반적인 Z-순서를 무시하여 자체 토큰을 만들고 관리할 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_injectEvents" msgid="1378746584023586600">"키 및 컨트롤 버튼 누르기"</string> - <string name="permdesc_injectEvents" msgid="3946098050410874715">"응용프로그램이 입력 이벤트(예: 키 누름)를 다른 응용프로그램에 전달할 수 있도록 합니다. 이 경우 악성 응용프로그램이 휴대전화를 완전히 제어할 수 있습니다."</string> + <string name="permdesc_injectEvents" msgid="3946098050410874715">"애플리케이션이 입력 이벤트(예: 키 누름)를 다른 애플리케이션에 전달할 수 있도록 합니다. 이 경우 악성 애플리케이션이 휴대전화를 완전히 제어할 수 있습니다."</string> <string name="permlab_readInputState" msgid="469428900041249234">"사용자가 입력한 내용 및 수행한 작업 기록"</string> - <string name="permdesc_readInputState" msgid="5132879321450325445">"응용프로그램이 다른 응용프로그램과 상호작용할 때에도 사용자가 누르는 키(예: 비밀번호 입력)를 볼 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_readInputState" msgid="5132879321450325445">"애플리케이션이 다른 애플리케이션과 상호작용할 때에도 사용자가 누르는 키(예: 비밀번호 입력)를 볼 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_bindInputMethod" msgid="3360064620230515776">"입력 방법 연결"</string> - <string name="permdesc_bindInputMethod" msgid="3734838321027317228">"권한을 가진 프로그램이 입력 방법에 대한 최상위 인터페이스를 사용하도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_bindInputMethod" msgid="3734838321027317228">"권한을 가진 프로그램이 입력 방법에 대한 최상위 인터페이스를 사용하도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_bindWallpaper" msgid="8716400279937856462">"배경화면 연결"</string> - <string name="permdesc_bindWallpaper" msgid="5287754520361915347">"권한을 가진 프로그램이 배경화면에 대한 최상위 인터페이스를 사용하도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_bindWallpaper" msgid="5287754520361915347">"권한을 가진 프로그램이 배경화면에 대한 최상위 인터페이스를 사용하도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_bindDeviceAdmin" msgid="8704986163711455010">"기기 관리자와 상호 작용"</string> - <string name="permdesc_bindDeviceAdmin" msgid="8714424333082216979">"보유자가 기기 관리자에게 인텐트를 보낼 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> + <string name="permdesc_bindDeviceAdmin" msgid="8714424333082216979">"보유자가 기기 관리자에게 인텐트를 보낼 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> <string name="permlab_setOrientation" msgid="3365947717163866844">"화면 방향 변경"</string> - <string name="permdesc_setOrientation" msgid="6335814461615851863">"응용프로그램이 언제든지 화면 회전을 변경할 수 있도록 합니다. 일반 응용프로그램에는 절대로 필요하지 않습니다."</string> - <string name="permlab_signalPersistentProcesses" msgid="4255467255488653854">"응용프로그램에 Linux 시그널 보내기"</string> - <string name="permdesc_signalPersistentProcesses" msgid="3565530463215015289">"응용프로그램이 제공된 시그널을 모든 영구 프로세스로 보내도록 요청할 수 있도록 합니다."</string> - <string name="permlab_persistentActivity" msgid="8659652042401085862">"응용프로그램이 항상 실행되도록 설정"</string> - <string name="permdesc_persistentActivity" msgid="5037199778265006008">"응용프로그램이 자신의 일부 구성 요소를 지속가능으로 설정하여 다른 응용프로그램에 사용할 수 없도록 합니다."</string> - <string name="permlab_deletePackages" msgid="3343439331576348805">"응용프로그램 삭제"</string> - <string name="permdesc_deletePackages" msgid="3634943677518723314">"응용프로그램이 Android 패키지를 삭제할 수 있도록 합니다. 이 경우 악성 응용프로그램이 중요한 응용프로그램을 삭제할 수 있습니다."</string> - <string name="permlab_clearAppUserData" msgid="2192134353540277878">"다른 응용프로그램의 데이터 삭제"</string> - <string name="permdesc_clearAppUserData" msgid="7546345080434325456">"응용프로그램이 사용자 데이터를 지울 수 있도록 합니다."</string> - <string name="permlab_deleteCacheFiles" msgid="1518556602634276725">"다른 응용프로그램의 캐시 삭제"</string> - <string name="permdesc_deleteCacheFiles" msgid="2283074077168165971">"응용프로그램이 캐시 파일을 삭제할 수 있도록 합니다."</string> - <string name="permlab_getPackageSize" msgid="4799785352306641460">"응용프로그램 저장공간 계산"</string> - <string name="permdesc_getPackageSize" msgid="5557253039670753437">"응용프로그램이 해당 코드, 데이터 및 캐시 크기를 검색할 수 있도록 합니다."</string> - <string name="permlab_installPackages" msgid="335800214119051089">"응용프로그램 직접 설치"</string> - <string name="permdesc_installPackages" msgid="526669220850066132">"응용프로그램이 새로운 또는 업데이트된 Android 패키지를 설치할 수 있도록 합니다. 이 경우 악성 응용프로그램이 임의의 강력한 권한으로 새 응용프로그램을 추가할 수 있습니다."</string> - <string name="permlab_clearAppCache" msgid="4747698311163766540">"모든 응용프로그램 캐시 데이터 삭제"</string> - <string name="permdesc_clearAppCache" msgid="7740465694193671402">"응용프로그램이 응용프로그램 캐시 디렉토리에 있는 파일을 삭제하여 휴대전화의 저장공간을 늘릴 수 있도록 합니다. 액세스는 일반적으로 시스템 프로세스로 제한됩니다."</string> - <string name="permlab_movePackage" msgid="728454979946503926">"응용프로그램 리소스 이동"</string> - <string name="permdesc_movePackage" msgid="6323049291923925277">"응용프로그램이 응용프로그램 리소스를 내부에서 외부 미디어로 또는 그 반대로 이동할 수 있도록 합니다."</string> + <string name="permdesc_setOrientation" msgid="6335814461615851863">"애플리케이션이 언제든지 화면 회전을 변경할 수 있도록 합니다. 일반 애플리케이션에는 절대로 필요하지 않습니다."</string> + <string name="permlab_signalPersistentProcesses" msgid="4255467255488653854">"애플리케이션에 Linux 시그널 보내기"</string> + <string name="permdesc_signalPersistentProcesses" msgid="3565530463215015289">"애플리케이션이 제공된 시그널을 모든 영구 프로세스로 보내도록 요청할 수 있도록 합니다."</string> + <string name="permlab_persistentActivity" msgid="8659652042401085862">"애플리케이션이 항상 실행되도록 설정"</string> + <string name="permdesc_persistentActivity" msgid="5037199778265006008">"애플리케이션이 자신의 일부 구성 요소를 지속가능으로 설정하여 다른 애플리케이션에 사용할 수 없도록 합니다."</string> + <string name="permlab_deletePackages" msgid="3343439331576348805">"애플리케이션 삭제"</string> + <string name="permdesc_deletePackages" msgid="3634943677518723314">"애플리케이션이 Android 패키지를 삭제할 수 있도록 합니다. 이 경우 악성 애플리케이션이 중요한 애플리케이션을 삭제할 수 있습니다."</string> + <string name="permlab_clearAppUserData" msgid="2192134353540277878">"다른 애플리케이션의 데이터 삭제"</string> + <string name="permdesc_clearAppUserData" msgid="7546345080434325456">"애플리케이션이 사용자 데이터를 지울 수 있도록 합니다."</string> + <string name="permlab_deleteCacheFiles" msgid="1518556602634276725">"다른 애플리케이션의 캐시 삭제"</string> + <string name="permdesc_deleteCacheFiles" msgid="2283074077168165971">"애플리케이션이 캐시 파일을 삭제할 수 있도록 합니다."</string> + <string name="permlab_getPackageSize" msgid="4799785352306641460">"애플리케이션 저장공간 계산"</string> + <string name="permdesc_getPackageSize" msgid="5557253039670753437">"애플리케이션이 해당 코드, 데이터 및 캐시 크기를 검색할 수 있도록 합니다."</string> + <string name="permlab_installPackages" msgid="335800214119051089">"애플리케이션 직접 설치"</string> + <string name="permdesc_installPackages" msgid="526669220850066132">"애플리케이션이 새로운 또는 업데이트된 Android 패키지를 설치할 수 있도록 합니다. 이 경우 악성 애플리케이션이 임의의 강력한 권한으로 새 애플리케이션을 추가할 수 있습니다."</string> + <string name="permlab_clearAppCache" msgid="4747698311163766540">"모든 애플리케이션 캐시 데이터 삭제"</string> + <string name="permdesc_clearAppCache" msgid="7740465694193671402">"애플리케이션이 애플리케이션 캐시 디렉토리에 있는 파일을 삭제하여 휴대전화의 저장공간을 늘릴 수 있도록 합니다. 액세스는 일반적으로 시스템 프로세스로 제한됩니다."</string> + <string name="permlab_movePackage" msgid="728454979946503926">"애플리케이션 리소스 이동"</string> + <string name="permdesc_movePackage" msgid="6323049291923925277">"애플리케이션이 애플리케이션 리소스를 내부에서 외부 미디어로 또는 그 반대로 이동할 수 있도록 합니다."</string> <string name="permlab_readLogs" msgid="4811921703882532070">"시스템 로그 파일 읽기"</string> - <string name="permdesc_readLogs" msgid="2257937955580475902">"응용프로그램이 시스템의 다양한 로그 파일을 읽을 수 있도록 합니다. 이 경우 응용프로그램은 사용자가 휴대전화로 수행하는 작업에 대한 일반적인 정보를 검색할 수 있습니다. 하지만 로그 파일에 어떠한 개인정보도 포함되어서는 안 됩니다."</string> + <string name="permdesc_readLogs" msgid="2257937955580475902">"애플리케이션이 시스템의 다양한 로그 파일을 읽을 수 있도록 합니다. 이 경우 애플리케이션은 사용자가 휴대전화로 수행하는 작업에 대한 일반적인 정보를 검색할 수 있습니다. 하지만 로그 파일에 어떠한 개인정보도 포함되어서는 안 됩니다."</string> <string name="permlab_diagnostic" msgid="8076743953908000342">"진단 그룹 소유의 리소스 읽기/쓰기"</string> - <string name="permdesc_diagnostic" msgid="3121238373951637049">"응용프로그램이 진단 그룹 소유의 리소스(예: /dev에 있는 파일)를 읽고 쓸 수 있도록 합니다. 이 기능은 시스템 안정성 및 보안에 영향을 미칠 수 있으므로 제조업체 또는 사업자가 하드웨어 관련 진단을 수행하는 경우에만 사용해야 합니다."</string> - <string name="permlab_changeComponentState" msgid="79425198834329406">"응용프로그램 구성 요소 사용 또는 사용 안함"</string> - <string name="permdesc_changeComponentState" msgid="4569107043246700630">"응용프로그램이 다른 응용프로그램 구성 요소 사용 여부를 변경할 수 있도록 합니다. 이 경우 악성 응용프로그램이 중요한 휴대전화 기능을 사용하지 않도록 설정할 수 있습니다. 이 권한을 설정할 경우 응용프로그램 구성 요소가 사용 불가능하게 되거나 일관성이 맞지 않거나 불안정해질 수 있으므로 주의해야 합니다."</string> - <string name="permlab_setPreferredApplications" msgid="3393305202145172005">"기본 응용프로그램 설정"</string> - <string name="permdesc_setPreferredApplications" msgid="760008293501937546">"응용프로그램이 기본 응용프로그램을 수정할 수 있도록 합니다. 이 경우 악성 응용프로그램이 사용자의 개인 정보를 수집하기 위해 기존 응용프로그램으로 위장하도록 실행되는 응용프로그램을 몰래 변경할 수 있습니다."</string> + <string name="permdesc_diagnostic" msgid="3121238373951637049">"애플리케이션이 진단 그룹 소유의 리소스(예: /dev에 있는 파일)를 읽고 쓸 수 있도록 합니다. 이 기능은 시스템 안정성 및 보안에 영향을 미칠 수 있으므로 제조업체 또는 사업자가 하드웨어 관련 진단을 수행하는 경우에만 사용해야 합니다."</string> + <string name="permlab_changeComponentState" msgid="79425198834329406">"애플리케이션 구성 요소 사용 또는 사용 안함"</string> + <string name="permdesc_changeComponentState" msgid="4569107043246700630">"애플리케이션이 다른 애플리케이션 구성 요소 사용 여부를 변경할 수 있도록 합니다. 이 경우 악성 애플리케이션이 중요한 휴대전화 기능을 사용하지 않도록 설정할 수 있습니다. 이 권한을 설정할 경우 애플리케이션 구성 요소가 사용 불가능하게 되거나 일관성이 맞지 않거나 불안정해질 수 있으므로 주의해야 합니다."</string> + <string name="permlab_setPreferredApplications" msgid="3393305202145172005">"기본 애플리케이션 설정"</string> + <string name="permdesc_setPreferredApplications" msgid="760008293501937546">"애플리케이션이 기본 애플리케이션을 수정할 수 있도록 합니다. 이 경우 악성 애플리케이션이 사용자의 개인 정보를 수집하기 위해 기존 애플리케이션으로 위장하도록 실행되는 애플리케이션을 몰래 변경할 수 있습니다."</string> <string name="permlab_writeSettings" msgid="1365523497395143704">"전체 시스템 설정 수정"</string> - <string name="permdesc_writeSettings" msgid="838789419871034696">"응용프로그램이 시스템의 설정 데이터를 수정할 수 있도록 합니다. 이 경우 악성 응용프로그램이 시스템 구성을 손상시킬 수 있습니다."</string> + <string name="permdesc_writeSettings" msgid="838789419871034696">"애플리케이션이 시스템의 설정 데이터를 수정할 수 있도록 합니다. 이 경우 악성 애플리케이션이 시스템 구성을 손상시킬 수 있습니다."</string> <string name="permlab_writeSecureSettings" msgid="204676251876718288">"보안 시스템 설정 수정"</string> - <string name="permdesc_writeSecureSettings" msgid="5497873143539034724">"응용프로그램이 시스템의 보안 설정값 데이터를 수정할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_writeSecureSettings" msgid="5497873143539034724">"애플리케이션이 시스템의 보안 설정값 데이터를 수정할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_writeGservices" msgid="2149426664226152185">"Google 서비스 지도 수정"</string> - <string name="permdesc_writeGservices" msgid="6602362746516676175">"응용프로그램이 Google 서비스 지도를 수정할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_writeGservices" msgid="6602362746516676175">"애플리케이션이 Google 서비스 지도를 수정할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"부팅할 때 자동 시작"</string> - <string name="permdesc_receiveBootCompleted" msgid="698336728415008796">"응용프로그램이 시스템 부팅이 끝난 후 바로 시작할 수 있도록 합니다. 이 경우 휴대전화가 시작하는 데 시간이 오래 걸리고 응용프로그램이 항상 실행되어 전체 휴대전화 속도가 느려질 수 있습니다."</string> + <string name="permdesc_receiveBootCompleted" msgid="698336728415008796">"애플리케이션이 시스템 부팅이 끝난 후 바로 시작할 수 있도록 합니다. 이 경우 휴대전화가 시작하는 데 시간이 오래 걸리고 애플리케이션이 항상 실행되어 전체 휴대전화 속도가 느려질 수 있습니다."</string> <string name="permlab_broadcastSticky" msgid="7919126372606881614">"스티키 브로드캐스트 보내기"</string> - <string name="permdesc_broadcastSticky" msgid="1920045289234052219">"응용프로그램이 브로드캐스트가 끝난 후에도 유지되는 스티키 브로드캐스트(Sticky Broadcast)를 보낼 수 있도록 합니다. 이 경우 악성 응용프로그램이 휴대전화가 메모리를 너무 많이 사용하도록 하여 속도를 저하시키거나 불안정하게 만들 수 있습니다."</string> + <string name="permdesc_broadcastSticky" msgid="1920045289234052219">"애플리케이션이 브로드캐스트가 끝난 후에도 유지되는 스티키 브로드캐스트(Sticky Broadcast)를 보낼 수 있도록 합니다. 이 경우 악성 애플리케이션이 휴대전화가 메모리를 너무 많이 사용하도록 하여 속도를 저하시키거나 불안정하게 만들 수 있습니다."</string> <string name="permlab_readContacts" msgid="6219652189510218240">"연락처 데이터 읽기"</string> - <string name="permdesc_readContacts" msgid="3371591512896545975">"응용프로그램이 휴대전화에 저장된 모든 연락처(주소) 데이터를 읽을 수 있도록 합니다. 이 경우 악성 응용프로그램이 데이터를 다른 사람에게 보낼 수 있습니다."</string> + <string name="permdesc_readContacts" msgid="3371591512896545975">"애플리케이션이 휴대전화에 저장된 모든 연락처(주소) 데이터를 읽을 수 있도록 합니다. 이 경우 악성 애플리케이션이 데이터를 다른 사람에게 보낼 수 있습니다."</string> <string name="permlab_writeContacts" msgid="644616215860933284">"연락처 데이터 작성"</string> - <string name="permdesc_writeContacts" msgid="3924383579108183601">"응용프로그램이 휴대전화에 저장된 연락처(주소) 데이터를 수정할 수 있도록 합니다. 이 경우 악성 응용프로그램이 연락처 데이터를 지우거나 수정할 수 있습니다."</string> + <string name="permdesc_writeContacts" msgid="3924383579108183601">"애플리케이션이 휴대전화에 저장된 연락처(주소) 데이터를 수정할 수 있도록 합니다. 이 경우 악성 애플리케이션이 연락처 데이터를 지우거나 수정할 수 있습니다."</string> <string name="permlab_writeOwnerData" msgid="4892555913849295393">"소유자 데이터 작성"</string> - <string name="permdesc_writeOwnerData" msgid="2344055317969787124">"응용프로그램이 휴대전화에 저장된 소유자 데이터를 수정할 수 있도록 합니다. 단, 악성 응용프로그램이 이 기능을 이용하여 소유자 데이터를 지우거나 수정할 수 있습니다."</string> + <string name="permdesc_writeOwnerData" msgid="2344055317969787124">"애플리케이션이 휴대전화에 저장된 소유자 데이터를 수정할 수 있도록 합니다. 단, 악성 애플리케이션이 이 기능을 이용하여 소유자 데이터를 지우거나 수정할 수 있습니다."</string> <string name="permlab_readOwnerData" msgid="6668525984731523563">"소유자 데이터 읽기"</string> - <string name="permdesc_readOwnerData" msgid="3088486383128434507">"응용프로그램이 휴대전화에 저장된 휴대전화 소유자 데이터를 읽을 수 있도록 합니다. 이 경우 악성 응용프로그램이 휴대전화 소유자 데이터를 읽을 수 있습니다."</string> + <string name="permdesc_readOwnerData" msgid="3088486383128434507">"애플리케이션이 휴대전화에 저장된 휴대전화 소유자 데이터를 읽을 수 있도록 합니다. 이 경우 악성 애플리케이션이 휴대전화 소유자 데이터를 읽을 수 있습니다."</string> <string name="permlab_readCalendar" msgid="6898987798303840534">"캘린더 일정 읽기"</string> - <string name="permdesc_readCalendar" msgid="5533029139652095734">"응용프로그램이 휴대전화에 저장된 모든 캘린더 일정을 읽을 수 있도록 합니다. 이 경우 악성 응용프로그램이 캘린더 일정을 다른 사람에게 보낼 수 있습니다."</string> + <string name="permdesc_readCalendar" msgid="5533029139652095734">"애플리케이션이 휴대전화에 저장된 모든 캘린더 일정을 읽을 수 있도록 합니다. 이 경우 악성 애플리케이션이 캘린더 일정을 다른 사람에게 보낼 수 있습니다."</string> <string name="permlab_writeCalendar" msgid="3894879352594904361">"캘린더 일정 추가/수정 및 참석자에게 이메일 전송"</string> - <string name="permdesc_writeCalendar" msgid="2988871373544154221">"응용프로그램이 캘린더에 일정을 추가하거나 변경할 수 있도록 합니다. 이렇게 하면 참석자에게 이메일을 보낼 수 있습니다. 악성 응용프로그램이 이를 사용하여 캘린더 일정을 삭제, 수정하거나 참석자에게 이메일을 보낼 수 있습니다."</string> + <string name="permdesc_writeCalendar" msgid="2988871373544154221">"애플리케이션이 캘린더에 일정을 추가하거나 변경할 수 있도록 합니다. 이렇게 하면 참석자에게 이메일을 보낼 수 있습니다. 악성 애플리케이션이 이를 사용하여 캘린더 일정을 삭제, 수정하거나 참석자에게 이메일을 보낼 수 있습니다."</string> <string name="permlab_accessMockLocation" msgid="8688334974036823330">"테스트를 위해 위치 정보제공자로 가장"</string> - <string name="permdesc_accessMockLocation" msgid="7648286063459727252">"테스트용 가짜 위치 정보 제공자를 만듭니다. 단, 악성 응용프로그램이 이 기능을 이용하여 GPS, 네트워크 공급자 같은 실제 위치 정보제공자에서 반환한 위치 및/또는 상태를 덮어쓸 수 있습니다."</string> + <string name="permdesc_accessMockLocation" msgid="7648286063459727252">"테스트용 가짜 위치 정보 제공자를 만듭니다. 단, 악성 애플리케이션이 이 기능을 이용하여 GPS, 네트워크 공급자 같은 실제 위치 정보제공자에서 반환한 위치 및/또는 상태를 덮어쓸 수 있습니다."</string> <string name="permlab_accessLocationExtraCommands" msgid="2836308076720553837">"추가 위치 제공업체 명령에 액세스"</string> - <string name="permdesc_accessLocationExtraCommands" msgid="1948144701382451721">"추가적인 위치 제공 명령을 사용합니다. 단, 악성 응용프로그램이 이 기능을 이용하여 GPS 또는 기타 위치 소스의 작동을 방해할 수 있습니다."</string> + <string name="permdesc_accessLocationExtraCommands" msgid="1948144701382451721">"추가적인 위치 제공 명령을 사용합니다. 단, 악성 애플리케이션이 이 기능을 이용하여 GPS 또는 기타 위치 소스의 작동을 방해할 수 있습니다."</string> <string name="permlab_installLocationProvider" msgid="6578101199825193873">"위치 정보 공급자 설치 권한"</string> - <string name="permdesc_installLocationProvider" msgid="5449175116732002106">"테스트용 가짜 위치 정보제공자를 만듭니다. 단, 악성 응용프로그램이 이 기능을 이용하여 GPS, 네트워크 공급업체 같은 실제 위치 소스에서 반환한 위치 및/또는 상태를 덮어쓰거나 사용자의 위치를 모니터링하여 외부 소스로 보고할 수 있습니다."</string> + <string name="permdesc_installLocationProvider" msgid="5449175116732002106">"테스트용 가짜 위치 정보제공자를 만듭니다. 단, 악성 애플리케이션이 이 기능을 이용하여 GPS, 네트워크 공급업체 같은 실제 위치 소스에서 반환한 위치 및/또는 상태를 덮어쓰거나 사용자의 위치를 모니터링하여 외부 소스로 보고할 수 있습니다."</string> <string name="permlab_accessFineLocation" msgid="8116127007541369477">"자세한 (GPS) 위치"</string> - <string name="permdesc_accessFineLocation" msgid="7411213317434337331">"GPS 등의 자세한 위치 정보가 사용 가능한 경우 휴대전화에서 이를 사용합니다. 이 경우 악성 응용프로그램이 사용자의 위치를 확인하고 추가 배터리 전원을 소비할 수 있습니다."</string> + <string name="permdesc_accessFineLocation" msgid="7411213317434337331">"GPS 등의 자세한 위치 정보가 사용 가능한 경우 휴대전화에서 이를 사용합니다. 이 경우 악성 애플리케이션이 사용자의 위치를 확인하고 추가 배터리 전원을 소비할 수 있습니다."</string> <string name="permlab_accessCoarseLocation" msgid="4642255009181975828">"네트워크 기반의 대략적인 위치"</string> - <string name="permdesc_accessCoarseLocation" msgid="8235655958070862293">"휴대전화의 대략적인 위치를 측정하기 위해 셀룰러 네트워크 데이터베이스와 같은 광범위한 위치 정보를 사용합니다. 이 경우 악성 응용프로그램이 사용자의 위치를 대략적으로 측정할 수 있습니다."</string> + <string name="permdesc_accessCoarseLocation" msgid="8235655958070862293">"휴대전화의 대략적인 위치를 측정하기 위해 셀룰러 네트워크 데이터베이스와 같은 광범위한 위치 정보를 사용합니다. 이 경우 악성 애플리케이션이 사용자의 위치를 대략적으로 측정할 수 있습니다."</string> <string name="permlab_accessSurfaceFlinger" msgid="2363969641792388947">"SurfaceFlinger 액세스"</string> - <string name="permdesc_accessSurfaceFlinger" msgid="6805241830020733025">"응용프로그램이 SurfaceFlinger의 하위 수준 기능을 사용할 수 있도록 합니다."</string> + <string name="permdesc_accessSurfaceFlinger" msgid="6805241830020733025">"애플리케이션이 SurfaceFlinger의 하위 수준 기능을 사용할 수 있도록 합니다."</string> <string name="permlab_readFrameBuffer" msgid="6690504248178498136">"프레임 버퍼 읽기"</string> - <string name="permdesc_readFrameBuffer" msgid="7530020370469942528">"응용프로그램이 프레임 버퍼의 내용을 읽을 수 있도록 합니다."</string> + <string name="permdesc_readFrameBuffer" msgid="7530020370469942528">"애플리케이션이 프레임 버퍼의 내용을 읽을 수 있도록 합니다."</string> <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"오디오 설정 변경"</string> - <string name="permdesc_modifyAudioSettings" msgid="5793461287365991922">"응용프로그램이 볼륨 및 경로 지정 같은 전체 오디오 설정을 수정할 수 있도록 합니다."</string> + <string name="permdesc_modifyAudioSettings" msgid="5793461287365991922">"애플리케이션이 볼륨 및 경로 지정 같은 전체 오디오 설정을 수정할 수 있도록 합니다."</string> <string name="permlab_recordAudio" msgid="3876049771427466323">"오디오 녹음"</string> - <string name="permdesc_recordAudio" msgid="6493228261176552356">"응용프로그램이 오디오 레코드 경로에 액세스할 수 있도록 합니다."</string> + <string name="permdesc_recordAudio" msgid="6493228261176552356">"애플리케이션이 오디오 레코드 경로에 액세스할 수 있도록 합니다."</string> <string name="permlab_camera" msgid="8059288807274039014">"사진 촬영"</string> - <string name="permdesc_camera" msgid="9013476258810982546">"응용프로그램이 카메라로 사진을 찍을 수 있도록 합니다. 이 경우 응용프로그램이 카메라에 보여지는 화면을 언제든지 수집할 수 있습니다."</string> + <string name="permdesc_camera" msgid="9013476258810982546">"애플리케이션이 카메라로 사진을 찍을 수 있도록 합니다. 이 경우 애플리케이션이 카메라에 보여지는 화면을 언제든지 수집할 수 있습니다."</string> <string name="permlab_brick" msgid="8337817093326370537">"휴대전화를 영구적으로 사용 중지"</string> - <string name="permdesc_brick" msgid="5569526552607599221">"응용프로그램이 휴대전화를 영구적으로 사용 중지할 수 있게 합니다. 이 기능은 매우 위험합니다."</string> + <string name="permdesc_brick" msgid="5569526552607599221">"애플리케이션이 휴대전화를 영구적으로 사용 중지할 수 있게 합니다. 이 기능은 매우 위험합니다."</string> <string name="permlab_reboot" msgid="2898560872462638242">"휴대전화 강제로 다시 부팅"</string> - <string name="permdesc_reboot" msgid="7914933292815491782">"응용프로그램이 휴대전화를 강제로 다시 부팅할 수 있도록 합니다."</string> + <string name="permdesc_reboot" msgid="7914933292815491782">"애플리케이션이 휴대전화를 강제로 다시 부팅할 수 있도록 합니다."</string> <string name="permlab_mount_unmount_filesystems" msgid="1761023272170956541">"파일시스템 마운트 및 마운트 해제"</string> - <string name="permdesc_mount_unmount_filesystems" msgid="6253263792535859767">"응용프로그램이 이동식 저장소의 파일 시스템을 마운트하고 마운트 해제할 수 있도록 합니다."</string> + <string name="permdesc_mount_unmount_filesystems" msgid="6253263792535859767">"애플리케이션이 이동식 저장소의 파일 시스템을 마운트하고 마운트 해제할 수 있도록 합니다."</string> <string name="permlab_mount_format_filesystems" msgid="5523285143576718981">"외부 저장소 포맷"</string> - <string name="permdesc_mount_format_filesystems" msgid="574060044906047386">"응용프로그램이 이동식 저장소를 포맷할 수 있도록 합니다."</string> + <string name="permdesc_mount_format_filesystems" msgid="574060044906047386">"애플리케이션이 이동식 저장소를 포맷할 수 있도록 합니다."</string> <string name="permlab_asec_access" msgid="1070364079249834666">"보안 저장소에 대한 정보 가져오기"</string> - <string name="permdesc_asec_access" msgid="7691616292170590244">"응용프로그램이 보안 저장소의 정보를 가져올 수 있도록 합니다."</string> + <string name="permdesc_asec_access" msgid="7691616292170590244">"애플리케이션이 보안 저장소의 정보를 가져올 수 있도록 합니다."</string> <string name="permlab_asec_create" msgid="7312078032326928899">"보안 저장소 만들기"</string> - <string name="permdesc_asec_create" msgid="7041802322759014035">"응용프로그램이 보안 저장소를 만들 수 있도록 합니다."</string> + <string name="permdesc_asec_create" msgid="7041802322759014035">"애플리케이션이 보안 저장소를 만들 수 있도록 합니다."</string> <string name="permlab_asec_destroy" msgid="7787322878955261006">"보안 저장소 제거"</string> - <string name="permdesc_asec_destroy" msgid="5740754114967893169">"응용프로그램이 보안 저장소를 제거할 수 있도록 합니다."</string> + <string name="permdesc_asec_destroy" msgid="5740754114967893169">"애플리케이션이 보안 저장소를 제거할 수 있도록 합니다."</string> <string name="permlab_asec_mount_unmount" msgid="7517449694667828592">"보안 저장소 마운트/마운트 해제"</string> - <string name="permdesc_asec_mount_unmount" msgid="5438078121718738625">"응용프로그램이 보안 저장소를 마운트/마운트 해제할 수 있도록 합니다."</string> + <string name="permdesc_asec_mount_unmount" msgid="5438078121718738625">"애플리케이션이 보안 저장소를 마운트/마운트 해제할 수 있도록 합니다."</string> <string name="permlab_asec_rename" msgid="5685344390439934495">"보안 저장소 이름 바꾸기"</string> - <string name="permdesc_asec_rename" msgid="1387881770708872470">"응용프로그램이 보안 저장소의 이름을 바꿀 수 있도록 합니다."</string> + <string name="permdesc_asec_rename" msgid="1387881770708872470">"애플리케이션이 보안 저장소의 이름을 바꿀 수 있도록 합니다."</string> <string name="permlab_vibrate" msgid="7768356019980849603">"진동 제어"</string> - <string name="permdesc_vibrate" msgid="2886677177257789187">"응용프로그램이 진동을 제어할 수 있도록 합니다."</string> + <string name="permdesc_vibrate" msgid="2886677177257789187">"애플리케이션이 진동을 제어할 수 있도록 합니다."</string> <string name="permlab_flashlight" msgid="2155920810121984215">"카메라 플래시 제어"</string> - <string name="permdesc_flashlight" msgid="6433045942283802309">"응용프로그램이 카메라 플래시를 제어할 수 있도록 합니다."</string> + <string name="permdesc_flashlight" msgid="6433045942283802309">"애플리케이션이 카메라 플래시를 제어할 수 있도록 합니다."</string> <string name="permlab_hardware_test" msgid="4148290860400659146">"하드웨어 테스트"</string> - <string name="permdesc_hardware_test" msgid="3668894686500081699">"응용프로그램이 하드웨어를 테스트할 목적으로 다양한 주변장치를 제어할 수 있도록 합니다."</string> + <string name="permdesc_hardware_test" msgid="3668894686500081699">"애플리케이션이 하드웨어를 테스트할 목적으로 다양한 주변장치를 제어할 수 있도록 합니다."</string> <string name="permlab_callPhone" msgid="3925836347681847954">"전화번호 자동 연결"</string> - <string name="permdesc_callPhone" msgid="3369867353692722456">"응용프로그램이 사용자의 조작 없이 전화번호로 전화를 걸 수 있도록 합니다. 이 경우 악성 응용프로그램으로 인해 예상치 못한 통화 요금이 부과될 수 있습니다. 이 권한으로 응용프로그램이 비상 전화를 걸게 할 수는 없습니다."</string> + <string name="permdesc_callPhone" msgid="3369867353692722456">"애플리케이션이 사용자의 조작 없이 전화번호로 전화를 걸 수 있도록 합니다. 이 경우 악성 애플리케이션으로 인해 예상치 못한 통화 요금이 부과될 수 있습니다. 이 권한으로 애플리케이션이 비상 전화를 걸게 할 수는 없습니다."</string> <string name="permlab_callPrivileged" msgid="4198349211108497879">"모든 전화번호 자동 연결"</string> - <string name="permdesc_callPrivileged" msgid="244405067160028452">"응용프로그램이 사용자의 조작 없이 비상 번호를 포함한 전화번호로 전화를 걸 수 있도록 합니다. 이 경우 악성 응용프로그램이 응급 서비스를 불필요하게 또는 불법적으로 호출할 수 있습니다."</string> + <string name="permdesc_callPrivileged" msgid="244405067160028452">"애플리케이션이 사용자의 조작 없이 비상 번호를 포함한 전화번호로 전화를 걸 수 있도록 합니다. 이 경우 악성 애플리케이션이 응급 서비스를 불필요하게 또는 불법적으로 호출할 수 있습니다."</string> <string name="permlab_performCdmaProvisioning" msgid="5604848095315421425">"직접 CDMA 전화 설정 시작"</string> - <string name="permdesc_performCdmaProvisioning" msgid="6457447676108355905">"응용프로그램이 CDMA 프로비저닝을 시작할 수 있도록 합니다. 이 경우 악성 응용프로그램이 불필요하게 CDMA 프로비저닝을 시작할 수 있습니다."</string> + <string name="permdesc_performCdmaProvisioning" msgid="6457447676108355905">"애플리케이션이 CDMA 프로비저닝을 시작할 수 있도록 합니다. 이 경우 악성 애플리케이션이 불필요하게 CDMA 프로비저닝을 시작할 수 있습니다."</string> <string name="permlab_locationUpdates" msgid="7785408253364335740">"위치 업데이트 알림 제어"</string> - <string name="permdesc_locationUpdates" msgid="2300018303720930256">"무선의 위치 업데이트 알림을 사용하거나 사용 중지할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_locationUpdates" msgid="2300018303720930256">"무선의 위치 업데이트 알림을 사용하거나 사용 중지할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_checkinProperties" msgid="7855259461268734914">"체크인 속성 액세스"</string> - <string name="permdesc_checkinProperties" msgid="7150307006141883832">"체크인 서비스에서 업로드한 속성에 대한 읽기/쓰기 접근을 허용합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_checkinProperties" msgid="7150307006141883832">"체크인 서비스에서 업로드한 속성에 대한 읽기/쓰기 접근을 허용합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_bindGadget" msgid="776905339015863471">"위젯 선택"</string> - <string name="permdesc_bindGadget" msgid="2098697834497452046">"응용프로그램이 어떤 응용프로그램에서 어떤 위젯을 사용할 수 있는 지를 시스템에 알릴 수 있도록 합니다. 이 권한을 갖는 응용프로그램은 개인 정보에 대한 액세스 권한을 다른 응용프로그램에 부여할 수 있습니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_bindGadget" msgid="2098697834497452046">"애플리케이션이 어떤 애플리케이션에서 어떤 위젯을 사용할 수 있는 지를 시스템에 알릴 수 있도록 합니다. 이 권한을 갖는 애플리케이션은 개인 정보에 대한 액세스 권한을 다른 애플리케이션에 부여할 수 있습니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"휴대전화 상태 수정"</string> - <string name="permdesc_modifyPhoneState" msgid="3302284561346956587">"응용프로그램이 장치의 휴대전화 기능을 제어할 수 있도록 합니다. 이 권한을 갖는 응용프로그램은 사용자에게 알리지 않고 네트워크를 전환하거나 휴대전화 무선 기능을 켜고 끄는 등의 작업을 수행할 수 있습니다."</string> + <string name="permdesc_modifyPhoneState" msgid="3302284561346956587">"애플리케이션이 장치의 휴대전화 기능을 제어할 수 있도록 합니다. 이 권한을 갖는 애플리케이션은 사용자에게 알리지 않고 네트워크를 전환하거나 휴대전화 무선 기능을 켜고 끄는 등의 작업을 수행할 수 있습니다."</string> <string name="permlab_readPhoneState" msgid="2326172951448691631">"휴대전화 상태 및 ID 읽기"</string> - <string name="permdesc_readPhoneState" msgid="188877305147626781">"응용프로그램이 장치의 휴대전화 기능에 접근할 수 있도록 합니다. 이 권한을 갖는 응용프로그램은 휴대전화의 전화번호 및 일련번호, 통화가 활성인지 여부, 해당 통화가 연결된 번호 등을 확인할 수 있습니다."</string> + <string name="permdesc_readPhoneState" msgid="188877305147626781">"애플리케이션이 장치의 휴대전화 기능에 접근할 수 있도록 합니다. 이 권한을 갖는 애플리케이션은 휴대전화의 전화번호 및 일련번호, 통화가 활성인지 여부, 해당 통화가 연결된 번호 등을 확인할 수 있습니다."</string> <string name="permlab_wakeLock" msgid="573480187941496130">"휴대전화가 절전 모드로 전환되지 않도록 설정"</string> - <string name="permdesc_wakeLock" msgid="7584036471227467099">"응용프로그램이 휴대전화가 절전 모드로 전환되지 않도록 합니다."</string> + <string name="permdesc_wakeLock" msgid="7584036471227467099">"애플리케이션이 휴대전화가 절전 모드로 전환되지 않도록 합니다."</string> <string name="permlab_devicePower" msgid="4928622470980943206">"휴대전화 전원 켜고 끄기"</string> - <string name="permdesc_devicePower" msgid="4577331933252444818">"응용프로그램이 휴대전화를 켜거나 끌 수 있도록 합니다."</string> + <string name="permdesc_devicePower" msgid="4577331933252444818">"애플리케이션이 휴대전화를 켜거나 끌 수 있도록 합니다."</string> <string name="permlab_factoryTest" msgid="3715225492696416187">"출고 테스트 모드로 실행"</string> <string name="permdesc_factoryTest" msgid="8136644990319244802">"휴대전화 하드웨어에 대한 완전한 액세스를 허용하는 하위 수준의 제조업체 테스트로 실행됩니다. 휴대전화가 제조업체 테스트 모드로 실행 중일 때만 사용할 수 있습니다."</string> <string name="permlab_setWallpaper" msgid="6627192333373465143">"배경화면 설정"</string> - <string name="permdesc_setWallpaper" msgid="6417041752170585837">"응용프로그램이 시스템 배경화면을 설정할 수 있도록 합니다."</string> + <string name="permdesc_setWallpaper" msgid="6417041752170585837">"애플리케이션이 시스템 배경화면을 설정할 수 있도록 합니다."</string> <string name="permlab_setWallpaperHints" msgid="3600721069353106851">"배경화면 크기 힌트 설정"</string> - <string name="permdesc_setWallpaperHints" msgid="6019479164008079626">"응용프로그램이 시스템 배경화면 크기 힌트를 설정할 수 있도록 합니다."</string> + <string name="permdesc_setWallpaperHints" msgid="6019479164008079626">"애플리케이션이 시스템 배경화면 크기 힌트를 설정할 수 있도록 합니다."</string> <string name="permlab_masterClear" msgid="2315750423139697397">"시스템을 기본값으로 재설정"</string> - <string name="permdesc_masterClear" msgid="5033465107545174514">"응용프로그램이 모든 데이터, 구성 및 설치된 응용프로그램을 지워서 시스템을 완전히 초기화할 수 있도록 합니다."</string> + <string name="permdesc_masterClear" msgid="5033465107545174514">"애플리케이션이 모든 데이터, 구성 및 설치된 애플리케이션을 지워서 시스템을 완전히 초기화할 수 있도록 합니다."</string> <string name="permlab_setTime" msgid="2021614829591775646">"시간 설정"</string> - <string name="permdesc_setTime" msgid="667294309287080045">"응용프로그램이 휴대전화 시계의 시간을 변경할 수 있도록 합니다."</string> + <string name="permdesc_setTime" msgid="667294309287080045">"애플리케이션이 휴대전화 시계의 시간을 변경할 수 있도록 합니다."</string> <string name="permlab_setTimeZone" msgid="2945079801013077340">"표준시간대 설정"</string> - <string name="permdesc_setTimeZone" msgid="1902540227418179364">"응용프로그램이 휴대전화의 표준시간대를 변경할 수 있도록 합니다."</string> + <string name="permdesc_setTimeZone" msgid="1902540227418179364">"애플리케이션이 휴대전화의 표준시간대를 변경할 수 있도록 합니다."</string> <string name="permlab_accountManagerService" msgid="4829262349691386986">"AccountManagerService로 활동"</string> - <string name="permdesc_accountManagerService" msgid="6056903274106394752">"응용프로그램이 AccountAuthenticators으로 전화를 걸 수 있도록 합니다."</string> + <string name="permdesc_accountManagerService" msgid="6056903274106394752">"애플리케이션이 AccountAuthenticators으로 전화를 걸 수 있도록 합니다."</string> <string name="permlab_getAccounts" msgid="4549918644233460103">"알려진 계정 검색"</string> - <string name="permdesc_getAccounts" msgid="6839262446413155394">"응용프로그램이 휴대전화에 알려진 계정 목록을 가져올 수 있도록 합니다."</string> + <string name="permdesc_getAccounts" msgid="6839262446413155394">"애플리케이션이 휴대전화에 알려진 계정 목록을 가져올 수 있도록 합니다."</string> <string name="permlab_authenticateAccounts" msgid="3940505577982882450">"계정 인증자로 활동"</string> - <string name="permdesc_authenticateAccounts" msgid="4006839406474208874">"응용프로그램이 계정 만들기, 비밀번호 가져오기 및 설정 등과 같은 AccountManager의 계정 인증자 기능을 사용할 수 있도록 합니다."</string> + <string name="permdesc_authenticateAccounts" msgid="4006839406474208874">"애플리케이션이 계정 만들기, 비밀번호 가져오기 및 설정 등과 같은 AccountManager의 계정 인증자 기능을 사용할 수 있도록 합니다."</string> <string name="permlab_manageAccounts" msgid="4440380488312204365">"계정 목록 관리"</string> - <string name="permdesc_manageAccounts" msgid="8804114016661104517">"응용프로그램이 계정 추가, 삭제 및 비밀번호 삭제 등의 작업을 수행할 수 있도록 합니다."</string> + <string name="permdesc_manageAccounts" msgid="8804114016661104517">"애플리케이션이 계정 추가, 삭제 및 비밀번호 삭제 등의 작업을 수행할 수 있도록 합니다."</string> <string name="permlab_useCredentials" msgid="6401886092818819856">"계정의 인증 자격증명 사용"</string> - <string name="permdesc_useCredentials" msgid="7416570544619546974">"응용프로그램이 인증 토큰을 요청하도록 합니다."</string> + <string name="permdesc_useCredentials" msgid="7416570544619546974">"애플리케이션이 인증 토큰을 요청하도록 합니다."</string> <string name="permlab_accessNetworkState" msgid="6865575199464405769">"네트워크 상태 보기"</string> - <string name="permdesc_accessNetworkState" msgid="558721128707712766">"응용프로그램이 모든 네트워크의 상태를 볼 수 있도록 합니다."</string> + <string name="permdesc_accessNetworkState" msgid="558721128707712766">"애플리케이션이 모든 네트워크의 상태를 볼 수 있도록 합니다."</string> <string name="permlab_createNetworkSockets" msgid="9121633680349549585">"인터넷에 최대한 액세스"</string> - <string name="permdesc_createNetworkSockets" msgid="4593339106921772192">"응용프로그램이 네트워크 소켓을 만들 수 있도록 합니다."</string> + <string name="permdesc_createNetworkSockets" msgid="4593339106921772192">"애플리케이션이 네트워크 소켓을 만들 수 있도록 합니다."</string> <string name="permlab_writeApnSettings" msgid="7823599210086622545">"액세스포인트 이름(APN) 설정 쓰기"</string> - <string name="permdesc_writeApnSettings" msgid="7443433457842966680">"응용프로그램이 APN의 프록시 및 포트 같은 APN 설정을 수정할 수 있도록 합니다."</string> + <string name="permdesc_writeApnSettings" msgid="7443433457842966680">"애플리케이션이 APN의 프록시 및 포트 같은 APN 설정을 수정할 수 있도록 합니다."</string> <string name="permlab_changeNetworkState" msgid="958884291454327309">"네트워크 연결 변경"</string> - <string name="permdesc_changeNetworkState" msgid="4199958910396387075">"응용프로그램이 네트워크 연결 상태를 변경할 수 있도록 합니다."</string> + <string name="permdesc_changeNetworkState" msgid="4199958910396387075">"애플리케이션이 네트워크 연결 상태를 변경할 수 있도록 합니다."</string> <string name="permlab_changeTetherState" msgid="2702121155761140799">"테러링 연결 변경"</string> - <string name="permdesc_changeTetherState" msgid="8905815579146349568">"응용프로그램이 테더링된 네트워크의 연결 상태를 변경할 수 있도록 합니다."</string> + <string name="permdesc_changeTetherState" msgid="8905815579146349568">"애플리케이션이 테더링된 네트워크의 연결 상태를 변경할 수 있도록 합니다."</string> <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"백그라운드 데이터 사용 설정 변경"</string> - <string name="permdesc_changeBackgroundDataSetting" msgid="1001482853266638864">"응용프로그램이 백그라운드 데이터 사용 설정을 변경할 수 있도록 합니다."</string> + <string name="permdesc_changeBackgroundDataSetting" msgid="1001482853266638864">"애플리케이션이 백그라운드 데이터 사용 설정을 변경할 수 있도록 합니다."</string> <string name="permlab_accessWifiState" msgid="8100926650211034400">"Wi-Fi 상태 보기"</string> - <string name="permdesc_accessWifiState" msgid="485796529139236346">"응용프로그램이 Wi-Fi의 상태에 대한 정보를 볼 수 있도록 합니다."</string> + <string name="permdesc_accessWifiState" msgid="485796529139236346">"애플리케이션이 Wi-Fi의 상태에 대한 정보를 볼 수 있도록 합니다."</string> <string name="permlab_changeWifiState" msgid="7280632711057112137">"Wi-Fi 상태 변경"</string> - <string name="permdesc_changeWifiState" msgid="2950383153656873267">"응용프로그램이 Wi-Fi 액세스포인트에 연결하거나 연결을 끊고, 구성된 Wi-Fi 네트워크를 변경할 수 있도록 합니다."</string> + <string name="permdesc_changeWifiState" msgid="2950383153656873267">"애플리케이션이 Wi-Fi 액세스포인트에 연결하거나 연결을 끊고, 구성된 Wi-Fi 네트워크를 변경할 수 있도록 합니다."</string> <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"Wi-Fi 멀티캐스트 수신 허용"</string> - <string name="permdesc_changeWifiMulticastState" msgid="8199464507656067553">"응용프로그램이 휴대기기로 직접 주소가 지정되지 않은 패킷을 받을 수 있도록 합니다. 이 기능은 가까운 곳에서 제공되는 서비스를 검색할 때 유용하며 비멀티캐스트 모드보다 전원을 더 많이 소비합니다."</string> + <string name="permdesc_changeWifiMulticastState" msgid="8199464507656067553">"애플리케이션이 휴대기기로 직접 주소가 지정되지 않은 패킷을 받을 수 있도록 합니다. 이 기능은 가까운 곳에서 제공되는 서비스를 검색할 때 유용하며 비멀티캐스트 모드보다 전원을 더 많이 소비합니다."</string> <string name="permlab_bluetoothAdmin" msgid="1092209628459341292">"Bluetooth 관리"</string> - <string name="permdesc_bluetoothAdmin" msgid="7256289774667054555">"응용프로그램이 로컬 Bluetooth 휴대전화를 구성한 다음 원격 장치를 검색하여 페어링할 수 있도록 합니다."</string> + <string name="permdesc_bluetoothAdmin" msgid="7256289774667054555">"애플리케이션이 로컬 Bluetooth 휴대전화를 구성한 다음 원격 장치를 검색하여 페어링할 수 있도록 합니다."</string> <string name="permlab_bluetooth" msgid="8361038707857018732">"Bluetooth 연결 만들기"</string> - <string name="permdesc_bluetooth" msgid="762515380679392945">"응용프로그램이 로컬 Bluetooth 전화의 구성을 보고 페어링된 장치에 연결하며 연결을 수락할 수 있도록 합니다."</string> + <string name="permdesc_bluetooth" msgid="762515380679392945">"애플리케이션이 로컬 Bluetooth 전화의 구성을 보고 페어링된 장치에 연결하며 연결을 수락할 수 있도록 합니다."</string> <string name="permlab_disableKeyguard" msgid="4977406164311535092">"키 잠금 사용 중지"</string> - <string name="permdesc_disableKeyguard" msgid="3189763479326302017">"응용프로그램이 키 잠금 및 관련 비밀번호 보안을 사용 중지할 수 있도록 합니다. 예를 들어, 휴대전화가 수신전화를 받을 때 키 잠금을 사용 중지했다가 통화가 끝나면 키 잠금을 다시 사용할 수 있습니다."</string> + <string name="permdesc_disableKeyguard" msgid="3189763479326302017">"애플리케이션이 키 잠금 및 관련 비밀번호 보안을 사용 중지할 수 있도록 합니다. 예를 들어, 휴대전화가 수신전화를 받을 때 키 잠금을 사용 중지했다가 통화가 끝나면 키 잠금을 다시 사용할 수 있습니다."</string> <string name="permlab_readSyncSettings" msgid="6201810008230503052">"동기화 설정 읽기"</string> - <string name="permdesc_readSyncSettings" msgid="5315925706353341823">"응용프로그램이 주소록에 동기화를 사용할지 여부와 같은 동기화 설정을 읽을 수 있도록 합니다."</string> + <string name="permdesc_readSyncSettings" msgid="5315925706353341823">"애플리케이션이 주소록에 동기화를 사용할지 여부와 같은 동기화 설정을 읽을 수 있도록 합니다."</string> <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"동기화 설정 쓰기"</string> - <string name="permdesc_writeSyncSettings" msgid="2498201614431360044">"응용프로그램이 주소록에 대해 동기화를 사용할지 여부 등의 동기화 설정을 수정할 수 있도록 합니다."</string> + <string name="permdesc_writeSyncSettings" msgid="2498201614431360044">"애플리케이션이 주소록에 대해 동기화를 사용할지 여부 등의 동기화 설정을 수정할 수 있도록 합니다."</string> <string name="permlab_readSyncStats" msgid="7396577451360202448">"동기화 통계 읽기"</string> - <string name="permdesc_readSyncStats" msgid="7511448343374465000">"응용프로그램이 동기화 통계(예: 실행된 동기화 기록)을 읽을 수 있도록 합니다."</string> + <string name="permdesc_readSyncStats" msgid="7511448343374465000">"애플리케이션이 동기화 통계(예: 실행된 동기화 기록)을 읽을 수 있도록 합니다."</string> <string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"가입된 피드 읽기"</string> - <string name="permdesc_subscribedFeedsRead" msgid="3622200625634207660">"응용프로그램이 현재 동기화된 피드에 대한 세부정보를 가져올 수 있도록 합니다."</string> + <string name="permdesc_subscribedFeedsRead" msgid="3622200625634207660">"애플리케이션이 현재 동기화된 피드에 대한 세부정보를 가져올 수 있도록 합니다."</string> <string name="permlab_subscribedFeedsWrite" msgid="9015246325408209296">"가입 피드 작성"</string> - <string name="permdesc_subscribedFeedsWrite" msgid="8121607099326533878">"응용프로그램이 현재 동기화된 피드를 수정할 수 있도록 합니다. 이 경우 악성 응용프로그램이 동기화된 피드를 변경할 수 있습니다."</string> + <string name="permdesc_subscribedFeedsWrite" msgid="8121607099326533878">"애플리케이션이 현재 동기화된 피드를 수정할 수 있도록 합니다. 이 경우 악성 애플리케이션이 동기화된 피드를 변경할 수 있습니다."</string> <string name="permlab_readDictionary" msgid="432535716804748781">"사용자 정의 사전 읽기"</string> - <string name="permdesc_readDictionary" msgid="1082972603576360690">"응용프로그램이 사용자 사전에 보관되어 있는 비공개 단어, 이름 및 구문을 읽도록 합니다."</string> + <string name="permdesc_readDictionary" msgid="1082972603576360690">"애플리케이션이 사용자 사전에 보관되어 있는 비공개 단어, 이름 및 구문을 읽도록 합니다."</string> <string name="permlab_writeDictionary" msgid="6703109511836343341">"사용자정의 사전에 작성"</string> - <string name="permdesc_writeDictionary" msgid="2241256206524082880">"응용프로그램이 사용자 사전에 새 단어를 입력할 수 있도록 합니다."</string> + <string name="permdesc_writeDictionary" msgid="2241256206524082880">"애플리케이션이 사용자 사전에 새 단어를 입력할 수 있도록 합니다."</string> <string name="permlab_sdcardWrite" msgid="8079403759001777291">"SD 카드 콘텐츠 수정/삭제"</string> - <string name="permdesc_sdcardWrite" msgid="6643963204976471878">"응용프로그램이 SD 카드에 쓸 수 있도록 합니다."</string> + <string name="permdesc_sdcardWrite" msgid="6643963204976471878">"애플리케이션이 SD 카드에 쓸 수 있도록 합니다."</string> <string name="permlab_cache_filesystem" msgid="5656487264819669824">"캐시 파일시스템 액세스"</string> - <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"응용프로그램이 캐시 파일시스템을 읽고 쓸 수 있도록 합니다."</string> + <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"애플리케이션이 캐시 파일시스템을 읽고 쓸 수 있도록 합니다."</string> <string name="policylab_limitPassword" msgid="4307861496302850201">"비밀번호 제한"</string> <string name="policydesc_limitPassword" msgid="1719877245692318299">"사용할 수 있는 비밀번호 유형을 제한합니다."</string> <string name="policylab_watchLogin" msgid="7374780712664285321">"로그인 시도 보기"</string> @@ -571,8 +571,8 @@ <string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string> <string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string> <string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string> - <string name="hour_ampm" msgid="4329881288269772723">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%P</xliff:g>"</string> - <string name="hour_cap_ampm" msgid="1829009197680861107">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string> + <string name="hour_ampm" msgid="4329881288269772723">"<xliff:g id="AMPM">%P</xliff:g> <xliff:g id="HOUR">%-l</xliff:g>:00"</string> + <string name="hour_cap_ampm" msgid="1829009197680861107">"<xliff:g id="AMPM">%p</xliff:g> <xliff:g id="HOUR">%-l</xliff:g>:00"</string> <string name="status_bar_clear_all_button" msgid="7774721344716731603">"지우기"</string> <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"알림 없음"</string> <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"진행 중"</string> @@ -593,11 +593,11 @@ <string name="save_password_label" msgid="6860261758665825069">"확인"</string> <string name="double_tap_toast" msgid="1068216937244567247">"도움말: 축소/확대하려면 두 번 누릅니다."</string> <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"브라우저의 기록 및 북마크 읽기"</string> - <string name="permdesc_readHistoryBookmarks" msgid="4981489815467617191">"응용프로그램이 브라우저로 방문한 모든 URL과 브라우저의 모든 북마크를 읽도록 허용합니다."</string> + <string name="permdesc_readHistoryBookmarks" msgid="4981489815467617191">"애플리케이션이 브라우저로 방문한 모든 URL과 브라우저의 모든 북마크를 읽도록 허용합니다."</string> <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"브라우저의 기록 및 북마크 쓰기"</string> - <string name="permdesc_writeHistoryBookmarks" msgid="945571990357114950">"응용프로그램이 휴대전화에 저장된 브라우저 기록 또는 북마크를 수정할 수 있도록 허용합니다. 이 경우 악성 응용프로그램이 브라우저의 데이터를 지우거나 수정할 수 있습니다."</string> + <string name="permdesc_writeHistoryBookmarks" msgid="945571990357114950">"애플리케이션이 휴대전화에 저장된 브라우저 기록 또는 북마크를 수정할 수 있도록 허용합니다. 이 경우 악성 애플리케이션이 브라우저의 데이터를 지우거나 수정할 수 있습니다."</string> <string name="permlab_writeGeolocationPermissions" msgid="4715212655598275532">"브라우저 위치 정보 수정 권한"</string> - <string name="permdesc_writeGeolocationPermissions" msgid="4011908282980861679">"응용프로그램이 브라우저의 위치 정보 권한을 수정할 수 있도록 합니다. 악성 응용프로그램이 이를 사용하여 임의의 웹사이트에 위치 정보를 보낼 수도 있습니다."</string> + <string name="permdesc_writeGeolocationPermissions" msgid="4011908282980861679">"애플리케이션이 브라우저의 위치 정보 권한을 수정할 수 있도록 합니다. 악성 애플리케이션이 이를 사용하여 임의의 웹사이트에 위치 정보를 보낼 수도 있습니다."</string> <string name="save_password_message" msgid="767344687139195790">"브라우저에 이 비밀번호를 저장하시겠습니까?"</string> <string name="save_password_notnow" msgid="6389675316706699758">"나중에"</string> <string name="save_password_remember" msgid="6491879678996749466">"저장"</string> @@ -728,18 +728,18 @@ <string name="dialog_alert_title" msgid="2049658708609043103">"주의"</string> <string name="capital_on" msgid="1544682755514494298">"사용"</string> <string name="capital_off" msgid="6815870386972805832">"사용 안함"</string> - <string name="whichApplication" msgid="4533185947064773386">"작업을 수행할 때 사용하는 응용프로그램"</string> + <string name="whichApplication" msgid="4533185947064773386">"작업을 수행할 때 사용하는 애플리케이션"</string> <string name="alwaysUse" msgid="4583018368000610438">"이 작업에 대해 기본값으로 사용"</string> - <string name="clearDefaultHintMsg" msgid="4815455344600932173">"홈 설정 > 응용프로그램 > 응용프로그램 관리에서 기본값을 지웁니다."</string> + <string name="clearDefaultHintMsg" msgid="4815455344600932173">"홈 설정 > 애플리케이션 > 애플리케이션 관리에서 기본값을 지웁니다."</string> <string name="chooseActivity" msgid="1009246475582238425">"작업 선택"</string> - <string name="noApplications" msgid="1691104391758345586">"작업을 수행할 수 있는 응용프로그램이 없습니다."</string> + <string name="noApplications" msgid="1691104391758345586">"작업을 수행할 수 있는 애플리케이션이 없습니다."</string> <string name="aerr_title" msgid="653922989522758100">"죄송합니다."</string> - <string name="aerr_application" msgid="4683614104336409186">"<xliff:g id="APPLICATION">%1$s</xliff:g> 응용프로그램(<xliff:g id="PROCESS">%2$s</xliff:g> 프로세스)이 예상치 않게 중지되었습니다. 다시 시도해 주세요."</string> + <string name="aerr_application" msgid="4683614104336409186">"<xliff:g id="APPLICATION">%1$s</xliff:g> 애플리케이션(<xliff:g id="PROCESS">%2$s</xliff:g> 프로세스)이 예상치 않게 중지되었습니다. 다시 시도해 주세요."</string> <string name="aerr_process" msgid="1551785535966089511">"<xliff:g id="PROCESS">%1$s</xliff:g> 프로세스가 예상치 않게 중지되었습니다. 다시 시도해 주세요."</string> <string name="anr_title" msgid="3100070910664756057">"죄송합니다."</string> - <string name="anr_activity_application" msgid="3538242413112507636">"<xliff:g id="APPLICATION">%2$s</xliff:g> 활동(<xliff:g id="ACTIVITY">%1$s</xliff:g> 응용프로그램)이 응답하지 않습니다."</string> + <string name="anr_activity_application" msgid="3538242413112507636">"<xliff:g id="APPLICATION">%2$s</xliff:g> 활동(<xliff:g id="ACTIVITY">%1$s</xliff:g> 애플리케이션)이 응답하지 않습니다."</string> <string name="anr_activity_process" msgid="5420826626009561014">"<xliff:g id="ACTIVITY">%1$s</xliff:g> 활동(<xliff:g id="PROCESS">%2$s</xliff:g> 프로세스)이 응답하지 않습니다."</string> - <string name="anr_application_process" msgid="4185842666452210193">"<xliff:g id="APPLICATION">%1$s</xliff:g> 응용프로그램(<xliff:g id="PROCESS">%2$s</xliff:g> 프로세스)이 응답하지 않습니다."</string> + <string name="anr_application_process" msgid="4185842666452210193">"<xliff:g id="APPLICATION">%1$s</xliff:g> 애플리케이션(<xliff:g id="PROCESS">%2$s</xliff:g> 프로세스)이 응답하지 않습니다."</string> <string name="anr_process" msgid="1246866008169975783">"<xliff:g id="PROCESS">%1$s</xliff:g> 프로세스가 응답하지 않습니다."</string> <string name="force_close" msgid="3653416315450806396">"닫기"</string> <string name="report" msgid="4060218260984795706">"신고"</string> @@ -768,7 +768,7 @@ <item quantity="other" msgid="7915895323644292768">"개방형 Wi-Fi 네트워크 사용 가능"</item> </plurals> <string name="select_character" msgid="3365550120617701745">"문자 삽입"</string> - <string name="sms_control_default_app_name" msgid="7630529934366549163">"알 수 없는 응용프로그램"</string> + <string name="sms_control_default_app_name" msgid="7630529934366549163">"알 수 없는 애플리케이션"</string> <string name="sms_control_title" msgid="7296612781128917719">"SMS 메시지를 보내는 중"</string> <string name="sms_control_message" msgid="1289331457999236205">"여러 개의 SMS 메시지를 보내는 중입니다. 계속하려면 \'확인\'을 선택하고 전송을 중지하려면 \'취소\'를 선택하세요."</string> <string name="sms_control_yes" msgid="2532062172402615953">"확인"</string> @@ -792,7 +792,7 @@ <string name="usb_storage_stop_button_mount" msgid="7060218034900696029">"USB 저장소 사용 안함"</string> <string name="usb_storage_stop_error_message" msgid="143881914840412108">"USB 저장소를 사용하지 않도록 설정하는 동안 문제가 발생했습니다. USB 호스트와 연결을 해제했는지 확인한 다음 다시 시도하세요."</string> <string name="dlg_confirm_kill_storage_users_title" msgid="963039033470478697">"USB 저장소 사용"</string> - <string name="dlg_confirm_kill_storage_users_text" msgid="3202838234780505886">"USB 저장소를 사용 설정하면 사용 중인 일부 응용프로그램이 중지되고 USB 저장소를 사용 중지할 때까지 사용할 수 없게 됩니다."</string> + <string name="dlg_confirm_kill_storage_users_text" msgid="3202838234780505886">"USB 저장소를 사용 설정하면 사용 중인 일부 애플리케이션이 중지되고 USB 저장소를 사용 중지할 때까지 사용할 수 없게 됩니다."</string> <string name="dlg_error_title" msgid="8048999973837339174">"USB 작업 실패"</string> <string name="dlg_ok" msgid="7376953167039865701">"확인"</string> <string name="extmedia_format_title" msgid="8663247929551095854">"SD 카드 포맷"</string> @@ -818,9 +818,9 @@ <string name="ext_media_nomedia_notification_message" msgid="3870120652983659641">"SD 카드가 없습니다. SD 카드를 넣으세요."</string> <string name="activity_list_empty" msgid="4168820609403385789">"일치하는 활동이 없습니다."</string> <string name="permlab_pkgUsageStats" msgid="8787352074326748892">"구성 요소 사용 통계 업데이트"</string> - <string name="permdesc_pkgUsageStats" msgid="891553695716752835">"수집된 구성요소 사용 통계를 수정할 수 있는 권한을 부여합니다. 일반 응용프로그램은 이 권한을 사용하지 않습니다."</string> - <string name="permlab_copyProtectedData" msgid="1660908117394854464">"기본 컨테이너 서비스를 호출하여 콘텐츠를 복사할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> - <string name="permdesc_copyProtectedData" msgid="537780957633976401">"기본 컨테이너 서비스를 호출하여 콘텐츠를 복사할 수 있도록 합니다. 일반 응용프로그램에서는 사용하지 않습니다."</string> + <string name="permdesc_pkgUsageStats" msgid="891553695716752835">"수집된 구성요소 사용 통계를 수정할 수 있는 권한을 부여합니다. 일반 애플리케이션은 이 권한을 사용하지 않습니다."</string> + <string name="permlab_copyProtectedData" msgid="1660908117394854464">"기본 컨테이너 서비스를 호출하여 콘텐츠를 복사할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> + <string name="permdesc_copyProtectedData" msgid="537780957633976401">"기본 컨테이너 서비스를 호출하여 콘텐츠를 복사할 수 있도록 합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string> <string name="tutorial_double_tap_to_zoom_message_short" msgid="1311810005957319690">"확대/축소하려면 두 번 탭하세요."</string> <string name="gadget_host_error_inflating" msgid="2613287218853846830">"위젯을 생성하는 과정(inflate)에 오류가 발생했습니다."</string> <string name="ime_action_go" msgid="8320845651737369027">"이동"</string> @@ -833,7 +833,7 @@ <string name="create_contact_using" msgid="4947405226788104538">"전화번호부에"\n"<xliff:g id="NUMBER">%s</xliff:g> 추가"</string> <string name="accessibility_compound_button_selected" msgid="5612776946036285686">"선택함"</string> <string name="accessibility_compound_button_unselected" msgid="8864512895673924091">"선택 안함"</string> - <string name="grant_credentials_permission_message_header" msgid="6824538733852821001">"현재 이후로 하나 이상의 다음 응용프로그램이 계정에 대한 액세스 권한을 요청합니다."</string> + <string name="grant_credentials_permission_message_header" msgid="6824538733852821001">"현재 이후로 하나 이상의 다음 애플리케이션이 계정에 대한 액세스 권한을 요청합니다."</string> <string name="grant_credentials_permission_message_footer" msgid="3125211343379376561">"요청을 허용하시겠습니까?"</string> <string name="grant_permissions_header_text" msgid="2722567482180797717">"액세스 요청"</string> <string name="allow" msgid="7225948811296386551">"허용"</string> diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml index 02afb16c64a8..6acf4a64fde0 100644 --- a/core/res/res/values-nb/strings.xml +++ b/core/res/res/values-nb/strings.xml @@ -780,7 +780,7 @@ <string name="perms_show_all" msgid="2671791163933091180"><b>"Vis alle"</b></string> <string name="usb_storage_activity_title" msgid="2399289999608900443">"USB-masselagring"</string> <string name="usb_storage_title" msgid="5901459041398751495">"USB koblet til"</string> - <string name="usb_storage_message" msgid="4796759646167247178">"Du har koblet telefonen til datamaskinen via USB. Velg knappen nedenfor hvis du vil kopiere filer mellom datamaskinen og SD-kortet i Android-telefonen."</string> + <string name="usb_storage_message" msgid="4796759646167247178">"Du har koblet telefonen til datamaskinen via USB. Velg knappen nedenfor hvis du vil kopiere filer mellom datamaskinen og minnekortet i telefonen."</string> <string name="usb_storage_button_mount" msgid="1052259930369508235">"Slå på USB-lagring"</string> <string name="usb_storage_error_message" msgid="2534784751603345363">"Det oppsto et problem med å bruke minnekortet ditt for USB-lagring."</string> <string name="usb_storage_notification_title" msgid="8175892554757216525">"USB tilkoblet"</string> diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index b7c5bbc0d1a8..834a84ca1bc3 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -587,7 +587,7 @@ <string name="factorytest_not_system" msgid="4435201656767276723">"只有在 /system/app 中安装的包支持 FACTORY_TEST 操作。"</string> <string name="factorytest_no_action" msgid="872991874799998561">"未发现支持 FACTORY_TEST 操作的包。"</string> <string name="factorytest_reboot" msgid="6320168203050791643">"重新启动"</string> - <string name="js_dialog_title" msgid="8143918455087008109">"“<xliff:g id="TITLE">%s</xliff:g>”处的页面表明:"</string> + <string name="js_dialog_title" msgid="8143918455087008109">"来自“<xliff:g id="TITLE">%s</xliff:g>”的提示:"</string> <string name="js_dialog_title_default" msgid="6961903213729667573">"JavaScript"</string> <string name="js_dialog_before_unload" msgid="1901675448179653089">"是否从该页面导航至它处?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"选择“确定”继续,或选择“取消”留在当前页面。"</string> <string name="save_password_label" msgid="6860261758665825069">"确认"</string> diff --git a/docs/html/guide/developing/eclipse-adt.jd b/docs/html/guide/developing/eclipse-adt.jd index cf2a45716d34..66379a3945d2 100644 --- a/docs/html/guide/developing/eclipse-adt.jd +++ b/docs/html/guide/developing/eclipse-adt.jd @@ -527,7 +527,7 @@ Marking a project as an Android library project. </p> <p>A library project's manifest file must declare all of the shared components that it includes, just as would a standard Android application. For more information, see the documentation for <a -href="{@docRoot}guide/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> +href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> <p>For example, the <a href="{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> @@ -613,7 +613,8 @@ like this: </p> ... </manifest></pre> -<p>For more information about the manifest file, see the documentation for <a href="{@docRoot}guide/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> +<p>For more information about the manifest file, see the documentation for <a +href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> <h3 id="considerations">Development considerations</h3> diff --git a/docs/html/guide/developing/other-ide.jd b/docs/html/guide/developing/other-ide.jd index e8a6fb6494f8..1d67aa90ede4 100644 --- a/docs/html/guide/developing/other-ide.jd +++ b/docs/html/guide/developing/other-ide.jd @@ -687,7 +687,7 @@ so that other applications can use it, you can do so by adding a the <p>A library project's manifest file must declare all of the shared components that it includes, just as would a standard Android application. For more information, see the documentation for <a -href="{@docRoot}guide/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> +href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> <p>For example, the <a href="{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> @@ -799,7 +799,8 @@ like this: </p> ... </manifest></pre> -<p>For more information about the manifest file, see the documentation for <a href="{@docRoot}guide/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> +<p>For more information about the manifest file, see the documentation for <a +href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p> <h3 id="depAppBuild">Building a dependent application</h3> diff --git a/docs/html/guide/developing/tools/avd.jd b/docs/html/guide/developing/tools/avd.jd index acebb7ec8baa..ca197cfb0d15 100644 --- a/docs/html/guide/developing/tools/avd.jd +++ b/docs/html/guide/developing/tools/avd.jd @@ -11,16 +11,13 @@ page.title=Android Virtual Devices hardware options, system image, and data storage. <li>You create AVD configurations to model different device environments in the Android emulator.</li> - <li>The <code>android</code> tool offers a graphical Android AVD - Manager and a command-line interface for creating AVDs.</li> - </ul> + <li>You can launch a graphical Android AVD Manager either through Eclipse or +through the <code>android</code> tool. The <code>android</code> tool also offers +a command-line interface for creating and managing AVDs.</li> </ul> <h2>In this document</h2> <ol> <li><a href="#creating">Creating an AVD</a> <ol> - <li><a href="#listingtargets">Listing targets</a></li> - <li><a href="#selectingtarget">Selecting a target</a></li> - <li><a href="#createavd">Creating the AVD</a></li> <li><a href="#hardwareopts">Setting hardware emulation options</a></li> <li><a href="#location">Default location of the AVD files</a></li> </ol> @@ -74,15 +71,12 @@ reference of emulator options, please see the <a href="{@docRoot}guide/developing/tools/emulator.html">Emulator</a> documentation. </p> -<p>To create and manage AVDs, you use the <code>android</code> tool provided in -the <code>tools/</code> directory of the Android SDK. The tool provides both a -graphical AVD manager and a command-line interface that you can use to -create AVDs. To access the graphical AVD manager, run the -<code>android</code> tool without options. The sections below describe how to -use the <code>android</code> command-line interface to create and manage AVDs. -Note that some functionality, such as the capability to create an AVD with a -custom hardware configuration, are only available through the command-line -interface. </p> +<p>The easiest way to create an AVD is to use the graphical AVD Manager, which +you can launch from Eclipse or from the command line using the +<code>android</code> tool. The <code>android</code> tool is provided in the +<code>tools/</code> directory of the Android SDK. When you run the +<code>android</code> tool without options, it launches the graphical AVD +Manager.</p> <p>For more information about how to work with AVDs from inside your development environment, see <a @@ -99,146 +93,51 @@ you need to create an AVD before you can run any application in the emulator (even the Hello World application).</p> </div> </div> - -<p>To create an AVD, you use the <code>android</code> tool, a command-line -utility available in the <code><sdk>/tools/</code> directory. Managing -AVDs is one of the two main function of the <code>android</code> tool (the other -is creating and updating Android projects). Open a terminal window and change to -the <code><sdk>/tools/</code> directory, if needed</p> - -<p>To create each AVD, you issue the command <code>android create avd</code>, -with options that specify a name for the new AVD and the system image you want -to run on the emulator when the AVD is invoked. You can specify other options on -the command line also, such as to create an emulated SD card for the new AVD, set -the emulator skin to use, or set a custom location for the AVD's files.</p> - -<p>Here's the command-line usage for creating an AVD: </p> - -<pre>android create avd -n <name> -t <targetID> [-<option> <value>] ... </pre> - -<p>You can use any name you want for the AVD, but since you are likely to be -creating multiple AVDs, you should choose a name that lets you recognize the -general characteristics offered by the AVD. </p> - -<p>As shown in the usage above, you must use the <code>-t</code> (or -<code>--target</code>) argument when creating a new AVD. The argument sets up a -mapping between the AVD and the system image that you want to use whenever the -AVD is invoked. You can specify any Android system image that is available in -your local SDK — it can be the system image of a standard Android platform -version or that of any SDK add-on. Later, when applications use the AVD, they'll -be running on the system that you specify in the <code>-t</code> argument.<p> - -<p>To specify the system image to use, you refer to its <em>target ID</em> -— an integer — as assigned by the <code>android</code> tool. The -target ID is not derived from the system image name, version, or API Level, or -other attribute, so you need to have the <code>android</code> tool list the -available system images and the target ID of each, as described in the next -section. You should do this <em>before</em> you run the <code>android create -avd</code> command. -</p> - -<h3 id="listingtargets">Listing targets</h3> - -<p>To generate a list of system image targets, use this command: </p> - -<pre>android list targets</pre> - -<p>The <code>android</code> tool scans the <code><sdk>/platforms</code> and -<code><sdk>/add-ons</code> directories looking for valid system images and -then generates the list of targets. Here's an example of the command output: -</p> - -<pre>Available Android targets: -id:1 - Name: Android 1.1 - Type: platform - API level: 2 - Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P -id:2 - Name: Android 1.5 - Type: platform - API level: 3 - Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P -id:3 - Name: Google APIs - Type: add-on - Vendor: Google Inc. - Description: Android + Google APIs - Based on Android 1.5 (API level 3) - Libraries: - * com.google.android.maps (maps.jar) - API for Google Maps - Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L</pre> - -<h3 id="selectingtarget">Selecting a target</h3> - -<p>Once you have generated the list of targets available, you can look at the -characteristics of each system image — name, API Level, external -libraries, and so on — and determine which target is appropriate for the -new AVD. </p> - -<p>Keep these points in mind when you are selecting a system image target for -your AVD:</p> -<ul> -<li>The API Level of the target is important, because your application will not -be able to run on a system image whose API Level is less than that required by -your application, as specified in the <code>minSdkVersion</code> attribute of -the application's manifest file. For more information about the relationship -between system API Level and application <code>minSdkVersion</code>, see <a -href="{@docRoot}guide/publishing/versioning.html#minsdkversion">Specifying -Minimum System API Version</a>. -<li>Creating at least one AVD that uses a target whose API Level is greater than -that required by your application is strongly encouraged, because it allows you to -test the forward-compatibility of your application. Forward-compatibility -testing ensures that, when users who have downloaded your application receive a -system update, your application will continue to function normally. </li> -<li>If your application declares a <code>uses-library</code> element in its -manifest file, the application can only run on a system image in which that -external library is present. If you want your application to run on the AVD you -are creating, check the application's <code>uses-library</code> element and -select a system image target that includes that library. - -</ul> - -<h3 id="createavd">Creating the AVD</h3> - -<p>When you've selected the target you want to use and made a note of its ID, -use the <code>android create avd</code> command to create the AVD, supplying the -target ID as the <code>-t</code> argument. Here's an example that creates an -AVD with name "my_android1.5" and target ID "2" (the standard Android 1.5 -system image in the list above): </p> - -<pre>android create avd -n my_android1.5 -t 2</pre> - -<p>If the target you selected was a standard Android system image ("Type: -platform"), the <code>android</code> tool next asks you whether you want to -create a custom hardware profile. </p> -<pre>Android 1.5 is a basic Android platform. -Do you wish to create a custom hardware profile [no]</pre> - -<p>If you want to set custom hardware emulation options for the AVD, enter -"yes" and set values as needed. If you want to use the default hardware -emulation options for the AVD, just press the return key (the default is "no"). -The <code>android</code> tool creates the AVD with name and system image mapping you -requested, with the options you specified. - -<p class="note">If you are creating an AVD whose target is an SDK add-on, the -<code>android</code> tool does not allow you to set hardware emulation options. -It assumes that the provider of the add-on has set emulation options -appropriately for the device that the add-on is modeling, and so prevents you -from resetting the options. </p> -<p>For a list of options you can use in the <code>android create avd</code> -command, see the table in <a href="#options">Command-line options for AVDs</a>, -at the bottom of -this page. </p> +<p>The easiest way to create an AVD is to use the graphical AVD Manager, but the +<code>android</code> tool also offers a <a href="#options">command line option</a>.</p> +<p>To create an AVD:</p> +<ol> + <li>In Eclipse, choose <strong>Window > Android SDK and AVD Manager</strong>. </li> + <p>Alternatively, you can launch the graphical AVD Manager by running the +<code>android</code> tool with no options.</p> + <li>Select <strong>Virtual Devices</strong> in the left panel.</li> + + <li>Click <strong>New</strong>. </li> + +<p>The <strong>Create New AVD</strong> dialog appears.</p> <a +href="{@docRoot}images/developing/avd-dialog.png"><img +src="{@docRoot}images/developing/avd-dialog.png" alt="AVD +Dialog" /></a> + + <li>Type the name of the AVD, such as "my_avd".</li> + <li>Choose a target. </li> +<p>The target is the system image that you want to run on the emulator, +from the set of platforms that are installed in your SDK environment. You can +choose a version of the standard Android platform or an SDK add-on. For more +information about how to add platforms to your SDK, see <a +href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>. </p> + <li>Optionally specify any additional settings: </li> + <dl> + <dt><em>SD Card</em></dt> <dd>The path to the SD card image to use with this +AVD, or the size of a new SD card image to create for this AVD.</dd> </dl> +<dt><em>Skin</em></dt> + <dd>The skin to use for this AVD, identified by name or dimensions.</dd> +<dt><em>Hardware</em></dt> + <dd>The hardware emulation options for the device. For a list of the options, see +<a href="#hardwareopts">Setting hardware emulation options</a>.</dd> + </dl> + <li>Click <strong>Create AVD</strong>.</li> +</ol> <h3 id="hardwareopts">Setting hardware emulation options</h3> -<p>When are creating a new AVD that uses a standard Android system image ("Type: -platform"), the <code>android</code> tool lets you set hardware emulation -options for virtual device. The table below lists the options available and the +<p>When you create a new AVD that uses a standard Android system image ("Type: +platform"), the AVD Manager + lets you set hardware emulation +options for your virtual device. +The table below lists the options available and the default values, as well as the names of properties that store the emulated -hardware options in the AVD's configuration file (the config.ini file in the +hardware options in the AVD's configuration file (the <code>config.ini</code> file in the AVD's local directory). </p> <table> @@ -266,6 +165,7 @@ AVD's local directory). </p> </tr> <tr> + <td>Keyboard support</td> <td>Whether the device has a QWERTY keyboard. Default value is "yes".</td> <td>hw.keyboard</td> @@ -299,6 +199,7 @@ AVD's local directory). </p> <td>Maximum vertical camera pixels</td> <td>Default value is "480".</td> <td>hw.camera.maxVerticalPixels</td> + </tr> <tr> @@ -311,6 +212,7 @@ AVD's local directory). </p> <td>Battery support</td> <td>Whether the device can run on a battery. Default value is "yes".</td> <td>hw.battery</td> + </tr> <tr> @@ -323,6 +225,7 @@ AVD's local directory). </p> <td>Audio recording support</td> <td>Whether the device can record audio. Default value is "yes".</td> <td>hw.audioInput</td> + </tr> <tr> @@ -335,6 +238,7 @@ AVD's local directory). </p> <td>SD Card support</td> <td>Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes".</td> <td>hw.sdCard</td> + </tr> <tr> @@ -347,43 +251,55 @@ AVD's local directory). </p> <td>Cache partition size</td> <td>Default value is "66MB".</td> <td>disk.cachePartition.size </td> + </tr> <tr> <td>Abstracted LCD density</td> -<td>Sets the generalized density characteristic used by the AVD's screen. Default value is "160".</td> +<td>Sets the generalized density characteristic used by the AVD's screen. Most +skins come with a value (which you can modify), but if a skin doesn't provide +its own value, the default is 160. </td> <td>hw.lcd.density </td> </tr> +<tr> +<td>Max VM application heap size</td> +<td>The maximum heap size a Dalvik application might allocate before being +killed by the system. Value is in megabytes. Most skins come with a value (which +you can modify), but if a skin doesn't provide its own value, the default is +16.</td> +<td>vm.heapSize</td> +</tr> + </table> <h3 id="location">Default location of the AVD files</h3> -<p>When you create an AVD, the <code>android</code> tool creates a dedicated directory for it +<p>When you create an AVD, the AVD Manager creates a dedicated directory for it on your development computer. The directory contains the AVD configuration file, the user data image and SD card image (if available), and any other files associated with the device. Note that the directory does not contain a system image — instead, the AVD configuration file contains a mapping to the system image, which it loads when the AVD is launched. </p> -<p>The <code>android</code> tool also creates a <AVD name>.ini file for the AVD at the -root of the .android/avd directory on your computer. The file specifies the -location of the AVD directory and always remains at the root the .android -directory.</p> +<p>The AVD Manager also creates a <code><AVD name>.ini</code> file for the +AVD at the root of the <code>.android/avd</code> directory on your computer. The file +specifies the location of the AVD directory and always remains at the root the +.android directory.</p> -<p>By default, the <code>android</code> tool creates the AVD directory inside +<p>By default, the AVD Manager creates the AVD directory inside <code>~/.android/avd/</code> (on Linux/Mac), <code>C:\Documents and Settings\<user>\.android\</code> on Windows XP, and <code>C:\Users\<user>\.android\</code> on Windows Vista. If you want to use a custom location for the AVD directory, you can do so by using the <code>-p <path></code> option when -you create the AVD: </p> +you create the AVD (command line tool only): </p> <pre>android create avd -n my_android1.5 -t 2 -p path/to/my/avd</pre> -<p>If the .android directory is hosted on a network drive, we recommend using +<p>If the <code>.android</code> directory is hosted on a network drive, we recommend using the <code>-p</code> option to place the AVD directory in another location. -The AVD's .ini file remains in the .android directory on the network +The AVD's <code>.ini</code> file remains in the <code>.android</code> directory on the network drive, regardless of the location of the AVD directory. </p> <h2 id="managing">Managing AVDs</h2> @@ -401,18 +317,15 @@ options for AVDs</a> at the bottom of this page. </p> <h3 id="updating">Updating an AVD</h3> -<p>If, for any reason, the platform/add-on root folder has its name changed (maybe because the user has installed an update of the platform/add-on) then the AVD will not be able to load the system image that it is mapped to. In this case, the <code>android list targets</code> command will produce this output: - -<pre>The following Android Virtual Devices could not be loaded: -Name: foo -Path: <path>/.android/avd/foo.avd -Error: Invalid value in image.sysdir. Run 'android update avd -n foo' </pre> - -<p>To fix this error, use the <code>android update avd</code> command to recompute the path to the system images.</p> +<p> +If you rename or move the root directory of a platform (or add-on), an AVD configured to use that platform will no longer be able to load the system image properly. To fix the AVD, use the <strong>Repair...</strong> button in the AVD Manager. From the command line, you can also use the <code>android update avd</code> command to recompute the path to the system images.</p> <h3 id="deleting">Deleting an AVD</h3> -<p>You can use the <code>android</code> tool to delete an AVD. Here is the command usage:</p> +<p>You can delete an AVD in the AVD Manager by selecting the +AVD and clicking <strong>Delete</strong>.</p> + +<p>Alternatively, you can use the <code>android</code> tool to delete an AVD. Here is the command usage:</p> <pre>android delete avd -n <name> </pre> @@ -420,7 +333,21 @@ Error: Invalid value in image.sysdir. Run 'android update avd -n foo' </pre> specified name deletes the AVD's directory and files. </p> -<h2 id="options">Command-line options for AVDs</h2> +<h2 id="options">Command-line options</h2> + +<p>You can use the <code>android</code> tool to create and manage AVDs.</p> + +<p>The command line for creating an AVD has the following syntax:</p> + +<pre> +android create avd -n <name> -t <targetID> [-<option> <value>] ... +</pre> + +<p>Here's an example that creates an AVD with the name "my_android2.2" and target ID "3":</p> + +<pre> +android create avd -n my_android2.2 -t 3 +</pre> <p>The table below lists the command-line options you can use with the <code>android</code> tool. </p> diff --git a/docs/html/guide/developing/tools/bmgr.jd b/docs/html/guide/developing/tools/bmgr.jd index 2f495323e67a..57deb254c5c1 100644 --- a/docs/html/guide/developing/tools/bmgr.jd +++ b/docs/html/guide/developing/tools/bmgr.jd @@ -15,6 +15,11 @@ page.title=bmgr <li><a href="#other">Other Commands</a></li> </ol> + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a></li> + </ol> + </div> </div> @@ -26,6 +31,9 @@ and restore operations so that you don't need to repeatedly wipe data or take si intrusive steps in order to test your application's backup agent. These commands are accessed via the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> shell. +<p>For information about adding support for backup in your application, read <a +href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>, which includes a guide to testing +your application using {@code bmgr}.</p> <h2 id="backup">Forcing a Backup Operation</h2> @@ -90,6 +98,8 @@ will happen even if your application is not currently running. <h2 id="other">Other Commands</h2> +<h3>Wiping data</h3> + <p>The data for a single application can be erased from the active data set on demand. This is very useful while you're developing a backup agent, in case bugs lead you to write corrupt data or saved state information. You can wipe an application's data with the <code>bmgr wipe</code> @@ -102,6 +112,9 @@ you wish to erase. The next backup operation that the application's agent processes will look as though the application had never backed anything up before. + +<h3>Enabling and disabling backup</h3> + <p>You can see whether the Backup Manager is operational at all with the <code>bmgr enabled</code> command: diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd index 8c37d7a02f12..34d9419193c6 100644 --- a/docs/html/guide/publishing/app-signing.jd +++ b/docs/html/guide/publishing/app-signing.jd @@ -123,14 +123,15 @@ all of your applications with the same certificate, throughout the expected lifespan of your applications. There are several reasons why you should do so: </p> <ul> -<li>Application upgrade – As you release upgrades to your -application, you will want to sign the upgrades with the same certificate, if you -want users to upgrade seamlessly to the new version. When the system is -installing an update to an application, if any of the certificates in the -new version match any of the certificates in the old version, then the -system allows the update. If you sign the version without using a matching -certificate, you will also need to assign a different package name to the -application — in this case, the user installs the new version as a +<li>Application upgrade – As you release updates to your application, you +will want to continue to sign the updates with the same certificate or set of +certificates, if you want users to upgrade seamlessly to the new version. When +the system is installing an update to an application, it compares the +certificate(s) in the new version with those in the existing version. If the +certificates match exactly, including both the certificate data and order, then +the system allows the update. If you sign the new version without using matching +certificates, you will also need to assign a different package name to the +application — in this case, the user installs the new version as a completely new application. </li> <li>Application modularity – The Android system allows applications that diff --git a/docs/html/guide/samples/index.jd b/docs/html/guide/samples/index.jd index 2f3ac5ebb6bc..bd9ea52bc6ff 100644 --- a/docs/html/guide/samples/index.jd +++ b/docs/html/guide/samples/index.jd @@ -3,99 +3,13 @@ page.title=Sample Code @jd:body -<p>Sometimes, the best way to learn how things are done is to look at some code. -Here, you can browse the source of some sample Android applications that are included -in the Android SDK.</p> +<script type="text/javascript"> + window.location = toRoot + "resources/samples/index.html"; +</script> -<p>Each version of the Android platform available for the SDK includes a full set of sample -applications (which may vary between different versions of the platform). -You can find the samples in your SDK at:</p> +<p><strong>This document has moved. Please go to <a +href="http://developer.android.com/resources/samples/index.html">List of Sample +Apps</a>.</strong></p> -<p style="margin-left:2em"> -<code><em><sdk></em>/platforms/android-<em><version></em>/samples/</code> -</p> - -<p>You can easily create new Android projects with these samples, modify them -if you'd like, then run them on an emulator or device. For example, to create -a project for the API Demos app from Eclipse, -start a new Android Project, select "Create project from existing source", then select -{@code ApiDemos} in the {@code samples/} directory. To create the API Demos project -using the {@code android} tool, execute:</p> -<pre> -android update project -s -n API Demos -t <em><target_ID></em> -p <em><path-to-platform></em>/samples/ApiDemos/ -</pre> - -<p>The pages below provide an overview of each sample application (available with most -platforms) and allow you to view the source files in your browser. </p> - -<div class="special"> - <p>Some of the samples in this listing are not yet available in the - SDK. While we work to update the SDK, you can - <a href="{@docRoot}shareables/latest_samples.zip">download the latest samples</a> as a ZIP - archive.</p> -</div> - -<dl> - - <dt><a href="{@docRoot}resources/samples/ApiDemos/index.html">API Demos</a></dt> - <dd>A variety of small applications that demonstrate an extensive collection of - framework topics.</dd> - - <dt><a href="{@docRoot}resources/samples/BackupRestore/index.html">Backup and Restore</a></dt> - <dd>An simple example that illustrates a few different ways for an application to - implement support for the Android data backup and restore mechanism.</dd> - - <dt><a href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat</a></dt> - <dd>An application for two-way text messaging over Bluetooth.</dd> - - <dt><a href="{@docRoot}resources/samples/ContactManager/index.html">Contact Manager</a></dt> - <dd>An application that demonstrates how to query the system contacts provider - using the <code>ContactsContract</code> API, as - well as insert contacts into a specific account.</dd> - - <dt><a href="{@docRoot}resources/samples/Home/index.html">Home</a></dt> - <dd>A home screen replacement application.</dd> - - <dt><a href="{@docRoot}resources/samples/JetBoy/index.html">JetBoy</a></dt> - <dd>JetBoy is a game that demonstrates the SONiVOX JET interactive music technology, - with {@link android.media.JetPlayer}.</dd> - - <dt><a href="{@docRoot}resources/samples/LunarLander/index.html">Lunar Lander</a></dt> - <dd>A classic Lunar Lander game.</dd> - - <dt><a href="{@docRoot}resources/samples/MultiResolution/index.html">Multiple Resolutions</a></dt> - <dd>A sample application that shows how to use resource directory qualifiers to - provide different resources for different screen configurations.</dd> - - <dt><a href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a></dt> - <dd>An application for saving notes. Similar (but not identical) to the - <a href="{@docRoot}resources/tutorials/notepad/index.html">Notepad tutorial</a>.</dd> - - <dt><a href="{@docRoot}resources/samples/SearchableDictionary/index.html">Searchable Dictionary</a></dt> - <dd>A sample application that demonstrates Android's search framework, - including how to provide search suggestions for Quick Search Box.</dd> - - <dt><a href="{@docRoot}resources/samples/Snake/index.html">Snake</a></dt> - <dd>An implementation of the classic game "Snake."</dd> - - <dt><a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard</a></dt> - <dd>An example of writing an input method for a software keyboard.</dd> - - <dt><a href=""{@docRoot}resources/samples/Wiktionary/index.html">Wiktionary</a></dt> - <dd>An example of creating interactive widgets for display on the Android - home screen.</dd> - - <dt><a href="{@docRoot}resources/samples/WiktionarySimple/index.html">Wiktionary (Simplified)</a></dt> - <dd>A simple Android home screen widgets example.</dd> - -</dl> - - -<div class="special"> -<p>For more sample applications, check out -<a href="http://code.google.com/p/apps-for-android/">apps-for-android</a>, a -collection of open source applications that demonstrate various Android APIs. -</p> -</div> diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd index aad0f923c41d..6c02031fd4f5 100644 --- a/docs/html/guide/topics/data/backup.jd +++ b/docs/html/guide/topics/data/backup.jd @@ -15,6 +15,8 @@ page.title=Data Backup <h2>In this document</h2> <ol> <li><a href="#Basics">The Basics</a></li> + <li><a href="#BackupManifest">Declaring the Backup Agent in Your Manifest</a></li> + <li><a href="#BackupKey">Registering for Android Backup Service</a></li> <li><a href="#BackupAgent">Extending BackupAgent</a> <ol> <li><a href="#RequiredMethods">Required Methods</a></li> @@ -31,7 +33,7 @@ page.title=Data Backup <li><a href="#RestoreVersion">Checking the Restore Data Version</a></li> <li><a href="#RequestingBackup">Requesting Backup</a></li> <li><a href="#RequestingRestore">Requesting Restore</a></li> - <li><a href="#DevelopingTesting">Developing and Testing Your Backup Agent</a></li> + <li><a href="#Testing">Testing Your Backup Agent</a></li> </ol> <h2>Key classes</h2> @@ -41,36 +43,62 @@ page.title=Data Backup <li>{@link android.app.backup.BackupAgentHelper}</li> </ol> + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a></li> + </ol> + </div> </div> <p>Android's {@link android.app.backup backup} service allows you to copy your persistent -application data to a remote "cloud" storage, in order to provide a restore point for the +application data to remote "cloud" storage, in order to provide a restore point for the application data and settings. If a user performs a factory reset or converts to a new Android-powered device, the system automatically restores your backup data when the application -is re-installed. This way, your users are not required to reproduce their previous data or +is re-installed. This way, your users don't need to reproduce their previous data or application settings. This process is completely transparent to the user and does not affect the functionality or user experience in your application.</p> -<p>Android-powered devices that support the backup service provide a cloud storage area that -saves your backup data and a backup transport that delivers your data to -the storage area and back to the device. During a backup -operation, Android's Backup Manager requests backup data from your application, then delivers it to -the cloud storage using the backup transport. During a restore operation, the Backup Manager -retrieves the backup data from the backup transport and returns it to your application -so it can restore the data to the device. The backup service is <em>not</em> designed for data -synchronization (you do not have access the backup data, except during a restore operation on the -device).</p> - -<p>The cloud storage used for backup won't necessarily be the same on all Android-powered devices. -The cloud storage and backup transport may differ between devices and service providers. -Where the backup data is stored is transparent to your application, but you are assured that your -application data cannot be read by other applications.</p> +<p>During a backup operation (which your application can request), Android's Backup Manager ({@link +android.app.backup.BackupManager}) queries your application for backup data, then hands it to +a backup transport, which then delivers the data to the cloud storage. During a +restore operation, the Backup Manager retrieves the backup data from the backup transport and +returns it to your application so your application can restore the data to the device. It's +possible for your application to request a restore, but that shouldn't be necessary—Android +automatically performs a restore operation when your application is installed and there exists +backup data associated with the user. The primary scenario in which backup data is restored is when +a user resets their device or upgrades to a new device and their previously installed +applications are re-installed.</p> + +<p class="note"><strong>Note:</strong> The backup service is <em>not</em> designed for +synchronizing application data with other clients or saving data that you'd like to access during +the normal application lifecycle. You cannot read or write backup data on demand and cannot access +it in any way other than through the APIs provided by the Backup Manager.</p> + +<p>The backup transport is the client-side component of Android's backup framework, which is +customizable by +the device manufacturer and service provider. The backup transport may differ from device to device +and which backup transport is available on any given device is transparent to your application. The +Backup Manager APIs isolate your application from the actual backup transport available on a given +device—your application communicates with the Backup Manager through a fixed set of APIs, +regardless of the underlying transport.</p> + +<p>Data backup is <em>not</em> guaranteed to be available on all Android-powered +devices. However, your application is not adversely affected in the event +that a device does not provide a backup transport. If you believe that users will benefit from data +backup in your application, then you can implement it as described in this document, test it, then +publish your application without any concern about which devices actually perform backup. When your +application runs on a device that does not provide a backup transport, your application operates +normally, but will not receive callbacks from the Backup Manager to backup data.</p> + +<p>Although you cannot know what the current transport is, you are always assured that your +backup data cannot be read by other applications on the device. Only the Backup Manager and backup +transport have access to the data you provide during a backup operation.</p> <p class="caution"><strong>Caution:</strong> Because the cloud storage and transport service can differ from device to device, Android makes no guarantees about the security of your data while -using backup. You should be cautious about using backup to store sensitive data, such as usernames -and passwords.</p> +using backup. You should always be cautious about using backup to store sensitive data, such as +usernames and passwords.</p> <h2 id="Basics">The Basics</h2> @@ -78,8 +106,8 @@ and passwords.</p> <p>To backup your application data, you need to implement a backup agent. Your backup agent is called by the Backup Manager to provide the data you want to back up. It is also called to restore your backup data when the application is re-installed. The Backup Manager handles all -your data transactions with the cloud storage and your backup agent handles all your data -transactions on the device.</p> +your data transactions with the cloud storage (using the backup transport) and your backup agent +handles all your data transactions on the device.</p> <p>To implement a backup agent, you must:</p> @@ -87,6 +115,11 @@ transactions on the device.</p> <li>Declare your backup agent in your manifest file with the <a href="{@docRoot}guide/topics/manifest/application-element.html#agent">{@code android:backupAgent}</a> attribute.</li> + <li>Register your application with a backup service. Google offers <a +href="http://code.google.com/android/backup/index.html">Android Backup Service</a> as a backup +service for most Android-powered devices, which requires that you register your application in +order for it to work. Any other backup services available might also require you to register +in order to store your data on their servers.</li> <li>Define a backup agent by either:</p> <ol type="a"> <li><a href="#backupAgent">Extending BackupAgent</a> @@ -118,7 +151,6 @@ href="{@docRoot}guide/topics/data/data-storage.html#filesInternal">internal stor - <h2 id="BackupManifest">Declaring the Backup Agent in Your Manifest</h2> <p>This is the easiest step, so once you've decided on the class name for your backup agent, declare @@ -160,11 +192,55 @@ remaining compatible with older devices.</p> +<h2 id="BackupKey">Registering for Android Backup Service</h2> + +<p>Google provides a backup transport with <a +href="http://code.google.com/android/backup/index.html">Android Backup Service</a> for most +Android-powered devices running Android 2.2 or greater.</p> + +<p>In order for you application to perform backup using Android Backup Service, you must +register your application with the service to receive a Backup Service Key, then +declare the Backup Service Key in your Android manifest.</p> + +<p>To get your Backup Service Key, <a +href="http://code.google.com/android/backup/signup.html">register for Android Backup Service</a>. +When you register, you will be provided a Backup Service Key and the appropriate {@code +<meta-data>} XML code for your Android manifest file, which you must include as a child of the +{@code <application>} element. For example:</p> + +<pre> +<application android:label="MyApplication" + android:backupAgent="MyBackupAgent"> + ... + <meta-data android:name="com.google.android.backup.api_key" + android:value="AEdPqrEAAAAIDaYEVgU6DJnyJdBmU7KLH3kszDXLv_4DIsEIyQ" /> +</application> +</pre> + +<p>The <code>android:name</code> must be <code>"com.google.android.backup.api_key"</code> and +the <code>android:value</code> must be the Backup Service Key received from the Android Backup +Service registration.</p> + +<p>If you have multiple applications, you must register each one, using the respective package +name.</p> + +<p class="note"><strong>Note:</strong> The backup transport provided by Android Backup Service is +not guaranteed to be available +on all Android-powered devices that support backup. Some devices might support backup +using a different transport, some devices might not support backup at all, and there is no way for +your application to know what transport is used on the device. However, if you implement backup for +your application, you should always include a Backup Service Key for Android Backup Service so +your application can perform backup when the device uses the Android Backup Service transport. If +the device does not use Android Backup Service, then the {@code <meta-data>} element with the +Backup Service Key is ignored.</p> + + + <h2 id="BackupAgent">Extending BackupAgent</h2> <p>Most applications shouldn't need to extend the {@link android.app.backup.BackupAgent} class -directly, but should instead <a href="BackupAgentHelper">extend BackupAgentHelper</a> to take +directly, but should instead <a href="#BackupAgentHelper">extend BackupAgentHelper</a> to take advantage of the built-in helper classes that automatically backup and restore your files. However, you might want to extend {@link android.app.backup.BackupAgent} directly if you need to:</p> <ul> @@ -186,7 +262,7 @@ create your table and insert the data during a restore operation.</li> <p>If you don't need to perform any of the tasks above and want to back up complete files from {@link android.content.SharedPreferences} or <a href="{@docRoot}guide/topics/data/data-storage.html#filesInternal">internal storage</a>, you -should skip to <a href="BackupAgentHelper">Extending BackupAgentHelper</a>.</p> +should skip to <a href="#BackupAgentHelper">Extending BackupAgentHelper</a>.</p> @@ -237,7 +313,7 @@ backup for all applications that have requested a backup since the last backup w <p class="note"><strong>Tip:</strong> While developing your application, you can initiate an immediate backup operation from the Backup Manager with the <a -href="{@docRoot}guide/developing/tools/bmgr.html">bmgr tool</a>.</p> +href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a>.</p> <p>When the Backup Manager calls your {@link android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor) @@ -381,7 +457,7 @@ android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore( href="#RequestingRestore">Requesting restore</a> for more information).</p> <p class="note"><strong>Note:</strong> While developing your application, you can also request a -restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">bmgr +restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a>.</p> <p>When the Backup Manager calls your {@link @@ -500,8 +576,8 @@ helpers.</p> <h3 id="SharedPreferences">Backing up SharedPreferences</h3> -<p>When you instantiate a {@link android.app.backup.SharedPreferencesBackupHelper}, you must the -name of one or more {@link android.content.SharedPreferences} files.</p> +<p>When you instantiate a {@link android.app.backup.SharedPreferencesBackupHelper}, you must +include the name of one or more {@link android.content.SharedPreferences} files.</p> <p>For example, to back up a {@link android.content.SharedPreferences} file named "user_preferences", a complete backup agent using {@link android.app.backup.BackupAgentHelper} looks @@ -742,7 +818,7 @@ onBackup()}.</p> <p class="note"><strong>Note:</strong> While developing your application, you can request a backup and initiate an immediate backup operation with the <a -href="{@docRoot}guide/developing/tools/bmgr.html">bmgr +href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a>.</p> @@ -757,25 +833,52 @@ android.app.backup.BackupAgent#onRestore(BackupDataInput,int,ParcelFileDescripto implementation, passing the data from the current set of backup data.</p> <p class="note"><strong>Note:</strong> While developing your application, you can request a -restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">bmgr +restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a>.</p> -<h2 id="DevelopingTesting">Developing and Testing Your Backup Agent</h2> +<h2 id="Testing">Testing Your Backup Agent</h2> -<p>To develop and test your backup agent:</p> -<ul> - <li>Set your build target to a platform using API Level 8 or higher</li> - <li>Run your application on a suitable Android system image: +<p>Once you've implemented your backup agent, you can test the backup and restore functionality +with the following procedure, using <a +href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}</a>.</p> + +<ol> + <li>Install your application on a suitable Android system image <ul> - <li>If using the emulator, create and use an AVD with the Google APIs add-on (API Level -8) — the Google APIs add-on is available as an SDK component through the SDK and AVD -Manager</li> + <li>If using the emulator, create and use an AVD with Android 2.2 (API Level 8).</li> <li>If using a device, the device must be running Android 2.2 or greater and have Android -Market built in</li> +Market built in.</li> </ul> </li> - <li>Test your backup agent using the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code -bmgr}</a> tool to initiate backup and restore operations</li> -</ul> + <li>Ensure that backup is enabled + <ul> + <li>If using the emulator, you can enable backup with the following command from your SDK +{@code tools/} path: +<pre class="no-pretty-print">adb shell bmgr enable true</pre> + </li> + <li>If using a device, open the system <b>Settings</b>, select <b>Privacy</b>, then enable +<b>Back up my data</b> and <b>Automatic restore</b>. + </ul> + </li> + <li>Open your application and initialize some data + <p>If you've properly implemented backup in your application, then it should request a +backup each time the data changes. For example, each time the user changes some data, your app +should call {@link android.app.backup.BackupManager#dataChanged()}, which adds a backup request to +the Backup Manager queue. For testing purposes, you can also make a request with the following +{@code bmgr} command:</p> +<pre class="no-pretty-print">adb shell bmgr backup <em>your.package.name</em></pre> + </li> + <li>Initiate a backup operation: +<pre class="no-pretty-print">adb shell bmgr run</pre> + <p>This forces the Backup Manager to perform all backup requests that are in its +queue.</p> + <li>Uninstall your application: +<pre class="no-pretty-print">adb uninstall <em>your.package.name</em></pre> + </li> + <li>Re-install your application.</li> +</ol> + +<p>If your backup agent is successful, all the data you initialized in step 4 is restored.</p> + diff --git a/docs/html/guide/topics/resources/available-resources.jd b/docs/html/guide/topics/resources/available-resources.jd index 09c55a5a1ab0..19babee6c922 100644 --- a/docs/html/guide/topics/resources/available-resources.jd +++ b/docs/html/guide/topics/resources/available-resources.jd @@ -18,23 +18,6 @@ of application resource that you can provide in your resources directory ({@code <p>Here's a brief summary of each resource type:</p> -<div class="sidebox-wrapper"> -<div class="sidebox"> -<h2>{@code R.id} Is Not a Resource</h2> - -<p>You will often use an {@code R.id} integer to handle {@link android.view.View} objects in -your UI. Although the {@code id} is a subclass of the {@code R} class, it is not considered a -"resource" because it is not a reference to an externalized application resource. The {@code id} -is simply a unique identifier that allows you to handle elements in your UI by instantiating -objects with {@link android.app.Activity#findViewById(int) findViewById()}.</p> - -<p>For information about using {@code R.id} with your UI, see <a -href="{@docRoot}guide/topics/ui/declaring-layout.html#attributes">Declaring Layout</a>.</p> - -</div> -</div> - - <dl> <dt><a href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a></dt> <dd>Define pre-determined animations.<br/> diff --git a/docs/html/guide/topics/resources/drawable-resource.jd b/docs/html/guide/topics/resources/drawable-resource.jd index d8de16a42999..1e4cca7c171d 100644 --- a/docs/html/guide/topics/resources/drawable-resource.jd +++ b/docs/html/guide/topics/resources/drawable-resource.jd @@ -18,32 +18,50 @@ and draw on the screen. There are several different types of drawables:</p> <dl> <dt><a href="#Bitmap">Bitmap File</a><dt> <dd>A bitmap graphic file ({@code .png}, {@code .jpg}, or {@code .gif}). - A {@link android.graphics.drawable.BitmapDrawable}.</dd> + Creates a {@link android.graphics.drawable.BitmapDrawable}.</dd> <dt><a href="#NinePatch">Nine-Patch File</a></dt> <dd>A PNG file with stretchable regions to allow image resizing based on content ({@code -.9.png}). A {@link android.graphics.drawable.NinePatchDrawable}.</dd> -<!-- <dt><a href="#BitmapAlias">Bitmap Alias</a><dt> - <dd>An alias for a drawable.</dd> --> +.9.png}). Creates a {@link android.graphics.drawable.NinePatchDrawable}.</dd> + <dt><a href="#LayerList">Layer List</a></dt> + <dd>A Drawable that manages an array of other Drawables. These are drawn in array order, so the +element with the largest index is be drawn on top. Creates a {@link +android.graphics.drawable.LayerDrawable}.</dd> <dt><a href="#StateList">State List</a></dt> <dd>An XML file that references different bitmap graphics for different states (for example, to use a different image when a button is pressed). - A {@link android.graphics.drawable.StateListDrawable}.</dd> - <dt><a href="#Color">Color</a></dt> - <dd>A resource defined in XML that specifies a rectangle of color, with - optionally rounded corners. A {@link android.graphics.drawable.PaintDrawable}.</dd> - <dt><a href="#Shape">Shape</a></dt> + Creates a {@link android.graphics.drawable.StateListDrawable}.</dd> + <dt><a href="#LevelList">Level List</a></dt> + <dd>An XML file that defines a Drawable that manages a number of alternate Drawables, each +assigned a maximum numerical value. Creates a {@link +android.graphics.drawable.LevelListDrawable}.</dd> + <dt><a href="#Transition">Transition Drawable</a></dt> + <dd>An XML file that defines a Drawable that can cross-fade between two drawable resources. +Creates a {@link android.graphics.drawable.TransitionDrawable}.</dd> + <dt><a href="#Clip">Clip Drawable</a></dt> + <dd>An XML file that defines a drawable that clips another Drawable based on this Drawable's +current level value. Creates a {@link android.graphics.drawable.ClipDrawable}.</dd> + <dt><a href="#Scale">Scale Drawable</a></dt> + <dd>An XML file that defines a drawable that changes the size of another Drawable based on its +current level value. Creates a {@link android.graphics.drawable.ScaleDrawable}</dd> + <dt><a href="#Shape">Shape Drawable</a></dt> <dd>An XML file that defines a geometric shape, including colors and gradients. - A {@link android.graphics.drawable.ShapeDrawable}.</dd> + Creates a {@link android.graphics.drawable.ShapeDrawable}.</dd> </dl> -<p>Documentation for the {@link android.graphics.drawable.AnimationDrawable} resource -is in the <a href="animation-resource.html">Animation Resource</a> document.</p> +<p>Also see the <a href="animation-resource.html">Animation Resource</a> document for how to +create an {@link android.graphics.drawable.AnimationDrawable}.</p> + + -<h2 id="Bitmap">Bitmap File</h2> -<p>A basic bitmap image. Android supports basic bitmap files in a few different formats: +<h2 id="Bitmap">Bitmap</h2> + +<p>A bitmap image. Android supports bitmap files in a three formats: {@code .png} (preferred), {@code .jpg} (acceptable), {@code .gif} (discouraged).</p> +<p>You can reference a bitmap file directly, using the filename as the resource ID, or create an +alias resource ID in XML.</p> + <p class="note"><strong>Note:</strong> Bitmap files may be automatically optimized with lossless image compression by the <a href="{@docRoot}guide/developing/tools/aapt.html">aapt</a> tool. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit @@ -52,11 +70,18 @@ memory. So be aware that the image binaries placed in this directory can change you plan on reading an image as a bit stream in order to convert it to a bitmap, put your images in the <code>res/raw/</code> folder instead, where they will not be optimized.</p> + +<h3 id="BitmapFile">Bitmap File</h3> + +<p>A bitmap file is a {@code .png}, {@code .jpg}, or {@code .gif} file. Android creates a {@link +android.graphics.drawable.Drawable} +resource for any of these files when you save them in the {@code res/drawable/} directory.</p> + <dl class="xml"> <dt>file location:</dt> <dd><code>res/drawable/<em>filename</em>.png</code> ({@code .png}, {@code .jpg}, or {@code .gif})<br/> -The filename will be used as the resource ID.</dd> +The filename is used as the resource ID.</dd> <dt>compiled resource datatype:</dt> <dd>Resource pointer to a {@link android.graphics.drawable.BitmapDrawable}.</dd> @@ -68,15 +93,16 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> </dd> <dt>example:</dt> -<dd>With an image saved at <code>res/drawable/myimage.png</code>, this layout XML will apply + +<dd>With an image saved at <code>res/drawable/myimage.png</code>, this layout XML applies the image to a View: <pre> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" - <strong>android:src="@drawable/myimage"</strong> /> + android:src="@drawable/myimage" /> </pre> -<p>This application code will retrieve the image as a {@link +<p>The following application code retrieves the image as a {@link android.graphics.drawable.Drawable}:</p> <pre> Resources res = {@link android.content.Context#getResources()}; @@ -97,50 +123,218 @@ Drawable drawable = res.{@link android.content.res.Resources#getDrawable(int) ge +<h3 id="XmlBitmap">XML Bitmap</h3> + +<p>An XML bitmap is a resource defined in XML that points to a bitmap file. The effect is an alias for a +raw bitmap file. The XML can specify additional properties for the bitmap such as dithering and tiling.</p> +<p class="note"><strong>Note:</strong> You can use a {@code <bitmap>} element as a child of +an {@code <item>} element. For +example, when creating a <a href="#StateList">state list</a> or <a href="#LayerList">layer list</a>, +you can exclude the {@code android:drawable} +attribute from an {@code <item>} element and nest a {@code <bitmap>} inside it +that defines the drawable item.</p> +<dl class="xml"> -<h2 id="NinePatch">Nine-Patch File</h2> +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> + +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.BitmapDrawable}.</dd> + +<dt>resource reference:</dt> +<dd> +In Java: <code>R.drawable.<em>filename</em></code></li><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + +<dt>syntax:</dt> +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#bitmap-element">bitmap</a> + xmlns:android="http://schemas.android.com/apk/res/android" + android:src="@[package:]drawable/<em>drawable_resource</em>" + android:antialias=["true" | "false"] + android:dither=["true" | "false"] + android:filter=["true" | "false"] + android:gravity=["top" | "bottom" | "left" | "right" | "center_vertical" | + "fill_vertical" | "center_horizontal" | "fill_horizontal" | + "center" | "fill" | "clip_vertical" | "clip_horizontal"] + android:tileMode=["disabled" | "clamp" | "repeat" | "mirror"] /> +</pre> +</dd> + + +<dt>elements:</dt> +<dd> +<dl class="tag-list"> + + <dt id="bitmap-element"><code><bitmap></code></dt> + <dd>Defines the bitmap source and its properties. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. This is required only if the +<code><bitmap></code> is the root element—it is not needed when the +<code><bitmap></code> is nested inside an <code><item></code>.</dd> + <dt><code>android:src</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource.</dd> + <dt><code>android:antialias</code></dt> + <dd><em>Boolean</em>. Enables or disables antialiasing.</dd> + <dt><code>android:dither</code></dt> + <dd><em>Boolean</em>. Enables or disables dithering of the bitmap if the bitmap does not +have the same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with an RGB 565 +screen).</dd> + <dt><code>android:filter</code></dt> + <dd><em>Boolean</em>. Enables or disables bitmap filtering. Filtering is used when the +bitmap is shrunk or stretched to smooth its apperance.</dd> + <dt><code>android:gravity</code></dt> + <dd><em>Keyword</em>. Defines the gravity for the bitmap. The gravity indicates where to +position the drawable in its container if the bitmap is smaller than the container. + <p>Must be one or more (separated by '|') of the following constant values:</p> +<table> +<tr><th>Value</th><th>Description</th></tr> +<tr><td><code>top</code></td> +<td>Put the object at the top of its container, not changing its size.</td></tr> +<tr><td><code>bottom</code></td> +<td>Put the object at the bottom of its container, not changing its size. </td></tr> +<tr><td><code>left</code></td> +<td>Put the object at the left edge of its container, not changing its size. </td></tr> +<tr><td><code>right</code></td> +<td>Put the object at the right edge of its container, not changing its size. </td></tr> +<tr><td><code>center_vertical</code></td> +<td>Place object in the vertical center of its container, not changing its size. </td></tr> +<tr><td><code>fill_vertical</code></td> +<td>Grow the vertical size of the object if needed so it completely fills its container. </td></tr> +<tr><td><code>center_horizontal</code></td> +<td>Place object in the horizontal center of its container, not changing its size. </td></tr> +<tr><td><code>fill_horizontal</code></td> +<td>Grow the horizontal size of the object if needed so it completely fills its container. +</td></tr> +<tr><td><code>center</code></td> +<td>Place the object in the center of its container in both the vertical and horizontal axis, not +changing its size. </td></tr> +<tr><td><code>fill</code></td> +<td>Grow the horizontal and vertical size of the object if needed so it completely fills its +container. This is the default.</td></tr> +<tr><td><code>clip_vertical</code></td> +<td>Additional option that can be set to have the top and/or bottom edges of the child clipped to +its container's bounds. The clip is based on the vertical gravity: a top gravity clips the +bottom edge, a bottom gravity clips the top edge, and neither clips both edges. +</td></tr> +<tr><td><code>clip_horizontal</code></td> +<td>Additional option that can be set to have the left and/or right edges of the child clipped to +its container's bounds. The clip is based on the horizontal gravity: a left gravity clips +the right edge, a right gravity clips the left edge, and neither clips both edges. +</td></tr> +</table> + </dd> + <dt><code>android:tileMode</code></dt> + <dd><em>Keyword</em>. Defines the tile mode. When the tile mode is enabled, the bitmap is +repeated. Gravity is ignored when the tile mode is enabled. + <p>Must be one of the following constant values:</p> +<table> +<tr><th>Value</th><th>Description</th></tr> +<tr><td><code>disabled</code></td> +<td>Do not tile the bitmap. This is the default value.</td></tr> +<tr><td><code>clamp</code></td> +<td>Replicates the edge color if the shader draws outside of its original bounds</td></tr> +<tr><td><code>repeat</code></td> +<td>Repeats the shader's image horizontally and vertically.</td></tr> +<tr><td><code>mirror</code></td> +<td>Repeats the shader's image horizontally and vertically, alternating mirror images so that +adjacent images always seam.</td></tr> +</table> + + </dd> + </dl> + </dd> + +</dl> +</dd> <!-- end elements and attributes --> + +<dt>example:</dt> +<dd> +<pre> +<?xml version="1.0" encoding="utf-8"?> +<bitmap xmlns:android="http://schemas.android.com/apk/res/android" + android:src="@drawable/icon" + android:tileMode="repeat" /> +</pre> + +</dd> + +<dt>see also:</dt> +<dd> +<ul> + <li>{@link android.graphics.drawable.BitmapDrawable}</li> + <li><a href="{@docRoot}guide/topics/resources/providing-resources.html#AliasResources">Creating +alias resources</a> +</ul> +</dd> + +</dl> + + + + + + +<h2 id="NinePatch">Nine-Patch</h2> <p>A {@link android.graphics.NinePatch} is a PNG image in which you can define stretchable regions -that Android will scale when content within the View exceeds the normal image bounds. You will +that Android scales when content within the View exceeds the normal image bounds. You typically assign this type of image as the background of a View that has at least one dimension set to {@code "wrap_content"}, and when the View grows to accomodate the content, the Nine-Patch image -will also be scaled to match the size of the View. An example use of a Nine-Patch image is the +is also scaled to match the size of the View. An example use of a Nine-Patch image is the background used by Android's standard {@link android.widget.Button} widget, which must stretch to accommodate the text (or image) inside the button.</p> -<p>For a complete discussion about how to define a Nine-Patch file with stretchable regions, +<p>Same as with a normal <a href="#Bitmap">bitmap</a>, you can reference a Nine-Patch file directly +or from a resource defined by XML.</p> + +<p>For a complete discussion about how to create a Nine-Patch file with stretchable regions, see the <a href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">2D Graphics</a> document.</p> + +<h3 id="NinePatchFile">Nine-Patch File</h3> + <dl class="xml"> <dt>file location:</dt> <dd><code>res/drawable/<em>filename</em>.9.png</code><br/> -The filename will be used as the resource ID.</dd> +The filename is used as the resource ID.</dd> <dt>compiled resource datatype:</dt> <dd>Resource pointer to a {@link android.graphics.drawable.NinePatchDrawable}.</dd> <dt>resource reference:</dt> + <dd> In Java: <code>R.drawable.<em>filename</em></code><br/> In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> </dd> <dt>example:</dt> -<dd>With an image saved at <code>res/drawable/myninepatch.9.png</code>, this layout XML will -apply the Nine-Patch to a View: + +<dd>With an image saved at <code>res/drawable/myninepatch.9.png</code>, this layout XML +applies the Nine-Patch to a View: <pre> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" - <strong>android:background="@drawable/myninepatch"</strong> /> + android:background="@drawable/myninepatch" /> </pre> </dd> <dt>see also:</dt> + <dd> <ul> <li><a href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">2D Graphics</a></li> @@ -153,6 +347,238 @@ apply the Nine-Patch to a View: +<h3 id="NinePatchXml">XML Nine-Patch</h3> + +<p>An XML Nine-Patch is a resource defined in XML that points to a Nine-Patch file. The XML can +specify dithering for the image.</p> + +<dl class="xml"> + +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> + +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.NinePatchDrawable}.</dd> + +<dt>resource reference:</dt> + +<dd> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + + +<dt>syntax:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#bitmap-element">nine-patch</a> + xmlns:android="http://schemas.android.com/apk/res/android" + android:src="@[package:]drawable/<em>drawable_resource</em>" + android:dither=["true" | "false"] /> +</pre> +</dd> + + +<dt>elements:</dt> + +<dd> +<dl class="tag-list"> + + <dt id="layerlist-element"><code><bitmap></code></dt> + <dd>Defines the bitmap source and its properties. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + <dt><code>android:src</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a Nine-Patch +file.</dd> + <dt><code>android:dither</code></dt> + <dd><em>Boolean</em>. Enables or disables dithering of the bitmap if the bitmap does not +have the same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with an RGB 565 +screen).</dd> + </dl> + </dd> +</dl> +</dd> + + +<dt>example:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<nine-patch xmlns:android="http://schemas.android.com/apk/res/android" + android:src="@drawable/myninepatch" + android:dither="false" /> +</pre> +</dd> +</dl> + + + + + + +<h2 id="LayerList">Layer List</h2> + +<p>A {@link android.graphics.drawable.LayerDrawable} is a drawable object +that manages an array of other drawables. Each drawable in the list is drawn in the order of the +list—the last drawable in the list is drawn on top.</p> + +<p>Each drawable is represented by an {@code <item>} element inside a single {@code +<layer-list>} element.</p> + +<dl class="xml"> + +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> + +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.LayerDrawable}.</dd> + +<dt>resource reference:</dt> + +<dd> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + +<dt>syntax:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#layerlist-element">layer-list</a> + xmlns:android="http://schemas.android.com/apk/res/android" > + <<a href="#layerlist-item-element">item</a> + android:drawable="@[package:]drawable/<em>drawable_resource</em>" + android:id="@[+][<em>package</em>:]id/<i>resource_name</i>" + android:top="<em>dimension</em>" + android:right="<em>dimension</em>" + android:bottom="<em>dimension</em>" + android:left="<em>dimension</em>" /> +</selector> +</pre> +</dd> + +<dt>elements:</dt> + +<dd> +<dl class="tag-list"> + + <dt id="layerlist-element"><code><layer-list></code></dt> + <dd><strong>Required.</strong> This must be the root element. Contains one or more {@code +<item>} elements. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + </dl> + </dd> + <dt id="layerlist-item-element"><code><item></code></dt> + <dd>Defines a drawable to place in the layer drawable, in a position defined by its attributes. +Must be a child of a <code><selector></code> element. Accepts child {@code <bitmap>} +elements. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>android:drawable</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource.</dd> + <dt><code>android:id</code></dt> + <dd><em>Resource ID</em>. A unique resource ID for this drawable. To create a new resource +ID for this item, use the form: +<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new +ID. You can use this identifier to +retrieve and modify the drawable with {@link android.view.View#findViewById(int) +View.findViewById()} or {@link android.app.Activity#findViewById(int) Activity.findViewById()}.</dd> + <dt><code>android:top</code></dt> + <dd><em>Integer</em>. The top offset in pixels.</dd> + <dt><code>android:right</code></dt> + <dd><em>Integer</em>. The right offset in pixels.</dd> + <dt><code>android:bottom</code></dt> + <dd><em>Integer</em>. The bottom offset in pixels.</dd> + <dt><code>android:left</code></dt> + <dd><em>Integer</em>. The left offset in pixels.</dd> + </dl> + <p>All drawable items are scaled to fit the size of the containing View, by default. Thus, +placing your images in a layer list at different positions might increase the size of the View and +some images scale as appropriate. To avoid +scaling items in the list, use a {@code <bitmap>} element inside the {@code +<item>} element to specify the drawable and define the gravity to something that does not +scale, such as {@code "center"}. For example, the following {@code <item>} defines an item +that scales to fit its container View:</p> +<pre> +<item android:drawable="@drawable/image" /> +</pre> + +<p>To avoid scaling, the following example uses a {@code <bitmap>} element with centered +gravity:</p> +<pre> +<item> + <bitmap android:src="<b>@drawable/image</b>" + android:gravity="center" /> +</item> +</pre> + </dd> + +</dl> +</dd> <!-- end elements and attributes --> + +<dt>example:</dt> + +<dd>XML file saved at <code>res/drawable/layers.xml</code>: +<pre> +<?xml version="1.0" encoding="utf-8"?> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item> + <bitmap android:src="@drawable/android_red" + android:gravity="center" /> + </item> + <item android:top="10dp" android:left="10dp"> + <bitmap android:src="@drawable/android_green" + android:gravity="center" /> + </item> + <item android:top="20dp" android:left="20dp"> + <bitmap android:src="@drawable/android_blue" + android:gravity="center" /> + </item> +</layer-list> +</pre> +<p>Notice that this example uses a nested {@code <bitmap>} element to define the drawable +resource for each item with a "center" gravity. This ensures that none of the images are scaled to +fit the size of the container, due to resizing caused by the offset images.</p> + +<p>This layout XML applies the drawable to a View:</p> +<pre> +<ImageView + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:src="@drawable/layers" /> +</pre> + +<p>The result is a stack of increasingly offset images:</p> +<img src="{@docRoot}images/resources/layers.png" alt="" /> +</dd> <!-- end example --> + +<dt>see also:</dt> +<dd> +<ul> + <li>{@link android.graphics.drawable.LayerDrawable}</li> +</ul> +</dd> + +</dl> + + + + @@ -163,33 +589,36 @@ apply the Nine-Patch to a View: that uses a several different images to represent the same graphic, depending on the state of the object. For example, a {@link android.widget.Button} widget can exist in one of several different states (pressed, focused, -or niether) and, using a state list drawable, you can provide a different button image for each +or niether) and, using a state list drawable, you can provide a different background image for each state.</p> <p>You can describe the state list in an XML file. Each graphic is represented by an {@code <item>} element inside a single {@code <selector>} element. Each {@code <item>} uses various attributes to describe the state in which it should be used as the graphic for the drawable.</p> + <p>During each state change, the state list is traversed top to bottom and the first item that -matches the current state will be used—the selection is <em>not</em> based on the "best +matches the current state is used—the selection is <em>not</em> based on the "best match," but simply the first item that meets the minimum criteria of the state.</p> <dl class="xml"> <dt>file location:</dt> <dd><code>res/drawable/<em>filename</em>.xml</code><br/> -The filename will be used as the resource ID.</dd> +The filename is used as the resource ID.</dd> <dt>compiled resource datatype:</dt> <dd>Resource pointer to a {@link android.graphics.drawable.StateListDrawable}.</dd> <dt>resource reference:</dt> + <dd> In Java: <code>R.drawable.<em>filename</em></code><br/> In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> </dd> <dt>syntax:</dt> + <dd> <pre class="stx"> <?xml version="1.0" encoding="utf-8"?> @@ -212,6 +641,7 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> </dd> <dt>elements:</dt> + <dd> <dl class="tag-list"> @@ -224,8 +654,8 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be <code>"http://schemas.android.com/apk/res/android"</code>. <dt><code>android:constantSize</code></dt> - <dd><em>Boolean</em>. "true" if the drawable's reported internal size will remain constant as the state -changes (the size will be the maximum of all of the states); "false" if the size will vary based on + <dd><em>Boolean</em>. "true" if the drawable's reported internal size remains constant as the state +changes (the size is the maximum of all of the states); "false" if the size varies based on the current state. Default is false.</dd> <dt><code>android:dither</code></dt> <dd><em>Boolean</em>. "true" to enable dithering of the bitmap if the bitmap does not have the same pixel @@ -270,9 +700,9 @@ receiving touch/click events); "false" if it should be used when the object is d application is in the foreground), "false" if this item should be used when the application window does not have focus (for example, if the notification shade is pulled down or a dialog appears).</dd> </dl> - <p class="note"><strong>Note:</strong>Remember that the first item in the state list that -matches the current state of the object will be applied. So if the first item in the list contains -none of the state attributes above, then it will be applied every time, which is why your + <p class="note"><strong>Note:</strong> Remember that Android applies the first item in the state list that +matches the current state of the object. So, if the first item in the list contains +none of the state attributes above, then it is applied every time, which is why your default value should always be last (as demonstrated in the following example).</p> </dd> @@ -280,6 +710,7 @@ default value should always be last (as demonstrated in the following example).< </dd> <!-- end elements and attributes --> <dt>example:</dt> + <dd>XML file saved at <code>res/drawable/button.xml</code>: <pre> <?xml version="1.0" encoding="utf-8"?> @@ -292,12 +723,12 @@ default value should always be last (as demonstrated in the following example).< </selector> </pre> -<p>This layout XML will apply the drawable to a View:</p> +<p>This layout XML applies the drawable to a View:</p> <pre> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" - <strong>android:src="@drawable/button"</strong> /> + android:src="@drawable/button" /> </pre> </dd> <!-- end example --> @@ -317,106 +748,513 @@ default value should always be last (as demonstrated in the following example).< +<h2 id="LevelList">Level List</h2> +<p>A Drawable that manages a number of alternate Drawables, each assigned a maximum numerical +value. Setting the level value of the drawable with {@link +android.graphics.drawable.Drawable#setLevel(int) setLevel()} loads the drawable resource in the +level list that has a {@code android:maxLevel} value greater than or equal to the value +passed to the method.</p> +<dl class="xml"> +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.LevelListDrawable}.</dd> + +<dt>resource reference:</dt> + +<dd> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + +<dt>syntax:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#levellist-element">level-list</a> + xmlns:android="http://schemas.android.com/apk/res/android" > + <<a href="#levellist-item-element">item</a> + android:drawable="@drawable/<i>drawable_resource</i>" + android:maxLevel="<i>integer</i>" + android:minLevel="<i>integer</i>" /> +</level-list> +</pre> +</dd> + +<dt>elements:</dt> + +<dd> +<dl class="tag-list"> + + <dt id="levellist-element"><code><level-list></code></dt> + <dd>This must be the root element. Contains one or more {@code <item>} elements. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + </dl> + </dd> + + <dt id="levellist-item-element"><code><item></code></dt> + <dd>Defines a drawable to use at a certain level. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>android:drawable</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource to be inset.</dd> + <dt><code>android:maxLevel</code></dt> + <dd><em>Integer</em>. The maximum level allowed for this item.</dd> + <dt><code>android:minLevel</code></dt> + <dd><em>Integer</em>. The minimum level allowed for this item.</dd> + </dl> + </dd> +</dl> + +</dd> + +<dt>example:</dt> + +<dd> + +<pre> +<?xml version="1.0" encoding="utf-8"?> +<level-list xmlns:android="http://schemas.android.com/apk/res/android" > + <item + android:drawable="@drawable/status_off" + android:maxLevel="0" /> + <item + android:drawable="@drawable/status_on" + android:maxLevel="1" /> +</level-list> +</pre> +<p>Once this is applied to a {@link android.view.View}, the level can be changed with {@link +android.graphics.drawable.Drawable#setLevel(int) setLevel()} or {@link +android.widget.ImageView#setImageLevel(int) setImageLevel()}.</p> + +</dd> + +<dt>see also:</dt> + +<dd> +<ul> + <li>{@link android.graphics.drawable.LevelListDrawable}</li> +</ul> +</dd> + +</dl> -<h2 id="Color">Color</h2> -<p>This is a color defined in XML that's used as a drawable to fill a rectangular space, -with optionally rounded corners. This kind of drawable behaves like a color fill.</p> -<p class="note"><strong>Note:</strong> A color drawable is a simple resource that is referenced -using the value provided in the {@code name} attribute (not the name of the XML file). As -such, you can combine a color drawable resources with other simple resources in the one XML file, -under one {@code <resources>} element.</p> +<h2 id="Transition">Transition Drawable</h2> + +<p>A {@link android.graphics.drawable.TransitionDrawable} is a drawable object +that can cross-fade between the two drawable resources.</p> + +<p>Each drawable is represented by an {@code <item>} element inside a single {@code +<transition>} element. No more than two items are supported. To transition forward, call +{@link android.graphics.drawable.TransitionDrawable#startTransition(int) startTransition()}. To +transition backward, call {@link android.graphics.drawable.TransitionDrawable#reverseTransition(int) +reverseTransition()}.</p> + <dl class="xml"> <dt>file location:</dt> -<dd><code>res/drawable/<em>filename</em>.png</code><br/> -The filename is arbitrary. The element's {@code name} will be used as the resource ID.</dd> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> <dt>compiled resource datatype:</dt> -<dd>Resource pointer to a {@link android.graphics.drawable.PaintDrawable}.</dd> +<dd>Resource pointer to a {@link android.graphics.drawable.TransitionDrawable}.</dd> <dt>resource reference:</dt> + <dd> -In Java: <code>R.drawable.<em>color_name</em></code><br/> -In XML: <code>@[<em>package</em>:]drawable/<em>color_name</em></code> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> </dd> <dt>syntax:</dt> + <dd> <pre class="stx"> -<?xml version="1.0" encoding="utf-8"?> -<<a href="#color-resources-element">resources</a>> - <<a href="#drawable-element">drawable</a> - name="<em>color_name</em>" - ><em>color</em></drawable> -</resources> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#transition-element">layer-list</a> +xmlns:android="http://schemas.android.com/apk/res/android" > + <<a href="#transition-item-element">item</a> + android:drawable="@[package:]drawable/<em>drawable_resource</em>" + android:id="@[+][<em>package</em>:]id/<i>resource_name</i>" + android:top="<em>dimension</em>" + android:right="<em>dimension</em>" + android:bottom="<em>dimension</em>" + android:left="<em>dimension</em>" /> +</selector> </pre> </dd> <dt>elements:</dt> + <dd> <dl class="tag-list"> - <dt id="color-resources-element"><code><resources></code></dt> - <dd><strong>Required.</strong> This must be the root node. - <p>No attributes.</p> + <dt id="transition-element"><code><transition></code></dt> + <dd><strong>Required.</strong> This must be the root element. Contains one or more {@code +<item>} elements. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + </dl> </dd> - <dt id="drawable-element"><code><drawable></code></dt> - <dd>A color to use as a drawable rectangle. The value can be - any valid hexadecimal color value or a <a href="more-resources.html#Color">color - resource</a>. A color value always begins with a pound (#) character, followed - by the Alpha-Red-Green-Blue information in one of the following formats: - #<em>RGB</em>, #<em>RRGGBB</em>, #<em>ARGB</em>, or #<em>AARRGGBB</em>. + <dt id="transition-item-element"><code><item></code></dt> + <dd>Defines a drawable to place in the layer drawable, in a position defined by its attributes. +Must be a child of a <code><selector></code> element. Accepts child {@code <bitmap>} +elements. <p class="caps">attributes:</p> <dl class="atn-list"> - <dt><code>name</code></dt> - <dd><em>String</em>. <strong>Required</strong>. - A name for the color. This name will be used as the resource ID.</dd> + <dt><code>android:drawable</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource.</dd> + <dt><code>android:id</code></dt> + <dd><em>Resource ID</em>. A unique resource ID for this drawable. To create a new resource +ID for this item, use the form: +<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new +ID. You can use this identifier to +retrieve and modify the drawable with {@link android.view.View#findViewById(int) +View.findViewById()} or {@link android.app.Activity#findViewById(int) Activity.findViewById()}.</dd> + <dt><code>android:top</code></dt> + <dd><em>Integer</em>. The top offset in pixels.</dd> + <dt><code>android:right</code></dt> + <dd><em>Integer</em>. The right offset in pixels.</dd> + <dt><code>android:bottom</code></dt> + <dd><em>Integer</em>. The bottom offset in pixels.</dd> + <dt><code>android:left</code></dt> + <dd><em>Integer</em>. The left offset in pixels.</dd> </dl> - </dd> </dl> </dd> <!-- end elements and attributes --> <dt>example:</dt> -<dd>XML file saved at <code>res/drawable/colors.xml</code>: + +<dd>XML file saved at <code>res/drawable/transition.xml</code>: <pre> -<?xml version="1.0" encoding="utf-8"?> -<resources> - <drawable name="solid_red">#f00</drawable> - <drawable name="solid_blue">#0000ff</drawable> -</resources> +<?xml version="1.0" encoding="utf-8"?> +<transition xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/on" /> + <item android:drawable="@drawable/off" /> +</layer-list> </pre> - <p>This layout XML will apply a color drawable to a View:</p> + +<p>This layout XML applies the drawable to a View:</p> <pre> -<TextView - android:layout_width="fill_parent" +<ImageButton + android:id="@+id/button" android:layout_height="wrap_content" - <strong>android:background="@drawable/solid_blue"</strong> /> + android:layout_width="wrap_content" + android:src="@drawable/transition" /> </pre> - <p>This application code will get a color drawable and apply it to a View:</p> + +<p>And the following code performs a 500ms transition from the first item to the second:</p> <pre> -Resources res = {@link android.content.Context#getResources()}; -Drawable redDrawable = res.{@link android.content.res.Resources#getDrawable(int) getDrawable}(R.drawable.solid_red); +ImageButton button = (ImageButton) findViewById(R.id.button); +TransitionDrawable drawable = (TransitionDrawable) button.getDrawable(); +drawable.startTransition(500); +</pre> + +</dd> <!-- end example --> -TextView tv = (TextView) findViewByID(R.id.text); -tv.setBackground(redDrawable); +<dt>see also:</dt> + +<dd> +<ul> + <li>{@link android.graphics.drawable.TransitionDrawable}</li> +</ul> +</dd> + +</dl> + + + + + + + + +<h2 id="Inset">Inset Drawable</h2> + +<p>A drawable defined in XML that insets another drawable by a specified distance. This is used when +a View needs a background that is smaller than the View's actual bounds.</p> + +<dl class="xml"> + +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> + +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.InsetDrawable}.</dd> + +<dt>resource reference:</dt> + +<dd> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + +<dt>syntax:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#inset-element">inset</a> + xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/<i>drawable_resource</i>" + android:insetTop="<i>dimension</i>" + android:insetRight="<i>dimension</i>" + android:insetBottom="<i>dimension</i>" + android:insetLeft="<i>dimension</i>" /> </pre> +</dd> + +<dt>elements:</dt> + +<dd> +<dl class="tag-list"> + + <dt id="inset-element"><code><inset></code></dt> + <dd>Defines the inset drawable. This must be the root element. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + <dt><code>android:drawable</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource to be inset.</dd> + <dt><code>android:insetTop</code></dt> + <dd><em>Dimension</em>. The top inset, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a></dd> + <dt><code>android:insetRight</code></dt> + <dd><em>Dimension</em>. The right inset, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a></dd> + <dt><code>android:insetBottom</code></dt> + <dd><em>Dimension</em>. The bottom inset, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a></dd> + <dt><code>android:insetLeft</code></dt> + <dd><em>Dimension</em>. The left inset, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a></dd> + </dl> + </dd> +</dl> + +</dd> + +<dt>example:</dt> + +<dd> +<pre> +<?xml version="1.0" encoding="utf-8"?> +<inset xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/background" + android:insetTop="10dp" + android:insetLeft="10dp" /> +</pre> +</dd> + +<dt>see also:</dt> + +<dd> +<ul> + <li>{@link android.graphics.drawable.InsetDrawable}</li> +</ul> +</dd> + +</dl> + + + + + + + + +<h2 id="Clip">Clip Drawable</h2> + +<p>A drawable defined in XML that clips another drawable based on this Drawable's current level. You +can control how much the child drawable gets clipped in width and height based on the level, as well +as a gravity to control where it is placed in its overall container. Most often used to implement +things like progress bars.</p> + +<dl class="xml"> + +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> + +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.ClipDrawable}.</dd> + +<dt>resource reference:</dt> + +<dd> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + +<dt>syntax:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#clip-element">clip</a> + xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/<i>drawable_resource</i>" + android:clipOrientation=["horizontal" | "vertical"] + android:gravity=["top" | "bottom" | "left" | "right" | "center_vertical" | + "fill_vertical" | "center_horizontal" | "fill_horizontal" | + "center" | "fill" | "clip_vertical" | "clip_horizontal"] /> +</pre> +</dd> + +<dt>elements:</dt> + +<dd> +<dl class="tag-list"> + + <dt id="clip-element"><code><clip></code></dt> + <dd>Defines the clip drawable. This must be the root element. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + <dt><code>android:drawable</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource to be clipped.</dd> + <dt><code>android:clipOrientation</code></dt> + <dd><em>Keyword</em>. The orientation for the clip. + <p>Must be one of the following constant values:</p> +<table> +<tr><th>Value</th><th>Description</th></tr> +<tr><td><code>horizontal</code></td> +<td>Clip the drawable horizontally.</td></tr> +<tr><td><code>vertical</code></td> +<td>Clip the drawable vertically.</td></tr> +</table> + </dd> + <dt><code>android:gravity</code></dt> + <dd><em>Keyword</em>. Specifies where to clip within the drawable. + <p>Must be one or more (separated by '|') of the following constant values:</p> +<table> +<tr><th>Value</th><th>Description</th></tr> +<tr><td><code>top</code></td> +<td>Put the object at the top of its container, not changing its size. When {@code +clipOrientation} is {@code "vertical"}, clipping occurs at the bottom of the drawable.</td></tr> +<tr><td><code>bottom</code></td> +<td>Put the object at the bottom of its container, not changing its size. When {@code +clipOrientation} is {@code "vertical"}, clipping occurs at the top of the drawable.</td></tr> +<tr><td><code>left</code></td> +<td>Put the object at the left edge of its container, not changing its size. This is the +default. When {@code clipOrientation} is {@code "horizontal"}, clipping occurs at the right side of +the drawable. This is the default.</td></tr> +<tr><td><code>right</code></td> +<td>Put the object at the right edge of its container, not changing its size. When {@code +clipOrientation} is {@code "horizontal"}, clipping occurs at the left side of +the drawable.</td></tr> +<tr><td><code>center_vertical</code></td> +<td>Place object in the vertical center of its container, not changing its size. Clipping behaves +the same as when gravity is {@code "center"}.</td></tr> +<tr><td><code>fill_vertical</code></td> +<td>Grow the vertical size of the object if needed so it completely fills its container. When {@code +clipOrientation} is {@code "vertical"}, no clipping occurs because the drawable fills the +vertical space (unless the drawable level is 0, in which case it's not visible).</td></tr> +<tr><td><code>center_horizontal</code></td> +<td>Place object in the horizontal center of its container, not changing its size. +Clipping behaves the same as when gravity is {@code "center"}.</td></tr> +<tr><td><code>fill_horizontal</code></td> +<td>Grow the horizontal size of the object if needed so it completely fills its container. When +{@code clipOrientation} is {@code "horizontal"}, no clipping occurs because the drawable fills the +horizontal space (unless the drawable level is 0, in which case it's not visible). +</td></tr> +<tr><td><code>center</code></td> +<td>Place the object in the center of its container in both the vertical and horizontal axis, not +changing its size. When {@code +clipOrientation} is {@code "horizontal"}, clipping occurs on the left and right. When {@code +clipOrientation} is {@code "vertical"}, clipping occurs on the top and bottom.</td></tr> +<tr><td><code>fill</code></td> +<td>Grow the horizontal and vertical size of the object if needed so it completely fills its +container. No clipping occurs because the drawable fills the +horizontal and vertical space (unless the drawable level is 0, in which case it's not +visible).</td></tr> +<tr><td><code>clip_vertical</code></td> +<td>Additional option that can be set to have the top and/or bottom edges of the child clipped to +its container's bounds. The clip is based on the vertical gravity: a top gravity clips the +bottom edge, a bottom gravity clips the top edge, and neither clips both edges. +</td></tr> +<tr><td><code>clip_horizontal</code></td> +<td>Additional option that can be set to have the left and/or right edges of the child clipped to +its container's bounds. The clip is based on the horizontal gravity: a left gravity clips +the right edge, a right gravity clips the left edge, and neither clips both edges. +</td></tr> +</table></dd> + </dl> + </dd> +</dl> + +</dd> <!-- end elements and attributes --> + +<dt>example:</dt> + +<dd>XML file saved at <code>res/drawable/clip.xml</code>: +<pre> +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/android" + android:clipOrientation="horizontal" + android:gravity="left" /> +</shape> +</pre> + <p>The following layout XML applies the clip drawable to a View:</p> +<pre> +<ImageView + android:id="@+id/image" + android:background="@drawable/clip" + android:layout_height="wrap_content" + android:layout_width="wrap_content" /> +</pre> + + <p>The following code gets the drawable and increases the amount of clipping in order to +progressively reveal the image:</p> +<pre> +ImageView imageview = (ImageView) findViewById(R.id.image); +ClipDrawable drawable = (ClipDrawable) imageview.getDrawable(); +drawable.setLevel(drawable.getLevel() + 1000); +</pre> + +<p>Increasing the level reduces the amount of clipping and slowly reveals the image. Here it is +at a level of 7000:</p> +<img src="{@docRoot}images/resources/clip.png" alt="" /> + +<p class="note"><strong>Note:</strong> The default level is 0, which is fully clipped so the image +is not visible. When the level is 10,000, the image is not clipped and completely visible.</p> </dd> <!-- end example --> <dt>see also:</dt> + <dd> <ul> - <li>{@link android.graphics.drawable.PaintDrawable}</li> + <li>{@link android.graphics.drawable.ClipDrawable}</li> </ul> </dd> @@ -430,10 +1268,139 @@ tv.setBackground(redDrawable); +<h2 id="Scale">Scale Drawable</h2> + +<p>A drawable defined in XML that changes the size of another drawable based on its current +level.</p> + +<dl class="xml"> + +<dt>file location:</dt> +<dd><code>res/drawable/<em>filename</em>.xml</code><br/> +The filename is used as the resource ID.</dd> + +<dt>compiled resource datatype:</dt> +<dd>Resource pointer to a {@link android.graphics.drawable.ScaleDrawable}.</dd> + +<dt>resource reference:</dt> + +<dd> +In Java: <code>R.drawable.<em>filename</em></code><br/> +In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> +</dd> + +<dt>syntax:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#scale-element">scale</a> + xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/<i>drawable_resource</i>" + android:scaleGravity=["top" | "bottom" | "left" | "right" | "center_vertical" | + "fill_vertical" | "center_horizontal" | "fill_horizontal" | + "center" | "fill" | "clip_vertical" | "clip_horizontal"] + android:scaleHeight="<i>percentage</i>" + android:scaleWidth="<i>percentage</i>" /> +</pre> +</dd> + +<dt>elements:</dt> +<dd> +<dl class="tag-list"> + <dt id="scale-element"><code><scale></code></dt> + <dd>Defines the scale drawable. This must be the root element. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. + <dt><code>android:drawable</code></dt> + <dd><em>Drawable resource</em>. <strong>Required</strong>. Reference to a drawable +resource.</dd> + <dt><code>android:scaleGravity</code></dt> + <dd><em>Keyword</em>. Specifies the gravity position after scaling. + <p>Must be one or more (separated by '|') of the following constant values:</p> +<table> +<tr><th>Value</th><th>Description</th></tr> +<tr><td><code>top</code></td> +<td>Put the object at the top of its container, not changing its size.</td></tr> +<tr><td><code>bottom</code></td> +<td>Put the object at the bottom of its container, not changing its size. </td></tr> +<tr><td><code>left</code></td> +<td>Put the object at the left edge of its container, not changing its size. This is the +default.</td></tr> +<tr><td><code>right</code></td> +<td>Put the object at the right edge of its container, not changing its size. </td></tr> +<tr><td><code>center_vertical</code></td> +<td>Place object in the vertical center of its container, not changing its size. </td></tr> +<tr><td><code>fill_vertical</code></td> +<td>Grow the vertical size of the object if needed so it completely fills its container. </td></tr> +<tr><td><code>center_horizontal</code></td> +<td>Place object in the horizontal center of its container, not changing its size. </td></tr> +<tr><td><code>fill_horizontal</code></td> +<td>Grow the horizontal size of the object if needed so it completely fills its container. +</td></tr> +<tr><td><code>center</code></td> +<td>Place the object in the center of its container in both the vertical and horizontal axis, not +changing its size. </td></tr> +<tr><td><code>fill</code></td> +<td>Grow the horizontal and vertical size of the object if needed so it completely fills its +container. </td></tr> +<tr><td><code>clip_vertical</code></td> +<td>Additional option that can be set to have the top and/or bottom edges of the child clipped to +its container's bounds. The clip is based on the vertical gravity: a top gravity clips the +bottom edge, a bottom gravity clips the top edge, and neither clips both edges. +</td></tr> +<tr><td><code>clip_horizontal</code></td> +<td>Additional option that can be set to have the left and/or right edges of the child clipped to +its container's bounds. The clip is based on the horizontal gravity: a left gravity clips +the right edge, a right gravity clips the left edge, and neither clips both edges. +</td></tr> +</table></dd> + <dt><code>android:scaleHeight</code></dt> + <dd><em>Percentage</em>. The scale height, expressed as a percentage of the drawable's +bound. The value's format is XX%. For instance: 100%, 12.5%, etc.</dd> + <dt><code>android:scaleWidth</code></dt> + <dd><em>Percentage</em>. The scale width, expressed as a percentage of the drawable's +bound. The value's format is XX%. For instance: 100%, 12.5%, etc.</dd> + </dl> + </dd> +</dl> -<h2 id="Shape">Shape</h2> +</dd> + +<dt>example:</dt> + +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<scale xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/logo" + android:scaleGravity="center_vertical|center_horizontal" + android:scaleHeight="80%" + android:scaleWidth="80%" /> +</pre> +</dd> + +<dt>see also:</dt> +<dd> +<ul> + <li>{@link android.graphics.drawable.ScaleDrawable}</li> +</ul> +</dd> + +</dl> + + + + + + + +<h2 id="Shape">Shape Drawable</h2> <p>This is a generic shape defined in XML.</p> @@ -441,23 +1408,32 @@ tv.setBackground(redDrawable); <dt>file location:</dt> <dd><code>res/drawable/<em>filename</em>.xml</code><br/> -The filename will be used as the resource ID.</dd> +The filename is used as the resource ID.</dd> <dt>compiled resource datatype:</dt> <dd>Resource pointer to a {@link android.graphics.drawable.ShapeDrawable}.</dd> <dt>resource reference:</dt> + <dd> In Java: <code>R.drawable.<em>filename</em></code><br/> In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> </dd> <dt>syntax:</dt> + <dd> <pre class="stx"> <?xml version="1.0" encoding="utf-8"?> -<<a href="#shape-element">shape</a> xmlns:android="http://schemas.android.com/apk/res/android" +<<a href="#shape-element">shape</a> + xmlns:android="http://schemas.android.com/apk/res/android" android:shape=["rectangle" | "oval" | "line" | "ring"] > + <<a href="#corners-element">corners</a> + android:radius="<em>integer</em>" + android:topLeftRadius="<em>integer</em>" + android:topRightRadius="<em>integer</em>" + android:bottomLeftRadius="<em>integer</em>" + android:bottomRightRadius="<em>integer</em>" /> <<a href="#gradient-element">gradient</a> android:angle="<em>integer</em>" android:centerX="<em>integer</em>" @@ -467,37 +1443,40 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> android:gradientRadius="<em>integer</em>" android:startColor="<em>color</em>" android:type=["linear" | "radial" | "sweep"] - android:usesLevel=["true" | "false"] /> + android:usesLevel=["true" | "false"] /> + <<a href="#padding-element">padding</a> + android:left="<em>integer</em>" + android:top="<em>integer</em>" + android:right="<em>integer</em>" + android:bottom="<em>integer</em>" /> + <<a href="#size-element">size</a> + android:width="<em>integer</em>" + android:color="<em>color</em>" + android:dashWidth="<em>integer</em>" + android:dashGap="<em>integer</em>" /> <<a href="#solid-element">solid</a> - android:color="<em>color</em>" /> + android:color="<em>color</em>" /> <<a href="#stroke-element">stroke</a> android:width="<em>integer</em>" android:color="<em>color</em>" android:dashWidth="<em>integer</em>" - android:dashGap="<em>integer</em>" /> - <<a href="#padding-element">padding</a> - android:left="<em>integer</em>" - android:top="<em>integer</em>" - android:right="<em>integer</em>" - android:bottom="<em>integer</em>" /> - <<a href="#corners-element">corners</a> - android:radius="<em>integer</em>" - android:topLeftRadius="<em>integer</em>" - android:topRightRadius="<em>integer</em>" - android:bottomLeftRadius="<em>integer</em>" - android:bottomRightRadius="<em>integer</em>" /> + android:dashGap="<em>integer</em>" /> </shape> </pre> </dd> <dt>elements:</dt> + <dd> <dl class="tag-list"> <dt id="shape-element"><code><shape></code></dt> - <dd><strong>Required.</strong> This must be the root element. + <dd>The shape drawable. This must be the root element. <p class="caps">attributes:</p> <dl class="atn-list"> + <dt><code>xmlns:android</code></dt> + <dd><em>String</em>. <strong>Required.</strong> Defines the XML namespace, which must be + <code>"http://schemas.android.com/apk/res/android"</code>. <dt><code>android:shape</code></dt> <dd><em>Keyword</em>. Defines the type of shape. Valid values are: <table> @@ -525,7 +1504,7 @@ href="more-resources.html#Dimension">dimension resource</a>.</dd> <dd><em>Float</em>. The radius for the inner part of the ring, expressed as a ratio of the ring's width. For instance, if {@code android:innerRadiusRatio="5"}, then the inner radius equals the ring's width divided by 5. This -value will be overridden by {@code android:innerRadius}. Default value is 9.</dd> +value is overridden by {@code android:innerRadius}. Default value is 9.</dd> <dt><code>android:thickness</code></dt> <dd><em>Dimension</em>. The thickness of the ring, as a dimension value or <a @@ -533,13 +1512,40 @@ href="more-resources.html#Dimension">dimension resource</a>.</dd> <dt><code>android:thicknessRatio</code></dt> <dd><em>Float</em>. The thickness of the ring, expressed as a ratio of the ring's width. For instance, if {@code android:thicknessRatio="2"}, then -the thickness equals the ring's width divided by 2. This value will be overridden by {@code +the thickness equals the ring's width divided by 2. This value is overridden by {@code android:innerRadius}. Default value is 3.</dd> <dt><code>android:useLevel</code></dt> <dd><em>Boolean</em>. "true" if this is used as a {@link android.graphics.drawable.LevelListDrawable}. This should normally be "false" or your shape may not appear.</dd> </dl> + <dt id="corners-element"><code><corners></code></dt> + <dd>Creates rounded corners for the shape. Applies only when the shape is a rectangle. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>android:radius</code></dt> + <dd><em>Dimension</em>. The radius for all corners, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>. This is overridden for each +corner by the following attributes.</dd> + <dt><code>android:topLeftRadius</code></dt> + <dd><em>Dimension</em>. The radius for the top-left corner, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:topRightRadius</code></dt> + <dd><em>Dimension</em>. The radius for the top-right corner, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:bottomLeftRadius</code></dt> + <dd><em>Dimension</em>. The radius for the bottom-left corner, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:bottomRightRadius</code></dt> + <dd><em>Dimension</em>. The radius for the bottom-right corner, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + </dl> + <p class="note"><strong>Note:</strong> Every corner must (initially) be provided a corner +radius greater than 1, or else no corners are rounded. If you want specific corners +to <em>not</em> be rounded, a work-around is to use {@code android:radius} to set a default corner +radius greater than 1, but then override each and every corner with the values you really +want, providing zero ("0dp") where you don't want rounded corners.</p> + </dd> <dt id="gradient-element"><code><gradient></code></dt> <dd>Specifies a gradient color for the shape. <p class="caps">attributes:</p> @@ -582,6 +1588,42 @@ value or <a href="more-resources.html#Color">color resource</a>.</dd> android.graphics.drawable.LevelListDrawable}.</dd> </dl> </dd> + <dt id="padding-element"><code><padding></code></dt> + <dd>Padding to apply to the containing View element (this pads the position of the View +content, not the shape). + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>android:left</code></dt> + <dd><em>Dimension</em>. Left padding, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:top</code></dt> + <dd><em>Dimension</em>. Top padding, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:right</code></dt> + <dd><em>Dimension</em>. Right padding, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:bottom</code></dt> + <dd><em>Dimension</em>. Bottom padding, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + </dl> + </dd> + <dt id="solid-element"><code><size></code></dt> + <dd>The size of the shape. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>android:height</code></dt> + <dd><em>Dimension</em>. The height of the shape, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + <dt><code>android:width</code></dt> + <dd><em>Dimension</em>. The width of the shape, as a dimension value or <a +href="more-resources.html#Dimension">dimension resource</a>.</dd> + </dl> + <p class="note"><strong>Note:</strong> The shape scales to the size of the container +View proportionate to the dimensions defined here, by default. When you use the shape in an {@link +android.widget.ImageView}, you can restrict scaling by setting the <a +href="{@docRoot}reference/android/widget/ImageView.html#attr_android:scaleType">{@code +android:scaleType}</a> to {@code "center"}.</p> + </dd> <dt id="solid-element"><code><solid></code></dt> <dd>A solid color to fill the shape. <p class="caps">attributes:</p> @@ -611,57 +1653,12 @@ href="more-resources.html#Dimension">dimension resource</a>. Only valid if {@cod android:dashGap} is set.</dd> </dl> </dd> - <dt id="padding-element"><code><padding></code></dt> - <dd>Padding to apply to the containing View element (this pads the position of the View -content, not the shape). - <p class="caps">attributes:</p> - <dl class="atn-list"> - <dt><code>android:left</code></dt> - <dd><em>Dimension</em>. Left padding, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - <dt><code>android:top</code></dt> - <dd><em>Dimension</em>. Top padding, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - <dt><code>android:right</code></dt> - <dd><em>Dimension</em>. Right padding, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - <dt><code>android:bottom</code></dt> - <dd><em>Dimension</em>. Bottom padding, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - </dl> - </dd> - <dt id="corners-element"><code><corners></code></dt> - <dd>Creates rounded corners for the shape. Applies only when the shape is a rectangle. - <p class="caps">attributes:</p> - <dl class="atn-list"> - <dt><code>android:radius</code></dt> - <dd><em>Dimension</em>. The radius for all corners, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>. This will be overridden for each -corner by the following attributes.</dd> - <dt><code>android:topLeftRadius</code></dt> - <dd><em>Dimension</em>. The radius for the top-left corner, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - <dt><code>android:topRightRadius</code></dt> - <dd><em>Dimension</em>. The radius for the top-right corner, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - <dt><code>android:bottomLeftRadius</code></dt> - <dd><em>Dimension</em>. The radius for the bottom-left corner, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - <dt><code>android:bottomRightRadius</code></dt> - <dd><em>Dimension</em>. The radius for the bottom-right corner, as a dimension value or <a -href="more-resources.html#Dimension">dimension resource</a>.</dd> - </dl> - <p class="note"><strong>Note:</strong> Every corner must (initially) be provided a corner -radius greater than zero, or else no corners will be rounded. If you want specific corners -to <em>not</em> be rounded, a work-around is to use {@code android:radius} to set a default corner -radius greater than zero, but then override each and every corner with the values you really -want, providing zero ("0dp") where you don't want rounded corners.</p> - </dd> </dl> </dd> <!-- end elements and attributes --> <dt>example:</dt> + <dd>XML file saved at <code>res/drawable/gradient_box.xml</code>: <pre> <?xml version="1.0" encoding="utf-8"?> @@ -678,14 +1675,16 @@ want, providing zero ("0dp") where you don't want rounded corners.</p> <corners android:radius="8dp" /> </shape> </pre> - <p>This layout XML will apply the shape drawable to a View:</p> + + <p>This layout XML applies the shape drawable to a View:</p> <pre> <TextView android:background="@drawable/gradient_box" android:layout_height="wrap_content" android:layout_width="wrap_content" /> </pre> - <p>This application code will get the shape drawable and apply it to a View:</p> + + <p>This application code gets the shape drawable and applies it to a View:</p> <pre> Resources res = {@link android.content.Context#getResources()}; Drawable shape = res. {@link android.content.res.Resources#getDrawable(int) getDrawable}(R.drawable.gradient_box); @@ -695,6 +1694,14 @@ tv.setBackground(shape); </pre> </dd> <!-- end example --> +<dt>see also:</dt> + +<dd> +<ul> + <li>{@link android.graphics.drawable.ShapeDrawable}</li> +</ul> +</dd> + </dl> diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd index 0688a181f11c..111851c0c60e 100644 --- a/docs/html/guide/topics/resources/layout-resource.jd +++ b/docs/html/guide/topics/resources/layout-resource.jd @@ -35,12 +35,12 @@ In XML: <code>@[<em>package</em>:]layout/<em>filename</em></code> <pre class="stx"> <?xml version="1.0" encoding="utf-8"?> <<a href="#viewgroup-element"><em>ViewGroup</em></a> xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/<em>name</em>" + android:id="@[+][<em>package</em>:]id/<em>resource_name</em>" android:layout_height=["<em>dimension</em>" | "fill_parent" | "wrap_content"] android:layout_width=["<em>dimension</em>" | "fill_parent" | "wrap_content"] [<em>ViewGroup-specific attributes</em>] > <<a href="#view-element"><em>View</em></a> - android:id="@+id/<em>name</em>" + android:id="@[+][<em>package</em>:]id/<em>resource_name</em>" android:layout_height=["<em>dimension</em>" | "fill_parent" | "wrap_content"] android:layout_width=["<em>dimension</em>" | "fill_parent" | "wrap_content"] [<em>View-specific attributes</em>] > @@ -49,10 +49,12 @@ In XML: <code>@[<em>package</em>:]layout/<em>filename</em></code> <<a href="#viewgroup-element"><em>ViewGroup</em></a> > <<a href="#view-element"><em>View</em></a> /> </<em>ViewGroup</em>> + <<a href="#include-element">include</a> layout="@layout/<i>layout_resource</i>"/> </<em>ViewGroup</em>> </pre> <p class="note"><strong>Note:</strong> The root element can be either a -{@link android.view.ViewGroup} or a {@link android.view.View}, but there must be only +{@link android.view.ViewGroup}, a {@link android.view.View}, or a <a +href="#merge-element">{@code <merge>}</a> element, but there must be only one root element and it must contain the {@code xmlns:android} attribute with the {@code android} namespace as shown.</p> </dd> @@ -74,10 +76,9 @@ namespace as shown.</p> <p class="caps">attributes:</p> <dl class="atn-list"> <dt><code>android:id</code></dt> - <dd><em>Resource name</em>. A unique resource name for the element, which you can -use to obtain a reference to the {@link android.view.ViewGroup} from your application. - The value takes the form: <code>"@+id/<em>name</em>"</code>. See more about the - <a href="#idvalue">value for {@code android:id}</a> below. + <dd><em>Resource ID</em>. A unique resource name for the element, which you can +use to obtain a reference to the {@link android.view.ViewGroup} from your application. See more +about the <a href="#idvalue">value for {@code android:id}</a> below. </dd> <dt><code>android:layout_height</code></dt> <dd><em>Dimension or keyword</em>. <strong>Required</strong>. The height for the group, as a @@ -107,10 +108,9 @@ attributes</a>).</p> <p class="caps">attributes:</p> <dl class="atn-list"> <dt><code>android:id</code></dt> - <dd><em>Resource name</em>. A unique resource name for the element, which you can use to - obtain a reference to the {@link android.view.View} from your application. - The value takes the form: <code>"@+id/<em>name</em>"</code>. See more about the - <a href="#idvalue">value for {@code android:id}</a> below. + <dd><em>Resource ID</em>. A unique resource name for the element, which you can use to + obtain a reference to the {@link android.view.View} from your application. See more about +the <a href="#idvalue">value for {@code android:id}</a> below. </dd> <dt><code>android:layout_height</code></dt> <dd><em>Dimension or keyword</em>. <strong>Required</strong>. The height for the element, as @@ -137,20 +137,71 @@ or {@code "wrap_content"}). See the <a href="#layoutvalues">valid values</a> bel which gives it's parent initial focus on the screen. You can have only one of these elements per file.</dd> + <dt id="include-element"><code><include></code></dt> + <dd>Includes a layout file into this layout. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>layout</code></dt> + <dd><em>Layout resource</em>. <strong>Required</strong>. Reference to a layout +resource.</dd> + <dt><code>android:id</code></dt> + <dd><em>Resource ID</em>. Overrides the ID given to the root view in the included layout. + </dd> + <dt><code>android:layout_height</code></dt> + <dd><em>Dimension or keyword</em>. Overrides the height given to the root view in the +included layout. + </dd> + <dt><code>android:layout_width</code></dt> + <dd><em>Dimension or keyword</em>. Overrides the width given to the root view in the +included layout. + </dd> + </dl> + <p>You can include any other layout attributes in the <code><include></code> that are +supported by the root element in the included layout and they will override those defined in the +root element.</p> + + <p>Another way to include a layout is to use {@link android.view.ViewStub}. It is a lightweight +View that consumes no layout space until you explicitly inflate it, at which point, it includes a +layout file defined by its {@code android:layout} attribute. For more information about using {@link +android.view.ViewStub}, read <a href="{@docRoot}resources/articles/layout-tricks-stubs.html">Layout +Tricks: ViewStubs</a>.</p> + </dd> + + <dt id="merge-element"><code><merge></code></dt> + <dd>An alternative root element that is not drawn in the layout hierarchy. Using this as the +root element is useful when you know that this layout will be placed into a layout +that already contains the appropriate parent View to contain the children of the +<code><merge></code> element. This is particularly useful when you plan to include this layout +in another layout file using <a href="#include-element"><code><include></code></a> and +this layout doesn't require a different {@link android.view.ViewGroup} container. For more +information about merging layouts, read <a +href="{@docRoot}resources/articles/layout-tricks-merging.html">Layout +Tricks: Merging</a>.</dd> + </dl> + + <h4 id="idvalue">Value for <code>android:id</code></h4> -<p>For the ID value, you should use this syntax form: <code>"@+id/<em>name</em>"</code>. The plus symbol, -{@code +}, indicates that this is a new resource ID and the aapt tool will create -a new resource number to the {@code R.java} class, if it doesn't already exist. For example:</p> +<p>For the ID value, you should usually use this syntax form: <code>"@+id/<em>name</em>"</code>. The +plus symbol, {@code +}, indicates that this is a new resource ID and the <code>aapt</code> tool will +create a new resource integer in the {@code R.java} class, if it doesn't already exist. For +example:</p> <pre> <TextView android:id="@+id/nameTextbox"/> </pre> -<p>You can then refer to it this way in Java:</p> +<p>The <code>nameTextbox</code> name is now a resource ID attached to this element. You can then +refer to the {@link android.widget.TextView} to which the ID is associated in Java:</p> <pre> findViewById(R.id.nameTextbox); </pre> +<p>This code returns the {@link android.widget.TextView} object.</p> + +<p>However, if you have already defined an <a +href="{@docRoot}guide/topics/resources/drawable-resource.html#Id">ID resource</a> (and it is not +already used), then you can apply that ID to a {@link android.view.View} element by excluding the +plus symbol in the <code>android:id</code> value.</p> <h4 id="layoutvalues">Value for <code>android:layout_height</code> and <code>android:layout_width</code>:</h4> diff --git a/docs/html/guide/topics/resources/menu-resource.jd b/docs/html/guide/topics/resources/menu-resource.jd index badc40328a54..cde72bdf37db 100644 --- a/docs/html/guide/topics/resources/menu-resource.jd +++ b/docs/html/guide/topics/resources/menu-resource.jd @@ -35,7 +35,7 @@ In XML: <code>@[<em>package</em>:]menu.<em>filename</em></code> <pre> <?xml version="1.0" encoding="utf-8"?> <<a href="#menu-element">menu</a> xmlns:android="http://schemas.android.com/apk/res/android"> - <<a href="#item-element">item</a> android:id="@+id/<em>id_name</em>" + <<a href="#item-element">item</a> android:id="@[+][<em>package</em>:]id/<em>resource_name</em>" android:menuCategory=["container" | "system" | "secondary" | "alternative"] android:orderInCategory="<em>integer</em>" android:title="<em>string</em>" @@ -46,7 +46,7 @@ In XML: <code>@[<em>package</em>:]menu.<em>filename</em></code> android:checkable=["true" | "false"] android:visible=["visible" | "invisible" | "gone"] android:enabled=["enabled" | "disabled"] /> - <<a href="#group-element">group</a> android:id="<em>resource ID</em>" + <<a href="#group-element">group</a> android:id="@[+][<em>package</em>:]id/<em>resource name</em>" android:menuCategory=["container" | "system" | "secondary" | "alternative"] android:orderInCategory="<em>integer</em>" android:checkableBehavior=["none" | "all" | "single"] @@ -84,8 +84,8 @@ child of a <code><menu></code> element. <p class="caps">attributes:</p> <dl class="atn-list"> <dt><code>android:id</code></dt> - <dd><em>Resource name</em>. A unique resource name. The value takes the form: -<code>"@+id/<em>name</em>"</code>.</dd> + <dd><em>Resource ID</em>. A unique resource ID. To create a new resource ID for this item, use the form: +<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new ID.</dd> <dt><code>android:menuCategory</code></dt> <dd><em>Keyword</em>. Value corresponding to {@link android.view.Menu} {@code CATEGORY_*} constants, which define the group's priority. Valid values: @@ -124,8 +124,8 @@ on the data that is currently displayed.</td></tr> <p class="caps">attributes:</p> <dl class="atn-list"> <dt><code>android:id</code></dt> - <dd><em>Resource name</em>. A unique resource name. The value takes the form: -<code>"@+id/<em>name</em>"</code>.</dd> + <dd><em>Resource ID</em>. A unique resource ID. To create a new resource ID for this item, use the form: +<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new ID.</dd> <dt><code>android:menuCategory</code></dt> <dd><em>Keyword</em>. Value corresponding to {@link android.view.Menu} {@code CATEGORY_*} constants, which define the item's priority. Valid values: diff --git a/docs/html/guide/topics/resources/more-resources.jd b/docs/html/guide/topics/resources/more-resources.jd index 0e2b30bed807..22abbb2c51ed 100644 --- a/docs/html/guide/topics/resources/more-resources.jd +++ b/docs/html/guide/topics/resources/more-resources.jd @@ -12,6 +12,9 @@ parent.link=available-resources.html <dd>XML resource that carries a color value (a hexadecimal color).</dd> <dt><a href="#Dimension">Dimension</a></dt> <dd>XML resource that carries a dimension value (with a unit of measure).</dd> + <dt><a href="#Id">ID</a></dt> + <dd>XML resource that provides a unique identifier for application resources and +components.</dd> <dt><a href="#Integer">Integer</a></dt> <dd>XML resource that carries an integer value.</dd> <dt><a href="#IntegerArray">Integer Array</a></dt> @@ -111,8 +114,8 @@ boolean screenIsSmall = res.{@link android.content.res.Resources#getBoolean(int) <h2 id="Color">Color</h2> <p>A color value defined in XML. -The color is specified with an RGB value and alpha channel. A color resource can be used -any place that expects a hexadecimal color value.</p> +The color is specified with an RGB value and alpha channel. You can use color resource +any place that accepts a hexadecimal color value.</p> <p>The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats:</p> @@ -318,6 +321,118 @@ float fontSize = res.{@link android.content.res.Resources#getDimension(int) getD +<h2 id="Id">ID</h2> + +<p>A unique resource ID defined in XML. Using the name you provide in the {@code <item>} +element, the Android developer tools create a unique integer in your project's {@code +R.java} class, which you can use as an +identifier for an application resources (for example, a {@link android.view.View} in your UI layout) +or a unique integer for use in your application code (for example, as an ID for a dialog or a +result code).</p> + +<p class="note"><strong>Note:</strong> An ID is a simple resource that is referenced +using the value provided in the {@code name} attribute (not the name of the XML file). As +such, you can combine ID resources with other simple resources in the one XML file, +under one {@code <resources>} element. Also, remember that an ID resources does not reference +an actual resource item; it is simply a unique ID that you can attach to other resources or use +as a unique integer in your application.</p> + +<dl class="xml"> + +<dt>file location:</dt> +<dd><code>res/values/<em>filename.xml</em></code><br/> +The filename is arbitrary.</dd> + +<dt>resource reference:</dt> +<dd> +In Java: <code>R.id.<em>name</em></code><br/> +In XML: <code>@[<em>package</em>:]id/<em>name</em></code> +</dd> + +<dt>syntax:</dt> +<dd> +<pre class="stx"> +<?xml version="1.0" encoding="utf-8"?> +<<a href="#id-resources-element">resources</a>> + <<a href="#id-item-element">item</a> + type="id" + name="<em>id_name</em>" /> +</resources> +</pre> +</dd> + +<dt>elements:</dt> +<dd> +<dl class="tag-list"> + + <dt id="integer-resources-element"><code><resources></code></dt> + <dd><strong>Required.</strong> This must be the root node. + <p>No attributes.</p> + </dd> + <dt id="integer-element"><code><integer></code></dt> + <dd>Defines a unique ID. Takes no value, only attributes. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>type</code></dt> + <dd>Must be "id".</dd> + <dt><code>name</code></dt> + <dd><em>String</em>. A unique name for the ID.</dd> + </dl> + </dd> + +</dl> +</dd> <!-- end elements and attributes --> + +<dt>example:</dt> +<dd> + <p>XML file saved at <code>res/values/ids.xml</code>:</p> +<pre> +<?xml version="1.0" encoding="utf-8"?> +<resources> + <item type="id" name="button_ok" /> + <item type="id" name="dialog_exit" /> +</resources> +</pre> + + <p>Then, this layout snippet uses the "button_ok" ID for a Button widget:</p> +<pre> +<Button android:id="<b>@id/button_ok</b>" + style="@style/button_style" /> +</pre> + + <p>Notice that the {@code android:id} value does not include the plus sign in the ID reference, +because the ID already exists, as defined in the {@code ids.xml} example above. (When you specify an +ID to an XML resource using the plus sign—in the format {@code +android:id="@+id/name"}—it means that the "name" ID does not exist and should be created.)</p> + + <p>As another example, the following code snippet uses the "dialog_exit" ID as a unique identifier +for a dialog:</p> +<pre> +{@link android.app.Activity#showDialog(int) showDialog}(<b>R.id.dialog_exit</b>); +</pre> + <p>In the same application, the "dialog_exit" ID is compared when creating a dialog:</p> +<pre> +protected Dialog {@link android.app.Activity#onCreateDialog(int)}(int id) { + Dialog dialog; + switch(id) { + case <b>R.id.dialog_exit</b>: + ... + break; + default: + dialog = null; + } + return dialog; +} +</pre> +</dd> <!-- end example --> + + +</dl> + + + + + <h2 id="Integer">Integer</h2> <p>An integer defined in XML.</p> @@ -347,7 +462,7 @@ In XML: <code>@[<em>package</em>:]integer/<em>integer_name</em></code> <<a href="#integer-resources-element">resources</a>> <<a href="#integer-element">integer</a> name="<em>integer_name</em>" - ><em>integer</em></dimen> + ><em>integer</em></integer> </resources> </pre> </dd> @@ -379,8 +494,8 @@ In XML: <code>@[<em>package</em>:]integer/<em>integer_name</em></code> <pre> <?xml version="1.0" encoding="utf-8"?> <resources> - <integer name="max_speed">75</dimen> - <integer name="min_speed">5</dimen> + <integer name="max_speed">75</integer> + <integer name="min_speed">5</integer> </resources> </pre> <p>This application code retrieves an integer:</p> diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index cac85e835fe0..7e2f8a0cea04 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -761,7 +761,7 @@ Android runs your application, it will crash if you do not provide default resou cannot use the resources named with the new qualifier. For example, if your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> is set to 4, and you qualify all of your drawable resources using <a -href="NightQualifier">night mode</a> ({@code night} or {@code notnight}, which were added in API +href="#NightQualifier">night mode</a> ({@code night} or {@code notnight}, which were added in API Level 8), then an API Level 4 device cannot access your drawable resources and will crash. In this case, you probably want {@code notnight} to be your default resources, so you should exclude that qualifier so your drawable resources are in either {@code drawable/} or {@code drawable-night/}.</p> diff --git a/docs/html/guide/topics/ui/menus.jd b/docs/html/guide/topics/ui/menus.jd index cf3c7decbcfd..b4e467c273f2 100644 --- a/docs/html/guide/topics/ui/menus.jd +++ b/docs/html/guide/topics/ui/menus.jd @@ -5,198 +5,324 @@ parent.link=index.html <div id="qv-wrapper"> <div id="qv"> - <h2>Key classes</h2> - <ol> - <li>{@link android.view.Menu}</li> - <li>{@link android.view.ContextMenu}</li> - <li>{@link android.view.SubMenu}</li> - </ol> <h2>In this document</h2> <ol> - <li><a href="#options-menu">Options Menu</a></li> - <li><a href="#context-menu">Context Menu</a></li> - <li><a href="#submenu">Submenu</a></li> - <li><a href="#xml">Define Menus in XML</a></li> - <li><a href="#features">Menu Features</a> + <li><a href="#xml">Defining Menus</a></li> + <li><a href="#Inflating">Inflating a Menu Resource</a> + <li><a href="#options-menu">Creating an Options Menu</a> + <ol> + <li><a href="#ChangingTheMenu">Changing the menu when it opens</a></li> + </ol> + </li> + <li><a href="#context-menu">Creating a Context Menu</a></li> + <li><a href="#submenu">Creating a Submenu</a></li> + <li><a href="#features">Other Menu Features</a> <ol> <li><a href="#groups">Menu groups</a></li> <li><a href="#checkable">Checkable menu items</a></li> <li><a href="#shortcuts">Shortcut keys</a></li> - <li><a href="#intents">Menu item intents</a></li> + <li><a href="#intents">Intents for menu items</a></li> </ol> </li> </ol> + + <h2>Key classes</h2> + <ol> + <li>{@link android.view.Menu}</li> + <li>{@link android.view.MenuItem}</li> + <li>{@link android.view.ContextMenu}</li> + <li>{@link android.view.SubMenu}</li> + </ol> + + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a></li> + </ol> </div> </div> -<p>Menus are an important part of any application. They provide familiar interfaces -that reveal application functions and settings. Android offers an easy programming interface -for developers to provide standardized application menus for various situations.</p> +<p>Menus are an important part of an application that provide a familiar interface for the user +to access application functions and settings. Android offers an easy programming interface +for you to provide application menus in your application.</p> -<p>Android offers three fundamental types of application menus:</p> +<p>Android provides three types of application menus:</p> <dl> <dt><strong>Options Menu</strong></dt> - <dd>This is the primary set of menu items for an Activity. It is revealed by pressing - the device MENU key. Within the Options Menu are two groups of menu items: + <dd>The primary menu for an Activity, which appears when the user presses + the device MENU key. Within the Options Menu are two groups: <dl style="margin-top:1em"> <dt><em>Icon Menu</em></dt> - <dd>This is the collection of items initially visible at the bottom of the screen + <dd>The menu items visible at the bottom of the screen at the press of the MENU key. It supports a maximum of six menu items. These are the only menu items that support icons and the only menu items that <em>do not</em> support checkboxes or radio buttons.</dd> <dt><em>Expanded Menu</em></dt> - <dd>This is a vertical list of items exposed by the "More" menu item from the Icon Menu. - It exists only when the Icon Menu becomes over-loaded and is comprised of the sixth - Option Menu item and the rest.</dd> + <dd>The vertical list of menu items exposed by the "More" menu item in the Icon Menu. + When the Icon Menu is full, the expanded menu is comprised of the sixth + menu item and the rest.</dd> </dl> </dd> <dt><strong>Context Menu</strong></dt> - <dd>This is a floating list of menu items that may appear when you perform a long-press on a View - (such as a list item). </dd> + <dd>A floating list of menu items that appears when the user performs a long-press on a View. +</dd> <dt><strong>Submenu</strong></dt> - <dd>This is a floating list of menu items that is revealed by an item in the Options Menu - or a Context Menu. A Submenu item cannot support nested Submenus. </dd> + <dd>A floating list of menu items that the user opens by pressing a menu item in the Options +Menu or a context menu. A submenu item cannot support a nested submenu. </dd> </dl> -<h2 id="options-menu">Options Menu</h2> -<img align="right" src="{@docRoot}images/options_menu.png" /> -<p>The Options Menu is opened by pressing the device MENU key. -When opened, the Icon Menu is displayed, which holds the first six menu items. -If more than six items are added to the Options Menu, then those that can't fit -in the Icon Menu are revealed in the Expanded Menu, via the "More" menu item. The Expanded Menu -is automatically added when there are more than six items.</p> -<p>The Options Menu is where you should include basic application functions -and any necessary navigation items (e.g., to a home screen or application settings). -You can also add <a href="#submenu">Submenus</a> for organizing topics -and including extra menu functionality.</p> - -<p>When this menu is opened for the first time, -the Android system will call the Activity <code>{@link android.app.Activity#onCreateOptionsMenu(Menu) -onCreateOptionsMenu()}</code> callback method. Override this method in your Activity -and populate the {@link android.view.Menu} object given to you. You can populate the menu by -inflating a menu resource that was <a href="#xml">defined in XML</a>, or by calling -<code>{@link android.view.Menu#add(CharSequence) add()}</code> -for each item you'd like in the menu. This method adds a {@link android.view.MenuItem}, and returns the -newly created object to you. You can use the returned MenuItem to set additional properties like -an icon, a keyboard shortcut, an intent, and other settings for the item.</p> - -<p>There are multiple <code>{@link android.view.Menu#add(CharSequence) add()}</code> methods. -Usually, you'll want to use one that accepts an <var>itemId</var> argument. -This is a unique integer that allows you to identify the item during a callback.</p> - -<p>When a menu item is selected from the Options Menu, you will receive a callback to the -<code>{@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()}</code> -method of your Activity. This callback passes you the -<code>MenuItem</code> that has been selected. You can identify the item by requesting the -<var>itemId</var>, with <code>{@link android.view.MenuItem#getItemId() getItemId()}</code>, -which returns the integer that was assigned with the <code>add()</code> method. Once you identify -the menu item, you can take the appropriate action.</p> - -<p>Here's an example of this procedure, inside an Activity, wherein we create an -Options Menu and handle item selections:</p> +<h2 id="xml">Defining Menus</h2> + +<p>Instead of instantiating {@link android.view.Menu} objects in your application code, you should +define a menu and all its items in an XML <a +href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>, then inflate the menu +resource (load it as a programmable object) in your application code. Defining your menus in XML is +a good practice because it separates your interface design from your application code (the same as +when you <a href="{@docRoot}guide/topics/ui/declaring-layout.html">define your Activity +layout</a>).</p> + +<p>To define a menu, create an XML file inside your project's <code>res/menu/</code> +directory and build the menu with the following elements:</p> +<dl> + <dt><code><menu></code></dt> + <dd>Creates a {@link android.view.Menu}, which is a container for menu items. It must be +the root node and holds one or more of the following elements. You can also nest this element +in an {@code <item>} to create a submenu.</dd> + <dt><code><item></code></dt> + <dd>Creates a {@link android.view.MenuItem}, which represents a single item in a menu.</dd> + <dt><code><group></code></dt> + <dd>An optional, invisible container for {@code <item>} elements. It allows you to +categorize menu items so they share properties such as active state and visibility. See <a +href="#groups">Menu groups</a>.</dd> +</dl> +<p>For example, here is a file in <code>res/menu/</code> named <code>game_menu.xml</code>:</p> <pre> -/* Creates the menu items */ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/new_game" + android:icon="@drawable/ic_new_game" + android:title="@string/new_game" /> + <item android:id="@+id/quit" + android:icon="@drawable/ic_quit" + android:title="@string/quit" /> +</menu> +</pre> + +<p>This example defines a menu with two menu items. Each item includes the attributes:</p> +<dl> + <dt>{@code android:id}</dt> + <dd>A resource ID that's unique to the item so that the application can recognize the item when +the user selects it.</dd> + <dt>{@code android:icon}</dt> + <dd>A drawable resource that is the icon visible to the user.</dd> + <dt>{@code android:title}</dt> + <dd>A string resource that is the title visible to the user.</dd> +</dl> + +<p>For more about the XML syntax and attributes for a menu resource, see the <a +href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a> reference.</p> + + +<h2 id="Inflating">Inflating a Menu Resource</h2> + +<p>You can inflate your menu resource (convert the XML resource into a programmable object) using +{@link android.view.MenuInflater#inflate(int,Menu) MenuInflater.inflate()}. For +example, the following code inflates the <code>game_menu.xml</code> file defined above during the +{@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} callback method, to be +used for the Options Menu:</p> + +<pre> +@Override public boolean onCreateOptionsMenu(Menu menu) { - menu.add(0, MENU_NEW_GAME, 0, "New Game"); - menu.add(0, MENU_QUIT, 0, "Quit"); + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.game_menu, menu); return true; } +</pre> + +<p>The {@link android.app.Activity#getMenuInflater()} method returns a {@link +android.view.MenuInflater} for the Activity. With this object, you can call {@link +android.view.MenuInflater#inflate(int,Menu) inflate()}, which inflates a menu resource into a +{@link android.view.Menu} object. In this example, the menu resource defined by +<code>game_menu.xml</code> +is inflated into the {@link android.view.Menu} that was passed into {@link +android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()}. (This callback method for +creating an option menu is discussed more in the next section.)</p> + + + +<h2 id="options-menu">Creating an Options Menu</h2> + +<div class="figure" style="width:200px"> + <img src="{@docRoot}images/options_menu.png" height="300" alt="" /> + <p class="img-caption"><strong>Figure 1.</strong> Screenshot of an Options Menu.</p> +</div> + + +<p>The Options Menu is where you should include basic application functions +and necessary navigation items (for example, a button +to open application settings). The user +can open the Options Menu with the device MENU key. +Figure 1 shows a screenshot of an Options Menu.</p> + +<p>When opened, the first visible portion of the Options Menu is called the Icon Menu. It +holds the first six menu items. +If you add more than six items to the Options Menu, Android places the sixth item and those after it +into the Expanded Menu, which the user can open with the "More" menu item.</p> + +<p>When the user opens the Options Menu for the first time, Android calls your Activity's +{@link android.app.Activity#onCreateOptionsMenu(Menu) +onCreateOptionsMenu()} method. Override this method in your Activity +and populate the {@link android.view.Menu} that is passed into the method. Populate the +{@link android.view.Menu} by inflating a menu resource as described in <a +href="#Inflating">Inflating a Menu Resource</a>. (You can +also populate the menu in code, using {@link android.view.Menu#add(int,int,int,int) +add()} to add menu items.)</p> + +<p>When the user selects a menu item from the Options Menu, the system calls your Activity's +{@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} +method. This method passes the +{@link android.view.MenuItem} that the user selected. You can identify the menu item by calling +{@link android.view.MenuItem#getItemId()}, which returns the unique ID for the menu +item (defined by the {@code android:id} attribute in the menu resource or with an integer passed +to the {@link android.view.Menu#add(int,int,int,int) add()} method). You can match this ID +against known menu items and perform the appropriate action.</p> + +<p>For example:</p> -/* Handles item selections */ +<pre> +@Override public boolean onOptionsItemSelected(MenuItem item) { + // Handle item selection switch (item.getItemId()) { - case MENU_NEW_GAME: + case R.id.new_game: newGame(); return true; - case MENU_QUIT: + case R.id.quit: quit(); return true; + default: + return super.onOptionsItemSelected(item); } - return false; } </pre> -<p>The <code>add()</code> method used in this sample takes four arguments: -<var>groupId</var>, <var>itemId</var>, <var>order</var>, and <var>title</var>. -The <var>groupId</var> allows you to associate this menu item with a group of other items -(more about <a href="#groups">Menu groups</a>, below) — in -this example, we ignore it. <var>itemId</var> is a unique integer that we give the -MenuItem so that can identify it in the next callback. <var>order</var> allows us to -define the display order of the item — by default, they are displayed by the -order in which we add them. <var>title</var> is, of course, the name that goes on the -menu item (this can also be a -<a href="{@docRoot}guide/topics/resources/available-resources.html#stringresources">string resource</a>, -and we recommend you do it that way for easier localization).</p> - -<p class="note"><strong>Tip:</strong> -If you have several menu items that can be grouped together with a title, -consider organizing them into a <a href="#submenu">Submenu</a>.</p> - -<h3>Adding icons</h3> -<p>Icons can also be added to items that appears in the Icon Menu with -<code>{@link android.view.MenuItem#setIcon(Drawable) setIcon()}</code>. For example:</p> -<pre> -menu.add(0, MENU_QUIT, 0, "Quit") - .setIcon(R.drawable.menu_quit_icon);</pre> - -<h3>Modifying the menu</h3> -<p>If you want to sometimes re-write the Options Menu as it is opened, override the -<code>{@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()}</code> method, which is -called each time the menu is opened. This will pass you the Menu object, just like the -<code>onCreateOptionsMenu()</code> callback. This is useful if you'd like to add or remove -menu options depending on the current state of an application or game.</p> +<p>In this example, {@link android.view.MenuItem#getItemId()} queries the ID for the selected menu +item and the switch statement compares the ID against the resource IDs that were assigned to menu +items in the XML resource. When a switch case successfully handles the item, it +returns "true" to indicate that the item selection was handled. Otherwise, the default statement +passes the menu item to the super class in +case it can handle the item selected. (If you've directly extended the {@link android.app.Activity} +class, then the super class returns "false", but it's a good practice to +pass unhandled menu items to the super class instead of directly returning "false".)</p> + +<p class="note"><strong>Tip:</strong> If your application contains multiple activities and +some of them provide the same Options Menu, consider creating +an Activity that implements nothing except the {@link android.app.Activity#onCreateOptionsMenu(Menu) +onCreateOptionsMenu()} and {@link android.app.Activity#onOptionsItemSelected(MenuItem) +onOptionsItemSelected()} methods. Then extend this class for each Activity that should share the +same Options Menu. This way, you have to manage only one set of code for handling menu +actions and each decendent class inherits the menu behaviors.<br/><br/> +If you want to add menu items to one of your decendent activities, +override {@link android.app.Activity#onCreateOptionsMenu(Menu) +onCreateOptionsMenu()} in that Activity. Call {@code super.onCreateOptionsMenu(menu)} so the +original menu items are created, then add new menu items with {@link +android.view.Menu#add(int,int,int,int) menu.add()}. You can also override the super class's +behavior for individual menu items.</p> + + +<h3 id="ChangingTheMenu">Changing the menu when it opens</h3> + +<p>The {@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} method is +called only the first time the Options Menu is opened. The system keeps and re-uses the {@link +android.view.Menu} you define in this method until your Activity is destroyed. If you want to change +the Options Menu each time it opens, you must override the +{@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()} method. This passes +you the {@link android.view.Menu} object as it currently exists. This is useful if you'd like to +remove, add, disable, or enable menu items depending on the current state of your application.</p> <p class="note"><strong>Note:</strong> -When changing items in the menu, it's bad practice to do so based on the currently selected item. -Keep in mind that, when in touch mode, there will not be a selected (or focused) item. Instead, you -should use a <a href="#context-menu">Context Menu</a> for such behaviors, when you want to provide -functionality based on a particular item in the UI.</p> - - -<h2 id="context-menu">Context Menu</h2> -<p>The Android context menu is similar, in concept, to the menu revealed with a "right-click" on a PC. -When a view is registered to a context menu, -performing a "long-press" (press and hold for about two seconds) on the object -will reveal a floating menu that provides functions relating to that item. -Context menus can be registered to any View object, -however, they are most often used for items in a -{@link android.widget.ListView}, which helpfully indicates the presence of the context menu -by transforming the background color of the ListView item when pressed. -(The items in the phone's contact list offer an example of this feature.) -</p> - -<p class="note"><strong>Note:</strong> Context menu items do not support icons or shortcut keys.</p> - -<p>To create a context menu, you must override the Activity's context menu callback methods: -<code>{@link android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenuInfo) onCreateContextMenu()}</code> and -<code>{@link android.app.Activity#onContextItemSelected(MenuItem) onContextItemSelected()}</code>. -Inside the <code>onCreateContextMenu()</code> callback method, you can add menu items using one of the -<code>{@link android.view.Menu#add(CharSequence) add()}</code> methods, or by -inflating a menu resource that was <a href="#xml">defined in XML</a>. -Then, register a {@link android.view.ContextMenu} for the View, with -<code>{@link android.app.Activity#registerForContextMenu(View) registerForContextMenu()}</code>.</p> - -<p>For example, here is some code that can be used with the -<a href="{@docRoot}resources/tutorials/notepad/index.html">Notepad application</a> -to add a context menu for each note in the list:</p> +You should never change items in the Options Menu based on the {@link android.view.View} currently +in focus. When in touch mode (when the user is not using a trackball or d-pad), Views +cannot take focus, so you should never use focus as the basis for modifying +items in the Options Menu. If you want to provide menu items that are context-sensitive to a {@link +android.view.View}, use a <a href="#context-menu">Context Menu</a>.</p> + + + +<h2 id="context-menu">Creating a Context Menu</h2> + +<p>A context menu is conceptually similar to the menu displayed when the user performs a +"right-click" on a PC. You should use a context menu to provide the user access to +actions that pertain to a specific item in the user interface. On Android, a context menu is +displayed when the user performs a "long press" (press and hold) on an item.</p> + +<p>You can create a context menu for any View, though context menus are most often used for items in +a {@link android.widget.ListView}. When the user performs a long-press on an item in a ListView and +the list is registered to provide a context menu, the list item signals to the user that a context +menu is available by animating its background color—it transitions from +orange to white before opening the context menu. (The Contacts application demonstrates this +feature.)</p> + +<div class="sidebox-wrapper"> +<div class="sidebox"> +<h3>Register a ListView</h3> +<p>If your Activity uses a {@link android.widget.ListView} and +you want all list items to provide a context menu, register all items for a context +menu by passing the {@link android.widget.ListView} to {@link +android.app.Activity#registerForContextMenu(View) registerForContextMenu()}. For +example, if you're using a {@link android.app.ListActivity}, register all list items like this:</p> +<p><code>registerForContextMenu({@link android.app.ListActivity#getListView()});</code></p> +</div> +</div> + +<p>In order for a View to provide a context menu, you must "register" the view for a context +menu. Call {@link android.app.Activity#registerForContextMenu(View) registerForContextMenu()} and +pass it the {@link android.view.View} you want to give a context menu. When this View then +receives a long-press, it displays a context menu.</p> + +<p>To define the context menu's appearance and behavior, override your Activity's context menu +callback methods, {@link android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenuInfo) +onCreateContextMenu()} and +{@link android.app.Activity#onContextItemSelected(MenuItem) onContextItemSelected()}.</p> + +<p>For example, here's an {@link +android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenuInfo) +onCreateContextMenu()} that uses the {@code context_menu.xml} menu resource:</p> <pre> +@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); - menu.add(0, EDIT_ID, 0, "Edit"); - menu.add(0, DELETE_ID, 0, "Delete"); + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.context_menu, menu); } +</pre> + +<p>{@link android.view.MenuInflater} is used to inflate the context menu from a <a +href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>. (You can also use +{@link android.view.Menu#add(int,int,int,int) add()} to add menu items.) The callback method +parameters include the {@link android.view.View} +that the user selected and a {@link android.view.ContextMenu.ContextMenuInfo} object that provides +additional information about the item selected. You might use these parameters to determine +which context menu should be created, but in this example, all context menus for the Activity are +the same.</p> + +<p>Then when the user selects an item from the context menu, the system calls {@link +android.app.Activity#onContextItemSelected(MenuItem) onContextItemSelected()}. Here is an example +of how you can handle selected items:</p> +<pre> +@Override public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { - case EDIT_ID: + case R.id.edit: editNote(info.id); return true; - case DELETE_ID: + case R.id.delete: deleteNote(info.id); return true; default: @@ -205,285 +331,276 @@ public boolean onContextItemSelected(MenuItem item) { } </pre> -<p>In <code>onCreateContextMenu()</code>, we are given not only the ContextMenu to -which we will add {@link android.view.MenuItem}s, but also the {@link android.view.View} -that was selected and a {@link android.view.ContextMenu.ContextMenuInfo ContextMenuInfo} object, -which provides additional information about the object that was selected. -In this example, nothing special is done in <code>onCreateContextMenu()</code> — just -a couple items are added as usual. In the <code>onContextItemSelected()</code> -callback, we request the {@link android.widget.AdapterView.AdapterContextMenuInfo AdapterContextMenuInfo} -from the {@code MenuItem}, which provides information about the currently selected item. -All we need from -this is the list ID for the selected item, so whether editing a note or deleting it, -we find the ID with the {@code AdapterContextMenuInfo.info} field of the object. This ID -is passed to the <code>editNote()</code> and <code>deleteNote()</code> methods to perform -the respective action.</p> - -<p>Now, to register this context menu for all the items in a {@link android.widget.ListView}, -we pass the entire {@code ListView} to the -<code>{@link android.app.Activity#registerForContextMenu(View)}</code> method:</p> - -<pre>registerForContextMenu(getListView());</pre> -<p>Remember, you can pass any View object to register a context menu. Here, -<code>{@link android.app.ListActivity#getListView()}</code> returns the ListView -object used in the Notepad application's {@link android.app.ListActivity}. As such, each item -in the list is registered to this context menu.</p> - - - -<h2 id="submenu">Submenus</h2> -<p>A sub menu can be added within any menu, except another sub menu. -These are very useful when your application has a lot of functions that may be -organized in topics, like the items in a PC application's menu bar (File, Edit, View, etc.).</p> - -<p>A sub menu is created by adding it to an existing {@link android.view.Menu} -with <code>{@link android.view.Menu#addSubMenu(CharSequence) addSubMenu()}</code>. -This returns a {@link android.view.SubMenu} object (an extension of {@link android.view.Menu}). -You can then add additional items to this menu, with the normal routine, using -the <code>{@link android.view.Menu#add(CharSequence) add()}</code> methods. For example:</p> +<p>The structure of this code is similar to the example for <a href="#options-menu">Creating an +Options Menu</a>, in which {@link android.view.MenuItem#getItemId()} queries the ID for the selected +menu item and a switch statement matches the item to the IDs that are defined in the menu resource. +And like the options menu example, the default statement calls the super class in case it +can handle menu items not handled here, if necessary.</p> -<pre> -public boolean onCreateOptionsMenu(Menu menu) { - boolean result = super.onCreateOptionsMenu(menu); +<p>In this example, the selected item is an item from a {@link android.widget.ListView}. To +perform an action on the selected item, the application needs to know the list +ID for the selected item (it's position in the ListView). To get the ID, the application calls +{@link android.view.MenuItem#getMenuInfo()}, which returns a {@link +android.widget.AdapterView.AdapterContextMenuInfo} object that includes the list ID for the +selected item in the {@link android.widget.AdapterView.AdapterContextMenuInfo#id id} field. The +local methods <code>editNote()</code> and <code>deleteNote()</code> methods accept this list ID to +perform an action on the data specified by the list ID.</p> - SubMenu fileMenu = menu.addSubMenu("File"); - SubMenu editMenu = menu.addSubMenu("Edit"); - fileMenu.add("new"); - fileMenu.add("open"); - fileMenu.add("save"); - editMenu.add("undo"); - editMenu.add("redo"); +<p class="note"><strong>Note:</strong> Items in a context menu do not support icons or shortcut +keys.</p> - return result; -} -</pre> -<p>Callbacks for items selected in a sub menu are made to the parent menu's callback method. -For the example above, selections in the sub menu will be handled by the -<code>onOptionsItemSelected()</code> callback.</p> -<p>You can also add Submenus when you <a href="#xml">define the parent menu in XML</a>.</p> -<h2 id="xml">Define Menus in XML</h2> -<p>Just like Android UI layouts, you can define application menus in XML, then inflate them -in your menu's <code>onCreate...()</code> callback method. This makes your application code cleaner and -separates more interface design into XML, which is easier to visualize.</p> +<h2 id="submenu">Creating Submenus</h2> -<p>To start, create a new folder in your project <code>res/</code> directory called <code>menu</code>. -This is where you should keep all XML files that define your application menus.</p> +<p>A submenu is a menu that the user can open by selecting an item in another menu. You can add a +submenu to any menu (except a submenu). Submenus are useful when your application has a lot of +functions that can be organized into topics, like items in a PC application's menu bar (File, Edit, +View, etc.).</p> -<p>In a menu XML layout, there are -three valid elements: <code><menu></code>, <code><group></code> and <code><item></code>. The -<code>item</code> and <code>group</code> elements must be children of a <code>menu</code>, but <code>item</code> -elements may also be the children of a <code>group</code>, and another <code>menu</code> element may be the child -of an <code>item</code> (to create a Submenu). Of course, the root node of any file -must be a <code>menu</code> element.</p> +<p>When creating your <a href="{@docRoot}guide/topics/resources/menu-resource.html">menu +resource</a>, you can create a submenu by adding a {@code <menu>} element as the child of an +{@code <item>}. For example:</p> -<p>As an example, we'll define the same menu created in the <a href="#options-menu">Options Menu</a> section, -above. We start with an XML file named <code>options_menu.xml</code> inside the <code>res/menu/</code> folder:</p> <pre> -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@+id/new_game" - android:title="New Game" /> - <item android:id="@+id/quit" - android:title="Quit" /> -</menu> +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/file" + android:icon="@drawable/file" + android:title="@string/file" > + <!-- "file" submenu --> + <menu"> + <item android:id="@+id/new" + android:title="@string/new" /> + <item android:id="@+id/open" + android:title="@string/open" /> + </menu> + </item> +</menu> </pre> -<p>Then, in the <code>onCreateOptionsMenu()</code> method, we inflate this resource using -<code>{@link android.view.MenuInflater#inflate(int,Menu) MenuInflater.inflate()}</code>:</p> -<pre> -public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.options_menu, menu); - return true; -} -</pre> +<p>When the user selects an item from a submenu, the parent menu's respective on-item-selected +callback method receives the event. For instance, if the above menu is applied as an Options Menu, +then the {@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} method +is called when a submenu item is selected.</p> -<p>The <code>{@link android.app.Activity#getMenuInflater()}</code> method returns the {@link android.view.MenuInflater} -for our activity's context. We then call <code>{@link android.view.MenuInflater#inflate(int,Menu) inflate()}</code>, -passing it a pointer to our menu resource and the Menu object given by the callback.</code></p> +<p>You can also use {@link android.view.Menu#addSubMenu(int,int,int,int) addSubMenu()} to +dynamically add a {@link android.view.SubMenu} to an existing {@link android.view.Menu}. This +returns the new {@link android.view.SubMenu} object, to which you can add +submenu items, using {@link android.view.Menu#add(int,int,int,int) add()}</p> -<p>While this small sample may seem like more effort, compared to creating the menu items in the -<code>onCreateOptionsMenu()</code> method, this will save a lot of trouble when dealing with more items -and it keeps your application code clean.</p> -<p>You can define <a href="#groups">menu groups</a> by wrapping <code>item</code> elements in a <code>group</code> -element, and create Submenus by nesting another <code>menu</code> inside an <code>item</code>. -Each element also supports all the necessary attributes to control features like shortcut keys, -checkboxes, icons, and more. To learn about these attributes and more about the XML syntax, see the Menus -topic in the <a href="{@docRoot}guide/topics/resources/available-resources.html#menus">Available -Resource Types</a> document.</p> -<h2 id="features">Menu Features</h2> -<p>Here are some other features that can be applied to most menu items.</p> +<h2 id="features">Other Menu Features</h2> + +<p>Here are some other features that you can apply to most menu items.</p> <h3 id="groups">Menu groups</h3> -<p>When adding new items to a menu, you can optionally include each item in a group. -A menu group is a collection of menu items that can share certain traits, like -whether they are visible, enabled, or checkable.</p> - -<p>A group is defined by an integer (or a resource id, in XML). A menu item is added to the group when it is -added to the menu, using one of the <code>add()</code> methods that accepts a <var>groupId</var> -as an argument, such as <code>{@link android.view.Menu#add(int,int,int,int)}</code>.</p> - -<p>You can show or hide the entire group with -<code>{@link android.view.Menu#setGroupVisible(int,boolean) setGroupVisible()}</code>; -enable or disable the group with -<code>{@link android.view.Menu#setGroupEnabled(int,boolean) setGroupEnabled()}</code>; -and set whether the items can be checkable with -<code>{@link android.view.Menu#setGroupCheckable(int,boolean,boolean) setGroupCheckable()}</code>. -</p> + +<p>A menu group is a collection of menu items that share certain traits. With a group, you +can:</p> +<ul> + <li>Show or hide all items with {@link android.view.Menu#setGroupVisible(int,boolean) +setGroupVisible()}</li> + <li>Enable or disable all items with {@link android.view.Menu#setGroupEnabled(int,boolean) +setGroupEnabled()}</li> + <li>Specify whether all items are checkable with {@link +android.view.Menu#setGroupCheckable(int,boolean,boolean) setGroupCheckable()}</li> +</ul> + +<p>You can create a group by nesting {@code <item>} elements inside a {@code <group>} +element in your menu resource or by specifying a group ID with the the {@link +android.view.Menu#add(int,int,int,int) add()} method.</p> + +<p>Here's an example menu resource that includes a group:</p> + +<pre> +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/item1" + android:icon="@drawable/item1" + android:title="@string/item1" /> + <!-- menu group --> + <group android:id="@+id/group1"> + <item android:id="@+id/groupItem1" + android:title="@string/groupItem1" /> + <item android:id="@+id/groupItem2" + android:title="@string/groupItem2" /> + </group> +</menu> +</pre> + +<p>The items that are in the group appear the same as the first item that is not in a +group—all three items in the menu are siblings. However, you can modify the traits of the two +items in the group by referencing the group ID and using the methods listed above.</p> + <h3 id="checkable">Checkable menu items</h3> -<img align="right" src="{@docRoot}images/radio_buttons.png" alt="" /> -<p>Any menu item can be used as an interface for turning options on and off. This can -be indicated with a checkbox for stand-alone options, or radio buttons for groups of -mutually exclusive options (see the screenshot, to the right).</p> -<p class="note"><strong>Note:</strong> Menu items in the Icon Menu cannot +<div class="figure" style="width:200px"> + <img src="{@docRoot}images/radio_buttons.png" height="300" alt="" /> + <p class="img-caption"><strong>Figure 2.</strong> Screenshot of checkable menu items</p> +</div> + +<p>A menu can be useful as an interface for turning options on and off, using a checkbox for +stand-alone options, or radio buttons for groups of +mutually exclusive options. Figure 2 shows a submenu with items that are checkable with radio +buttons.</p> + +<p class="note"><strong>Note:</strong> Menu items in the Icon Menu (from the Options Menu) cannot display a checkbox or radio button. If you choose to make items in the Icon Menu checkable, -then you must personally indicate the state by swapping the icon and/or text -each time the state changes between on and off.</p> +you must manually indicate the checked state by swapping the icon and/or text +each time the state changes.</p> + +<p>You can define the checkable behavior for individual menu items using the {@code +android:checkable} attribute in the {@code <item>} element, or for an entire group with +the {@code android:checkableBehavior} attribute in the {@code <group>} element. For +example, all items in this menu group are checkable with a radio button:</p> -<p>To make a single item checkable, use the <code>{@link android.view.MenuItem#setCheckable(boolean) -setCheckable()}</code> method, like so:</p> <pre> -menu.add(0, VIBRATE_SETTING_ID, 0, "Vibrate") - .setCheckable(true); +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <group android:checkableBehavior="single"> + <item android:id="@+id/red" + android:title="@string/red" /> + <item android:id="@+id/blue" + android:title="@string/blue" /> + </group> +</menu> </pre> -<p>This will display a checkbox with the menu item (unless it's in the Icon Menu). When the item -is selected, the <code>onOptionsItemSelected()</code> callback is called as usual. It is here that -you must set the state of the checkbox. You can query the current state of the item with -<code>{@link android.view.MenuItem#isChecked()}</code> and set the checked state with -<code>{@link android.view.MenuItem#setChecked(boolean) setChecked()}</code>. -Here's what this looks like inside the -<code>onOptionsItemSelected()</code> callback:</p> + +<p>The {@code android:checkableBehavior} attribute accepts either: +<dl> + <dt>{@code single}</dt> + <dd>Only one item from the group can be checked (radio buttons)</dd> + <dt>{@code all}</dt> + <dd>All items can be checked (checkboxes)</dd> + <dt>{@code none}</dt> + <dd>No items are checkable</dd> +</dl> + +<p>You can apply a default checked state to an item using the {@code android:checked} attribute in +the {@code <item>} element and change it in code with the {@link +android.view.MenuItem#setChecked(boolean) setChecked()} method.</p> + +<p>When a checkable item is selected, the system calls your respective item-selected callback method +(such as {@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()}). It +is here that you must set the state of the checkbox, because a checkbox or radio button does not +change its state automatically. You can query the current state of the item (as it was before the +user selected it) with {@link android.view.MenuItem#isChecked()} and then set the checked state with +{@link android.view.MenuItem#setChecked(boolean) setChecked()}. For example:</p> + <pre> -switch (item.getItemId()) { -case VIBRATE_SETTING_ID: - if (item.isChecked()) item.setChecked(false); - else item.setChecked(true); - return true; -... +@Override +public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.vibrate: + case R.id.dont_vibrate: + if (item.isChecked()) item.setChecked(false); + else item.setChecked(true); + return true; + default: + return super.onOptionsItemSelected(item); + } } </pre> -<p>To make a group of mutually exclusive radio button items, simply -assign the same group ID to each menu item -and call <code>{@link android.view.Menu#setGroupCheckable(int,boolean,boolean) -setGroupCheckable()}</code>. In this case, you don't need to call <code>setCheckable()</code> -on each menu items, because the group as a whole is set checkable. Here's an example of -two mutually exclusive options in a Submenu:</p> -<pre> -SubMenu subMenu = menu.addSubMenu("Color"); -subMenu.add(COLOR_MENU_GROUP, COLOR_RED_ID, 0, "Red"); -subMenu.add(COLOR_MENU_GROUP, COLOR_BLUE_ID, 0, "Blue"); -subMenu.setGroupCheckable(COLOR_MENU_GROUP, true, true); -</pre> -<p>In the <code>setGroupCheckable()</code> method, the first argument is the group ID -that we want to set checkable. The second argument is whether we want the group items -to be checkable. The last one is whether we want each item to be exclusively checkable -(if we set this <em>false</em>, then all the items will be checkboxes instead of radio buttons). -When the group is set to be exclusive (radio buttons), each time a new item is selected, -all other are automatically de-selected.</p> -<p> +<p>If you don't set the checked state this way, then the visible state of the item (the checkbox or +radio button) will not +change when the user selects it. When you do set the state, the Activity preserves the checked state +of the item so that when the user opens the menu later, the checked state that you +set is visible.</p> <p class="note"><strong>Note:</strong> -Checkable menu items are intended to be used only on a per-session basis and not saved to the device -(e.g., the <em>Map mode</em> setting in the Maps application is not saved — screenshot above). -If there are application settings that you would like to save for the user, -then you should store the data using <a href="#{@docRoot}guide/topics/data/data-storage.html#pref">Preferences</a>, -and manage them with a {@link android.preference.PreferenceActivity}.</p> +Checkable menu items are intended to be used only on a per-session basis and not saved after the +application is destroyed. If you have application settings that you would like to save for the user, +you should store the data using <a +href="#{@docRoot}guide/topics/data/data-storage.html#pref">Shared Preferences</a>.</p> <h3 id="shortcuts">Shortcut keys</h3> -<p>Quick access shortcut keys using letters and/or numbers can be added to menu items with -<code>setAlphabeticShortcut(char)</code> (to set char shortcut), <code>setNumericShortcut(int)</code> -(to set numeric shortcut), -or <code>setShortcut(char,int)</code> (to set both)</code>. Case is <em>not</em> sensitive. -For example:</p> -<pre> -menu.add(0, MENU_QUIT, 0, "Quit") - .setAlphabeticShortcut('q'); -</pre> -<p>Now, when the menu is open (or while holding the MENU key), pressing the "q" key will -select this item.</p> -<p>This shortcut key will be displayed as a tip in the menu item, below the menu item name -(except for items in the Icon Menu).</p> -<p class="note"><strong>Note:</strong> Shortcuts cannot be added to items in a Context Menu.</p> - - -<h3 id="intents">Menu item intents</h3> -<p>If you've read the <a href="{@docRoot}guide/topics/fundamentals.html">Application -Fundamentals</a>, then you're at least a little familiar -with Android Intents. These allow applications to bind with each other, share information, -and perform user tasks cooperatively. Just like your application might fire an Intent to launch a web browser, -an email client, or another Activity in your application, -you can perform such actions from within a menu. -There are two ways to do this: define an Intent and assign it to a single menu item, or -define an Intent and allow Android to search the device for activities and dynamically add a -menu item for each one that meets the Intent criteria.</p> - -<p>For more information on creating Intents and providing your application's services to other applications, -read the <a href="/guide/topics/intents/intents-filters.html">Intents -and Intent Filters</a> document.</p> - -<h4>Set an intent for a single menu item</h4> -<p>If you want to offer a specific menu item that launches a new Activity, then you -can specifically define an Intent for the menu item with the -<code>{@link android.view.MenuItem#setIntent(Intent) -setIntent()}</code> method.</p> - -<p>For example, inside the <code>{@link android.app.Activity#onCreateOptionsMenu(Menu) -onCreateOptionsMenu()}</code> method, you can define a new menu item with an Intent like this:</p> -<pre> -MenuItem menuItem = menu.add(0, PHOTO_PICKER_ID, 0, "Select Photo"); -menuItem.setIntent(new Intent(this, PhotoPicker.class)); -</pre> -<p>Android will automatically launch the Activity when the item is selected.</p> - -<p class="note"><strong>Note:</strong> This will not return a result to your Activity. -If you wish to be returned a result, then do not use <code>setIntent()</code>. -Instead, handle the selection as usual in the <code>onOptionsMenuItemSelected()</code> -or <code>onContextMenuItemSelected()</code> callback and call -<code>{@link android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()}</code>. -</p> - -<h4>Dynamically add intents</h4> - -<p>If there are potentially multiple activities that are relevant to your current -Activity or selected item, then the application can dynamically add menu items that execute other -services.</p> -<p>During menu creation, define an Intent with the category <var>Intent.ALTERNATIVE_CATEGORY</var> and/or -<var>Intent.SELECTED_ALTERNATIVE</var>, the MIME type currently selected (if any), and any other -requirements, the same way as you would satisfy an intent filter to open a new -Activity. Then call -<code>{@link android.view.Menu#addIntentOptions(int,int,int,ComponentName,Intent[],Intent,int,MenuItem[]) -addIntentOptions()}</code> to have Android search for any services meeting those requirements -and add them to the menu for you. If there are no applications installed -that satisfy the Intent, then no additional menu items are added.</p> +<p>You can add quick-access shortcut keys using letters and/or numbers to menu items with the +{@code android:alphabeticShortcut} and {@code android:numericShortcut} attributes in the {@code +<item>} element. You can also use the methods {@link +android.view.MenuItem#setAlphabeticShortcut(char)} and {@link +android.view.MenuItem#setNumericShortcut(char)}. Shortcut keys are <em>not</em> +case sensitive.</p> + +<p>For example, if you apply the "s" character as an alphabetic shortcut to a "save" menu item, then +when the menu is open (or while the user holds the MENU key) and the user presses the "s" key, +the "save" menu item is selected.</p> + +<p>This shortcut key is displayed as a tip in the menu item, below the menu item name +(except for items in the Icon Menu, which are displayed only if the user holds the MENU +key).</p> + +<p class="note"><strong>Note:</strong> Shortcut keys for menu items only work on devices with a +hardware keyboard. Shortcuts cannot be added to items in a Context Menu.</p> + + +<h3 id="intents">Intents for menu items</h3> + +<p>Sometimes you'll want a menu item to launch an Activity using an Intent (whether it's an +Actvitity in your application or another application). When you know the Intent you want to use and +have a specific menu item that should initiate the Intent, you can execute the Intent with {@link +android.app.Activity#startActivity(Intent) startActivity()} during the appropriate on-item-selected +callback method (such as the {@link android.app.Activity#onOptionsItemSelected(MenuItem) +onOptionsItemSelected()} callback).</p> + +<p>However, if you are not certain that the user's device +contains an application that handles the Intent, then adding a menu item that executes the +Intent can result in a non-functioning menu item, because the Intent might not resolve to an +Activity that accepts it. To solve this, Android lets you dynamically add menu items to your menu +when Android finds activities on the device that handle your Intent.</p> + +<p>If you're not familiar with creating Intents, read the <a +href="/guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>.</p> + + +<h4>Dynamically adding Intents</h4> + +<p>When you don't know if the user's device has an application that handles a specific Intent, +you can define the Intent and let Android search the device for activities that accept the Intent. +When it finds activies that handle the Intent, it adds a menu item for +each one to your menu and attaches the appropriate Intent to open the Activity when the user +selects it.</p> + +<p>To add menu items based on available activities that accept an Intent:</p> +<ol> + <li>Define an +Intent with the category {@link android.content.Intent#CATEGORY_ALTERNATIVE} and/or +{@link android.content.Intent#CATEGORY_SELECTED_ALTERNATIVE}, plus any other requirements.</li> + <li>Call {@link +android.view.Menu#addIntentOptions(int,int,int,ComponentName,Intent[],Intent,int,MenuItem[]) +Menu.addIntentOptions()}. Android then searches for any applications that can perform the Intent +and adds them to your menu.</li> +</ol> + +<p>If there are no applications installed +that satisfy the Intent, then no menu items are added.</p> <p class="note"><strong>Note:</strong> -<var>SELECTED_ALTERNATIVE</var> is used to handle the currently selected element on the -screen. So, it should only be used when creating a Menu in <code>onCreateContextMenu()</code> or -<code>onPrepareOptionsMenu()</code>, which is called every time the Options Menu is opened.</p> +{@link android.content.Intent#CATEGORY_SELECTED_ALTERNATIVE} is used to handle the currently +selected element on the screen. So, it should only be used when creating a Menu in {@link +android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenuInfo) +onCreateContextMenu()}.</p> -<p>Here's an example demonstrating how an application would search for -additional services to display on its menu.</p> +<p>For example:</p> <pre> +@Override public boolean onCreateOptionsMenu(Menu menu){ super.onCreateOptionsMenu(menu); // Create an Intent that describes the requirements to fulfill, to be included - // in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE. - Intent intent = new Intent(null, getIntent().getData()); + // in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE. + Intent intent = new Intent(null, dataUri); intent.addCategory(Intent.CATEGORY_ALTERNATIVE); - - // Search for, and populate the menu with, acceptable offering applications. + + // Search and populate the menu with acceptable offering applications. menu.addIntentOptions( - thisClass.INTENT_OPTIONS, // Menu group + R.id.intent_group, // Menu group to which new items will be added 0, // Unique item ID (none) 0, // Order for the items (none) this.getComponentName(), // The current Activity name @@ -495,17 +612,27 @@ public boolean onCreateOptionsMenu(Menu menu){ return true; }</pre> -<p>For each Activity found that provides an Intent Filter matching the Intent defined, a menu -item will be added, using the <var>android:label</var> value of the intent filter as the text -for the menu item. -The <code>{@link android.view.Menu#addIntentOptions(int,int,int,ComponentName,Intent[],Intent,int,MenuItem[]) addIntentOptions()}</code> method will also return the number of menu items added.</p> -<p>Also be aware that, when <code>addIntentOptions()</code> is called, it will override any and all -menu items in the menu group specified in the first argument.</p> - -<p>If you wish to offer the services of your Activity to other application menus, then you -only need to define an intent filter as usual. Just be sure to include the <var>ALTERNATIVE</var> and/or -<var>SELECTED_ALTERNATIVE</var> values in the <var>name</var> attribute of -a <code><category></code> element in the intent filter. For example:</p> +<p>For each Activity found that provides an Intent filter matching the Intent defined, a menu +item is added, using the value in the Intent filter's <code>android:label</code> as the +menu item title and the application icon as the menu item icon. The +{@link android.view.Menu#addIntentOptions(int,int,int,ComponentName,Intent[],Intent,int,MenuItem[]) +addIntentOptions()} method returns the number of menu items added.</p> + +<p class="note"><strong>Note:</strong> When you call {@link +android.view.Menu#addIntentOptions(int,int,int,ComponentName,Intent[],Intent,int,MenuItem[]) +addIntentOptions()}, it overrides any and all menu items by the menu group specified in the first +argument.</p> + + +<h4>Allowing your Activity to be added to menus</h4> + +<p>You can also offer the services of your Activity to other applications, so your +application can be included in the menu of others (reverse the roles described above).</p> + +<p>To be included in other application menus, you need to define an Intent +filter as usual, but be sure to include the {@link android.content.Intent#CATEGORY_ALTERNATIVE} +and/or {@link android.content.Intent#CATEGORY_SELECTED_ALTERNATIVE} values for the Intent filter +category. For example:</p> <pre> <intent-filter label="Resize Image"> ... @@ -514,9 +641,10 @@ a <code><category></code> element in the intent filter. For example:</p> ... </intent-filter> </pre> -<p>read more about writing intent filters in the + +<p>Read more about writing Intent filters in the <a href="/guide/topics/intents/intents-filters.html">Intents and Intent Filters</a> document.</p> <p>For a sample application using this technique, see the -<a href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> -sample code.</p> +<a href="{@docRoot}resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html">Note +Pad</a> sample code.</p> diff --git a/docs/html/images/developing/avd-dialog.png b/docs/html/images/developing/avd-dialog.png Binary files differnew file mode 100755 index 000000000000..693aa421855d --- /dev/null +++ b/docs/html/images/developing/avd-dialog.png diff --git a/docs/html/images/resources/clip.png b/docs/html/images/resources/clip.png Binary files differnew file mode 100644 index 000000000000..9196b3f53913 --- /dev/null +++ b/docs/html/images/resources/clip.png diff --git a/docs/html/images/resources/layers.png b/docs/html/images/resources/layers.png Binary files differnew file mode 100644 index 000000000000..f7e69295759a --- /dev/null +++ b/docs/html/images/resources/layers.png diff --git a/docs/html/license.jd b/docs/html/license.jd index 88932b60b5fc..83cd4709102a 100644 --- a/docs/html/license.jd +++ b/docs/html/license.jd @@ -74,7 +74,7 @@ slide decks that are not covered.</li> <li>The use of sample source code provided in the SDK or shown in this documentation is subject to the conditions detailed in the <a -href="{@docRoot}sdk/terms.html">SDK Terms and Conditions</a>.</li> +href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 license</a>.</li> </ul> </h3> diff --git a/docs/html/resources/dashboard/platform-versions.jd b/docs/html/resources/dashboard/platform-versions.jd index 5e751057e17d..d4b6db5f90dc 100644 --- a/docs/html/resources/dashboard/platform-versions.jd +++ b/docs/html/resources/dashboard/platform-versions.jd @@ -43,29 +43,73 @@ the development of your application features for the devices currently in the hands of users. For information about how to target your application to devices based on platform version, see <a href="{@docRoot}guide/appendix/api-levels.html">API Levels</a>.</p> -<p class="note"><strong>Note:</strong> This data is based on the number -of Android devices that have accessed Android Market within a 14-day period -ending on the data collection date noted below.</p> + +<h3 id="Current">Current Distribution</h3> + +<p>The following pie chart and table is based on the number of Android devices that have accessed +Android Market within a 14-day period ending on the data collection date noted below.</p> <div class="dashboard-panel"> -<img alt="" width="460" height="250" -src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.1,24.6,25.0,0.1,0.3,50.0&chl= -Android%201.1|Android%201.5|Android%201.6|Android%202.0|Android%202.0.1|Android%202.1&chco=c4df9b, -6fad0c" /> +<img alt="" height="250" width="460" +src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.3,18.9,22.1,55.5,3.3&chl=Other*| +Android%201.5|Android%201.6|Android%202.1|Android%202.2&chco=c4df9b,6fad0c" /> <table> <tr> - <th>Android Platform</th> - <th>Percent of Devices</th> + <th>Platform</th> + <th>API Level</th> + <th>Distribution</th> </tr> -<tr><td>Android 1.1</td><td>0.1%</td></tr> -<tr><td>Android 1.5</td><td>24.6%</td></tr> -<tr><td>Android 1.6</td><td>25.0%</td></tr> -<tr><td>Android 2.0</td><td>0.1%</td></tr> -<tr><td>Android 2.0.1</td><td>0.3%</td></tr> -<tr><td>Android 2.1</td><td>50.0%</td></tr> +<tr><td>Android 1.5</td><td>3</td><td>18.9%</td></tr> +<tr><td>Android 1.6</td><td>4</td><td>22.1%</td></tr> +<tr><td>Android 2.1</td><td>7</td><td>55.5%</td></tr> +<tr><td>Android 2.2</td><td>8</td><td>3.3%</td></tr> </table> -<p><em>Data collected during two weeks ending on June 16, 2010</em></p> -</div> + +<p><em>Data collected during two weeks ending on July 15, 2010</em></p> +<p style="font-size:.9em">* <em>Other: 0.3% of devices running obsolete versions</em></p> + +</div><!-- end dashboard-panel --> + + +<h3 id="Historical">Historical Distribution</h3> + +<p>The following stacked line graph provides a history of the relative number of +active Android devices running different versions of the Android platform. It also provides a +valuable perspective of how many devices your application is compatible with, based on the +platform version.</p> + +<p>Notice that the platform versions are stacked on top of each other with the oldest active +version at the top. This format indicates the total percent of active devices that are compatible +with a given version of Android. For example, if you develop your application for +the version that is at the very top of the chart, then your application is +compatible with 100% of active devices (and all future versions), because all Android APIs are +forward compatible. Or, if you develop your application for a version lower on the chart, +then it is currently compatible with the percentage of devices indicated on the y-axis, where the +line for that version meets the y-axis on the right.</p> + +<p>Each dataset in the timeline is based on the number of Android devices that accessed +Android Market within a 14-day period ending on the date indicated on the x-axis.</p> + +<div class="dashboard-panel"> + +<img alt="" height="265" width="700" style="padding:5px;background:#fff" +src="http://chart.apis.google.com/chart?&cht=lc&chs=700x265&chxt=x,y,r&chxr=0,0,10%7C1,0,100%7C2,0, +100&chxl=0%3A%7C2010/02/01%7C02/15%7C03/01%7C03/15%7C04/01%7C04/15%7C05/01%7C05/15%7C06/01%7C06/15% +7C2010/07/01%7C1%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25% +7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10&chxtc=0,5&chd=t:99.0,99.2,99.4,99.5,99.6,99.6,99.6,99.7,100.6 +,101.1,99.9%7C63.4,62.5,61.6,60.6,61.5,61.7,62.3,63.5,73.0,76.4,78.6%7C22.6,23.2,24.3,25.4,29.4,30.2 +,32.7,35.3,46.2,51.3,55.1%7C0.0,0.0,0.0,0.0,4.0,28.3,32.0,34.9,45.9,51.0,54.9%7C0.0,0.0,0.0,0.0,0.0, +0.0,0.0,0.0,0.8,1.2,1.8&chm=tAndroid%201.5,7caa36,0,0,15,,t::-5%7Cb,c3df9b,0,1,0%7CtAndroid%201.6, +638d23,1,0,15,,t::-5%7Cb,b0db6e,1,2,0%7CtAndroid%202.0.1,496c13,2,0,15,,t::-5%7Cb,9ddb3d,2,3,0% +7CtAndroid%202.1,2f4708,3,5,15,,t::-5%7Cb,89cf19,3,4,0%7CB,6fad0c,4,5,0&chg=9,25&chdl=Android%201.5% +20(API%20Level%203)%7CAndroid%201.6%20(API%20Level%204)%7CAndroid%202.0.1%20(API%20Level%206)% +7CAndroid%202.1%20(API%20Level%207)%7CAndroid%202.2%20(API%20Level %208)&chco=add274, +9ad145,84c323,6ba213,507d08" /> + +<p><em>Last historical dataset collected during two weeks ending on July 1, 2010</em></p> + + +</div><!-- end dashboard-panel --> diff --git a/docs/html/resources/dashboard/screens.jd b/docs/html/resources/dashboard/screens.jd index f8130ea50e9d..b20b17dfc81a 100644 --- a/docs/html/resources/dashboard/screens.jd +++ b/docs/html/resources/dashboard/screens.jd @@ -49,7 +49,7 @@ ending on the data collection date noted below.</p> <div class="dashboard-panel"> <img alt="" width="460" height="250" -src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:1.1,57.8,41.0&chl=Small%20/%20ldpi| +src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:1.8,51.5,46.6&chl=Small%20/%20ldpi| Normal%20/%20mdpi|Normal%20/%20hdpi&chco=c4df9b,6fad0c" /> <table> @@ -60,22 +60,22 @@ Normal%20/%20mdpi|Normal%20/%20hdpi&chco=c4df9b,6fad0c" /> <th scope="col">High Density</th> </tr> <tr><th scope="row">Small</th> -<td class='cent hi'>1.1%</td> +<td class='cent hi'>1.8%</td> <td></td> <td></td> </tr> <tr><th scope="row">Normal</th> <td></td> -<td class='cent hi'>57.8%</td> -<td class='cent hi'>41.0%</td> +<td class='cent hi'>51.5%</td> +<td class='cent hi'>46.6%</td> </tr> <tr><th scope="row">Large</th> <td></td> <td></td> <td></td> -</tr> +</tr> </table> -<p><em>Data collected during two weeks ending on June 16, 2010</em></p> +<p><em>Data collected during two weeks ending on July 15, 2010</em></p> </div> diff --git a/docs/html/sdk/android-1.5.jd b/docs/html/sdk/android-1.5.jd index 1d6e0add1fe1..0c16b606d498 100644 --- a/docs/html/sdk/android-1.5.jd +++ b/docs/html/sdk/android-1.5.jd @@ -139,7 +139,7 @@ function toggleDiv(link) { <div class="toggleable closed"> <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> Android 1.5, Revision 3</a> <em>(July 2009)</em></a> <div class="toggleme"> <dl> diff --git a/docs/html/sdk/android-1.6.jd b/docs/html/sdk/android-1.6.jd index c2651b6a7e53..c4e08ff68e74 100644 --- a/docs/html/sdk/android-1.6.jd +++ b/docs/html/sdk/android-1.6.jd @@ -138,7 +138,7 @@ function toggleDiv(link) { <div class="toggleable closed"> <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> Android 1.6, Revision 2</a> <em>(December 2009)</em></a> <div class="toggleme"> <dl> diff --git a/docs/html/sdk/android-2.1.jd b/docs/html/sdk/android-2.1.jd index 7490bae89173..cd48a72c5e8b 100644 --- a/docs/html/sdk/android-2.1.jd +++ b/docs/html/sdk/android-2.1.jd @@ -139,7 +139,7 @@ function toggleDiv(link) { <div class="toggleable closed"> <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> Android 2.1, Revision 1</a> <em>(January 2010)</em></a> <div class="toggleme"> <dl> diff --git a/docs/html/sdk/android-2.2.jd b/docs/html/sdk/android-2.2.jd index f82edf943297..baae92ea1650 100644 --- a/docs/html/sdk/android-2.2.jd +++ b/docs/html/sdk/android-2.2.jd @@ -2,7 +2,6 @@ page.title=Android 2.2 Platform sdk.platform.version=2.2 sdk.platform.apiLevel=8 sdk.platform.majorMinor=minor -sdk.platform.deployableDate=May 2010 @jd:body @@ -118,6 +117,30 @@ function toggleDiv(link) { <div class="toggleable opened"> <a href="#" onclick="return toggleDiv(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> + Android {@sdkPlatformVersion}, Revision 2</a> <em>(July 2010)</em></a> + <div class="toggleme"> +<dl> +<dt>Dependencies:</dt> +<dd> +<p>Requires SDK Tools r6 or higher.</p> +</dd> + +<dt>System Image:</dt> +<dd> +<ul> +<li>Adds default Search Widget.</li> +<li>Includes proper provisioning for the platform's Backup Manager. For more information about how to use the Backup Manager, see <a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>.</li> +<li>Updates the Android 2.2 system image to FRF91.</li> +</ul> +</dd> + +</dl> + </div> +</div> + +<div class="toggleable closed"> + <a href="#" onclick="return toggleDiv(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2010)</em></a> <div class="toggleme"> <dl> @@ -135,7 +158,6 @@ function toggleDiv(link) { </div> </div> - <h2 id="api-level">API Level</h2> <p>The Android {@sdkPlatformVersion} platform delivers an updated version of diff --git a/docs/html/sdk/download.jd b/docs/html/sdk/download.jd index 029de21a9ab6..81b4ff63cb1f 100644 --- a/docs/html/sdk/download.jd +++ b/docs/html/sdk/download.jd @@ -1,80 +1,4 @@ -page.title=Download the Android SDK -hide_license_footer=true +sdk.redirect=true @jd:body -<script type="text/javascript"> - function verify() { - document.getElementById('download-button').disabled = !document.getElementById('checkbox').checked; - } - function submit() { - var location = window.location.href; - if (location.indexOf('?v=') != -1) { - var filename = location.substring(location.indexOf('=')+1,location.length); - if (document.getElementById('checkbox').checked) { - document.location = "http://dl.google.com/android/" + filename; - } - document.getElementById('click-download').setAttribute("href", "http://dl.google.com/android/" + filename); - $("#terms-form").hide(500); - $("#next-steps").show(500); - document.getElementById('checkbox').disabled=true; - document.getElementById('download-button').disabled=true; - } else { - alert("You have not selected an SDK version. Please return to the Download page"); - } - } -</script> - -<div id="terms-form"> - <p>Please carefully review the Android SDK License Agreement before downloading the SDK. -The License Agreement constitutes a contract between you and Google with respect to your use of the SDK.</p> - - <iframe id="terms" style="border:1px solid #888;margin:0 0 1em;height:400px;width:95%;" src="terms_body.html"> - </iframe> - - <p> - <input type="checkbox" id="checkbox" onclick="verify()" /> - <label for="checkbox">I agree to the terms of the Android SDK License Agreement.</label> - </p> - <p> - <input type="submit" value="Download" id="download-button" disabled="disabled" onclick="submit()" /> - </p> - <p> - <script language="javascript"> - var loc = window.location.href; - if (loc.indexOf('?v=') != -1) { - var filename = loc.substring(loc.indexOf('=')+1,loc.length); - document.write("File: " + filename); - } - </script> - </p> -</div><!-- end terms-form --> - -<noscript> - <p><strong>Please enable Javascript in your browser in order to agree to the terms and download the SDK.</strong></p> -</noscript> - -<div class="special" id="next-steps" style="display:none"> - <h2>Thank you for downloading the Android SDK!</h2> - <p>Your download should be underway. If not, <a id="click-download">click here to start the download</a>.</p> - <p>To set up your Android development environment, please read the guide to - <a href="installing.html">Installing the Android SDK</a> and ensure that your development - machine meets the system requirements linked on that page.</p> -</div> - -<script type="text/javascript"> - var loc = window.location.href; - var filename = loc.substring(loc.indexOf('=')+1,loc.length); - version = filename.substring(filename.indexOf('.')-1,filename.lastIndexOf('.')); - $(".addVersionPath").each(function(i) { - var oldHref = $(this).attr("href"); - $(this).attr({href: "/sdk/" + version + "/" + oldHref}); - }); -</script> - - - - - - - diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd index f5558ab831a6..bd7eeeda2401 100644 --- a/docs/html/sdk/eclipse-adt.jd +++ b/docs/html/sdk/eclipse-adt.jd @@ -48,6 +48,9 @@ href="#installing">Installing the ADT Plugin</a>, below. </p> how to update ADT to the latest version or how to uninstall it, if necessary. </p> +<p class="caution"><strong>Caution:</strong> There are known issues with the ADT plugin running with +Eclipse 3.6. Please stay on 3.5 until further notice.</p> + <h2 id="notes">Revisions</h2> <p>The sections below provide notes about successive releases of @@ -295,7 +298,7 @@ location: <p>Additionally, before you can configure or use ADT, you must install the Android SDK starter package, as described in <a -href="installing.html#Installing">Downloading the SDK Starter Pacskage</a>. +href="installing.html#Installing">Downloading the SDK Starter Package</a>. Specifically, you need to install a compatible version of the Android SDK Tools and at least one development platform. To simplify ADT setup, we recommend installing the Android SDK prior to installing ADT. </p> diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd index 69cc73d6f9c2..9e88d944601d 100644 --- a/docs/html/sdk/ndk/index.jd +++ b/docs/html/sdk/ndk/index.jd @@ -1,16 +1,16 @@ ndk=true -ndk.win_download=android-ndk-r4-windows.zip -ndk.win_bytes=45778965 -ndk.win_checksum=1eded98a7f5cd5e71f8ac74565f73f11 +ndk.win_download=android-ndk-r4b-windows.zip +ndk.win_bytes=45792835 +ndk.win_checksum=e397145e155a639be53ee4b6db8ad511 -ndk.mac_download=android-ndk-r4-darwin-x86.zip -ndk.mac_bytes=50572163 -ndk.mac_checksum=b7d5f149fecf951c05a79b045f00419f +ndk.mac_download=android-ndk-r4b-darwin-x86.zip +ndk.mac_bytes=50586041 +ndk.mac_checksum=41dbd54335fb828ee408eab17103a1b0 -ndk.linux_download=android-ndk-r4-linux-x86.zip -ndk.linux_bytes=49450682 -ndk.linux_checksum=0892b0637d45d145e045cc68e163dee3 +ndk.linux_download=android-ndk-r4b-linux-x86.zip +ndk.linux_bytes=49464776 +ndk.linux_checksum=2deabcb125c219b34140975b710f00ec page.title=Android NDK @jd:body @@ -62,8 +62,15 @@ padding: .25em 1em; <div class="toggleable open"> <a href="#" onclick="return toggleDiv(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> -Android NDK, Revision 4</a> <em>(May 2010)</em> +Android NDK, Revision 4b</a> <em>(June 2010)</em> <div class="toggleme"> +<dl> +<dt>NDK r4b notes:</dt> +<dd><p>Includes fixes for several issues in the NDK build and debugging scripts +— if you are using NDK r4, we recommend downloading the NDK r4b build. For +detailed information the changes in this release, read the CHANGES.TXT document +included in the downloaded NDK package.</p></dd> +</dl> <dl> <dt>General notes:</dt> @@ -114,7 +121,7 @@ code.</li> <div class="toggleable closed"> <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> Android NDK, Revision 3</a> <em>(March 2010)</em> <div class="toggleme"> diff --git a/docs/html/sdk/older_releases.jd b/docs/html/sdk/older_releases.jd index c3ba49566e70..77f7e43783b6 100644 --- a/docs/html/sdk/older_releases.jd +++ b/docs/html/sdk/older_releases.jd @@ -47,7 +47,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.6_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.6_r1.zip">android-sdk- windows-1 .6_r1.zip</a> </td> <td>260529085 bytes</td> @@ -57,7 +57,7 @@ windows-1 .6_r1.zip</a> <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.6_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.6_r1.zip">android-sdk- mac_x86-1 .6_r1.zip</a> </td> <td>247412515 bytes</td> @@ -67,7 +67,7 @@ mac_x86-1 .6_r1.zip</a> <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.6_r1.tgz">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.6_r1.tgz">android- sdk- linux_x86-1.6_r1.tgz</a> </td> <td>238224860 bytes</td> @@ -92,7 +92,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.5_r3.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.5_r3.zip">android-sdk- windows-1 .5_r3.zip</a> </td> <td>191477853 bytes</td> @@ -102,7 +102,7 @@ windows-1 .5_r3.zip</a> <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.5_r3.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.5_r3.zip">android-sdk- mac_x86-1 .5_r3.zip</a> </td> <td>183024673 bytes</td> @@ -112,7 +112,7 @@ mac_x86-1 .5_r3.zip</a> <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.5_r3.zip">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.5_r3.zip">android- sdk- linux_x86-1.5_r3.zip</a> </td> <td>178117561 bytes</td> @@ -137,7 +137,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.1_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.1_r1.zip">android-sdk- windows-1 .1_r1.zip</a> </td> @@ -148,7 +148,7 @@ windows-1 <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.1_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.1_r1.zip">android-sdk- mac_x86-1 .1_r1.zip</a> </td> @@ -159,7 +159,7 @@ mac_x86-1 <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.1_r1.zip">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.1_r1.zip">android- sdk- linux_x86-1.1_r1.zip</a> </td> @@ -185,7 +185,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.0_r2.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.0_r2.zip">android-sdk- windows-1 .0_r2.zip</a> </td> @@ -196,7 +196,7 @@ windows-1 <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.0_r2.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.0_r2.zip">android-sdk- mac_x86-1 .0_r2.zip</a> </td> @@ -207,7 +207,7 @@ mac_x86-1 <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.0_r2.zip">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.0_r2.zip">android- sdk- linux_x86-1.0_r2.zip</a> </td> @@ -241,7 +241,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.5_r2.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.5_r2.zip">android-sdk- windows-1 .5_r2.zip</a> </td> <td>178346828 bytes</td> @@ -251,7 +251,7 @@ windows-1 .5_r2.zip</a> <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.5_r2.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.5_r2.zip">android-sdk- mac_x86-1 .5_r2.zip</a> </td> <td>169945128 bytes</td> @@ -261,7 +261,7 @@ mac_x86-1 .5_r2.zip</a> <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.5_r2.zip">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.5_r2.zip">android- sdk- linux_x86-1.5_r2.zip</a> </td> <td>165035130 bytes</td> @@ -286,7 +286,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.5_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.5_r1.zip">android-sdk- windows-1 .5_r1.zip</a> </td> <td>176263368 bytes</td> @@ -296,7 +296,7 @@ windows-1 .5_r1.zip</a> <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.5_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.5_r1.zip">android-sdk- mac_x86-1 .5_r1.zip</a> </td> <td>167848675 bytes</td> @@ -306,7 +306,7 @@ mac_x86-1 .5_r1.zip</a> <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.5_r1.zip">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.5_r1.zip">android- sdk- linux_x86-1.5_r1.zip</a> </td> <td>162938845 bytes</td> @@ -331,7 +331,7 @@ Notes</a></em></p> <td>Windows</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-windows-1.0_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-windows-1.0_r1.zip">android-sdk- windows-1 .0_r1.zip</a> </td> <td>89.7 MB bytes</td> @@ -341,7 +341,7 @@ windows-1 .0_r1.zip</a> <td>Mac OS X (intel)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-mac_x86-1.0_r1.zip">android-sdk- +href="http://dl.google.com/android/archives/android-sdk-mac_x86-1.0_r1.zip">android-sdk- mac_x86-1 .0_r1.zip</a> </td> <td>87.5 MB bytes</td> @@ -351,7 +351,7 @@ mac_x86-1 .0_r1.zip</a> <td>Linux (i386)</td> <td> <a -href="/sdk/download.html?v=archives/android-sdk-linux_x86-1.0_r1.zip">android- +href="http://dl.google.com/android/archives/android-sdk-linux_x86-1.0_r1.zip">android- sdk- linux_x86-1.0_r1.zip</a> </td> <td>87.8 MB bytes</td> diff --git a/docs/html/sdk/requirements.jd b/docs/html/sdk/requirements.jd index cb9cdf3ff136..d710b8ec7ff0 100644 --- a/docs/html/sdk/requirements.jd +++ b/docs/html/sdk/requirements.jd @@ -23,6 +23,9 @@ installation notes</a>.</li> <h4 style="margin-top:.25em"><em>Eclipse IDE</em></h4> <ul> <li>Eclipse 3.4 (Ganymede) or 3.5 (Galileo) + <p class="caution"><strong>Caution:</strong> There are known issues with the ADT plugin +running with Eclipse 3.6. Please stay on 3.5 until further notice.</p> + </li> <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included in most Eclipse IDE packages) </li> <li>If you need to install or update Eclipse, you can download it from <a diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs index 7438707a436b..404e93817ed2 100644 --- a/docs/html/sdk/sdk_toc.cs +++ b/docs/html/sdk/sdk_toc.cs @@ -75,7 +75,8 @@ </li> </ul> <ul> - <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r6</a> <span class="new">new!</span></li> + <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r6</a> + </li> <li><a href="<?cs var:toroot ?>sdk/win-usb.html">USB Driver for Windows, r3</a> </li> @@ -101,7 +102,6 @@ <span style="display:none" class="ja"></span> <span style="display:none" class="zh-CN"></span> <span style="display:none" class="zh-TW"></span></a> - <span class="new">new!</span> </li> </ul> </li> @@ -116,7 +116,7 @@ <span style="display:none" class="zh-TW"></span> </h2> <ul> - <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r4</a> + <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r4b</a> <span class="new">new!</span></li> </ul> </li> @@ -133,7 +133,6 @@ </h2> <ul> <li><a href="<?cs var:toroot ?>sdk/requirements.html">SDK System Requirements</a></li> - <li><a href="<?cs var:toroot ?>sdk/terms.html">SDK Terms and Conditions</a></li> <!-- <li><a href="<?cs var:toroot ?>sdk/RELEASENOTES.html">SDK Release Notes</a></li> --> <li><a href="<?cs var:toroot ?>sdk/older_releases.html">SDK diff --git a/docs/html/sdk/terms_body.html b/docs/html/sdk/terms_body.html deleted file mode 100644 index 03e09066d98c..000000000000 --- a/docs/html/sdk/terms_body.html +++ /dev/null @@ -1,204 +0,0 @@ - -<p>This is the Android Software Development Kit License Agreement.</p> - -<h2> - 1. Introduction -</h2> -<p> - 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. - -</p> -<p> - 1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. -</p> -<h2> - 2. Accepting this License Agreement -</h2> -<p> - 2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement. -</p> -<p> - 2.2 You can accept this License Agreement by: -</p> -<p> - (A) clicking to accept or agree to this License Agreement, where this option is made available to you; or -</p> -<p> - (B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards. -</p> -<p> - 2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK. -</p> -<p> - 2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity. -</p> -<h2> - 3. SDK License from Google -</h2> -<p> - 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform. -</p> -<p> - 3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -</p> -<p> - 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK. -</p> -<p> - 3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. -</p> -<p> - 3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. -</p> -<p> - 3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. -</p> -<p> - 3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK. -</p> -<h2> - 4. Use of the SDK by You -</h2> -<p> - 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. -</p> -<p> - 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). -</p> -<p> - 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. -</p> -<p> - 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. -</p> -<p> - 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. -</p> -<p> - 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. -</p> -<h2> - 5. Your Developer Credentials -</h2> -<p> - 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. -</p> -<h2> - 6. Privacy and Information -</h2> -<p> - 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. -</p> -<p> - 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy. -</p> -<h2> - 7. Third Party Applications for the Android Platform -</h2> -<p> - 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. -</p> -<p> - 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. -</p> -<p> - 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. -</p> -<h2> - 8. Using Android APIs -</h2> -<p> - 8.1 Google Data APIs -</p> -<p> - 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. -</p> -<p> - 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. - -</p> -<h2> - 9. Terminating this License Agreement -</h2> -<p> - 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. -</p> -<p> - 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. -</p> -<p> - 9.3 Google may at any time, terminate this License Agreement with you if: -</p> -<p> - (A) you have breached any provision of this License Agreement; or -</p> -<p> - (B) Google is required to do so by law; or -</p> -<p> - (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or -</p> -<p> - (D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. -</p> -<p> - 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. -</p> -<h2> - 10. DISCLAIMER OF WARRANTIES -</h2> -<p> - 10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. -</p> -<p> - 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. -</p> -<p> - 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -</p> -<h2> - 11. LIMITATION OF LIABILITY -</h2> -<p> - 11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. -</p> -<h2> - 12. Indemnification -</h2> -<p> - 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. -</p> -<h2> - 13. Changes to the License Agreement -</h2> -<p> - 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available. -</p> -<h2> - 14. General Legal Terms -</h2> -<p> - 14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK. -</p> -<p> - 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. -</p> -<p> - 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. -</p> -<p> - 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. -</p> -<p> - 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. -</p> -<p> - 14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. -</p> -<p> - 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. -</p> -<p> - <em>April 10, 2009</em> -</p> diff --git a/docs/html/sitemap.txt b/docs/html/sitemap.txt index b0ec7c99686b..d5be8f1e1e33 100644 --- a/docs/html/sitemap.txt +++ b/docs/html/sitemap.txt @@ -7,7 +7,6 @@ http://developer.android.com/resources/index.html http://developer.android.com/videos/index.html http://developer.android.com/resources/dashboard/platform-versions.html http://developer.android.com/license.html -http://developer.android.com/sdk/terms.html http://developer.android.com/resources/community-groups.html http://developer.android.com/resources/community-more.html http://developer.android.com/resources/articles/index.html diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java index fdc4c92e178d..e275ba8941dd 100644 --- a/graphics/java/android/graphics/drawable/AnimationDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java @@ -64,6 +64,8 @@ import android.util.AttributeSet; * // Start the animation (looped playback by default). * frameAnimation.start() * </pre> + * <p>For more information, see the guide to <a + * href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a>.</p> * * @attr ref android.R.styleable#AnimationDrawable_visible * @attr ref android.R.styleable#AnimationDrawable_variablePadding diff --git a/graphics/java/android/graphics/drawable/BitmapDrawable.java b/graphics/java/android/graphics/drawable/BitmapDrawable.java index 29e14d2b2ebe..32111e83cfc1 100644 --- a/graphics/java/android/graphics/drawable/BitmapDrawable.java +++ b/graphics/java/android/graphics/drawable/BitmapDrawable.java @@ -40,7 +40,9 @@ import java.io.IOException; * A Drawable that wraps a bitmap and can be tiled, stretched, or aligned. You can create a * BitmapDrawable from a file path, an input stream, through XML inflation, or from * a {@link android.graphics.Bitmap} object. - * <p>It can be defined in an XML file with the <code><bitmap></code> element.</p> + * <p>It can be defined in an XML file with the <code><bitmap></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * <p> * Also see the {@link android.graphics.Bitmap} class, which handles the management and * transformation of raw bitmap graphics, and should be used when drawing to a diff --git a/graphics/java/android/graphics/drawable/ClipDrawable.java b/graphics/java/android/graphics/drawable/ClipDrawable.java index c387a9ba7d5f..a772871554ba 100644 --- a/graphics/java/android/graphics/drawable/ClipDrawable.java +++ b/graphics/java/android/graphics/drawable/ClipDrawable.java @@ -32,9 +32,14 @@ import java.io.IOException; * level value. You can control how much the child Drawable gets clipped in width * and height based on the level, as well as a gravity to control where it is * placed in its overall container. Most often used to implement things like - * progress bars. + * progress bars, by increasing the drawable's level with {@link + * android.graphics.drawable.Drawable#setLevel(int) setLevel()}. + * <p class="note"><strong>Note:</strong> The drawable is clipped completely and not visible when + * the level is 0 and fully revealed when the level is 10,000.</p> * - * <p>It can be defined in an XML file with the <code><clip></code> element.</p> + * <p>It can be defined in an XML file with the <code><clip></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * * @attr ref android.R.styleable#ClipDrawable_clipOrientation * @attr ref android.R.styleable#ClipDrawable_gravity diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index 6a7b2d1ae922..31253215f908 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -93,8 +93,8 @@ import android.util.TypedValue; * whose overall size is modified based on the current level. * </ul> * <p>For information and examples of creating drawable resources (XML or bitmap files that - * can be loaded in code), see <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources - * and Internationalization</a>. + * can be loaded in code), see <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>. */ public abstract class Drawable { private static final Rect ZERO_BOUNDS_RECT = new Rect(); @@ -709,8 +709,7 @@ public abstract class Drawable { /** * Create a drawable from an XML document. For more information on how to * create resources in XML, see - * <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources and - * Internationalization</a>. + * <a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>. */ public static Drawable createFromXml(Resources r, XmlPullParser parser) throws XmlPullParserException, IOException { diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 63d14463cdc7..33ecbea910ed 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -42,7 +42,9 @@ import java.io.IOException; /** * A Drawable with a color gradient for buttons, backgrounds, etc. * - * <p>It can be defined in an XML file with the <code><shape></code> element.</p> + * <p>It can be defined in an XML file with the <code><shape></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * * @attr ref android.R.styleable#GradientDrawable_visible * @attr ref android.R.styleable#GradientDrawable_shape diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java index 4fa9d44f1332..a9c983e1548d 100644 --- a/graphics/java/android/graphics/drawable/InsetDrawable.java +++ b/graphics/java/android/graphics/drawable/InsetDrawable.java @@ -32,7 +32,9 @@ import java.io.IOException; * This is used when a View needs a background that is smaller than * the View's actual bounds. * - * <p>It can be defined in an XML file with the <code><inset></code> element.</p> + * <p>It can be defined in an XML file with the <code><inset></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * * @attr ref android.R.styleable#InsetDrawable_visible * @attr ref android.R.styleable#InsetDrawable_drawable diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index 389fd4075b22..8047dd4cb08c 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java @@ -32,8 +32,9 @@ import java.io.IOException; * order, so the element with the largest index will be drawn on top. * <p> * It can be defined in an XML file with the <code><layer-list></code> element. - * Each Drawable in the layer is defined in a nested <code><item></code>. - * </p> + * Each Drawable in the layer is defined in a nested <code><item></code>. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * * @attr ref android.R.styleable#LayerDrawableItem_left * @attr ref android.R.styleable#LayerDrawableItem_top diff --git a/graphics/java/android/graphics/drawable/LevelListDrawable.java b/graphics/java/android/graphics/drawable/LevelListDrawable.java index ae8f224c80df..21be9838ee6e 100644 --- a/graphics/java/android/graphics/drawable/LevelListDrawable.java +++ b/graphics/java/android/graphics/drawable/LevelListDrawable.java @@ -47,7 +47,10 @@ import android.util.AttributeSet; * <p>With this XML saved into the res/drawable/ folder of the project, it can be referenced as * the drawable for an {@link android.widget.ImageView}. The default image is the first in the list. * It can then be changed to one of the other levels with - * {@link android.widget.ImageView#setImageLevel(int)}.</p> + * {@link android.widget.ImageView#setImageLevel(int)}. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> + * * @attr ref android.R.styleable#LevelListDrawableItem_minLevel * @attr ref android.R.styleable#LevelListDrawableItem_maxLevel * @attr ref android.R.styleable#LevelListDrawableItem_drawable diff --git a/graphics/java/android/graphics/drawable/RotateDrawable.java b/graphics/java/android/graphics/drawable/RotateDrawable.java index 2083e051bc03..9c47dabaefc1 100644 --- a/graphics/java/android/graphics/drawable/RotateDrawable.java +++ b/graphics/java/android/graphics/drawable/RotateDrawable.java @@ -35,7 +35,9 @@ import java.io.IOException; * value. The start and end angles of rotation can be controlled to map any * circular arc to the level values range.</p> * - * <p>It can be defined in an XML file with the <code><rotate></code> element.</p> + * <p>It can be defined in an XML file with the <code><rotate></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a>.</p> * * @attr ref android.R.styleable#RotateDrawable_visible * @attr ref android.R.styleable#RotateDrawable_fromDegrees diff --git a/graphics/java/android/graphics/drawable/ScaleDrawable.java b/graphics/java/android/graphics/drawable/ScaleDrawable.java index 275e36f4730f..b623d8002590 100644 --- a/graphics/java/android/graphics/drawable/ScaleDrawable.java +++ b/graphics/java/android/graphics/drawable/ScaleDrawable.java @@ -34,7 +34,9 @@ import java.io.IOException; * placed in its overall container. Most often used to implement things like * progress bars. * - * <p>It can be defined in an XML file with the <code><scale></code> element.</p> + * <p>It can be defined in an XML file with the <code><scale></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * * @attr ref android.R.styleable#ScaleDrawable_scaleWidth * @attr ref android.R.styleable#ScaleDrawable_scaleHeight diff --git a/graphics/java/android/graphics/drawable/ShapeDrawable.java b/graphics/java/android/graphics/drawable/ShapeDrawable.java index c699a82f0ccd..be1892e1839b 100644 --- a/graphics/java/android/graphics/drawable/ShapeDrawable.java +++ b/graphics/java/android/graphics/drawable/ShapeDrawable.java @@ -34,6 +34,10 @@ import java.io.IOException; * the ShapeDrawable will default to a * {@link android.graphics.drawable.shapes.RectShape}. * + * <p>It can be defined in an XML file with the <code><shape></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> + * * @attr ref android.R.styleable#ShapeDrawablePadding_left * @attr ref android.R.styleable#ShapeDrawablePadding_top * @attr ref android.R.styleable#ShapeDrawablePadding_right diff --git a/graphics/java/android/graphics/drawable/StateListDrawable.java b/graphics/java/android/graphics/drawable/StateListDrawable.java index b94df84fc42f..239be409ffc1 100644 --- a/graphics/java/android/graphics/drawable/StateListDrawable.java +++ b/graphics/java/android/graphics/drawable/StateListDrawable.java @@ -31,7 +31,9 @@ import android.util.StateSet; * ID value. * <p/> * <p>It can be defined in an XML file with the <code><selector></code> element. - * Each state Drawable is defined in a nested <code><item></code> element.</p> + * Each state Drawable is defined in a nested <code><item></code> element. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> * * @attr ref android.R.styleable#StateListDrawable_visible * @attr ref android.R.styleable#StateListDrawable_variablePadding diff --git a/graphics/java/android/graphics/drawable/TransitionDrawable.java b/graphics/java/android/graphics/drawable/TransitionDrawable.java index 97b45d8edae9..4470356adf36 100644 --- a/graphics/java/android/graphics/drawable/TransitionDrawable.java +++ b/graphics/java/android/graphics/drawable/TransitionDrawable.java @@ -26,8 +26,10 @@ import android.os.SystemClock; * display just the first layer, call {@link #resetTransition()}. * <p> * It can be defined in an XML file with the <code><transition></code> element. - * Each Drawable in the transition is defined in a nested <code><item></code>. - * </p> + * Each Drawable in the transition is defined in a nested <code><item></code>. For more + * information, see the guide to <a + * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p> + * * @attr ref android.R.styleable#LayerDrawableItem_left * @attr ref android.R.styleable#LayerDrawableItem_top * @attr ref android.R.styleable#LayerDrawableItem_right @@ -212,7 +214,7 @@ public class TransitionDrawable extends LayerDrawable implements Drawable.Callba * Enables or disables the cross fade of the drawables. When cross fade * is disabled, the first drawable is always drawn opaque. With cross * fade enabled, the first drawable is drawn with the opposite alpha of - * the second drawable. + * the second drawable. Cross fade is disabled by default. * * @param enabled True to enable cross fading, false otherwise. */ diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 5c278d908ff8..08fc782c2cbc 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -16,6 +16,7 @@ package android.media; +import java.util.NoSuchElementException; import android.app.ActivityManagerNative; import android.content.BroadcastReceiver; import android.content.ComponentName; @@ -1016,7 +1017,11 @@ public class AudioService extends IAudioService.Stub { } else { mStartcount--; if (mStartcount == 0) { - mCb.unlinkToDeath(this, 0); + try { + mCb.unlinkToDeath(this, 0); + } catch (NoSuchElementException e) { + Log.w(TAG, "decCount() going to 0 but not registered to binder"); + } } requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED); } @@ -1025,8 +1030,14 @@ public class AudioService extends IAudioService.Stub { public void clearCount(boolean stopSco) { synchronized(mScoClients) { + if (mStartcount != 0) { + try { + mCb.unlinkToDeath(this, 0); + } catch (NoSuchElementException e) { + Log.w(TAG, "clearCount() mStartcount: "+mStartcount+" != 0 but not registered to binder"); + } + } mStartcount = 0; - mCb.unlinkToDeath(this, 0); if (stopSco) { requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED); } diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 2b4714def1f8..dab7601e68e8 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -49,6 +49,7 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; +import java.util.HashSet; import java.util.List; /** @@ -67,11 +68,29 @@ public class DatabaseHelper extends SQLiteOpenHelper { private Context mContext; + private static final HashSet<String> mValidTables = new HashSet<String>(); + + static { + mValidTables.add("system"); + mValidTables.add("secure"); + mValidTables.add("bluetooth_devices"); + mValidTables.add("bookmarks"); + + // These are old. + mValidTables.add("favorites"); + mValidTables.add("gservices"); + mValidTables.add("old_favorites"); + } + public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); mContext = context; } + public static boolean isValidTable(String name) { + return mValidTables.contains(name); + } + private void createSecureTable(SQLiteDatabase db) { db.execSQL("CREATE TABLE secure (" + "_id INTEGER PRIMARY KEY AUTOINCREMENT," + diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 1b4ba817adec..4372cd89e086 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -83,6 +83,9 @@ public class SettingsProvider extends ContentProvider { SqlArguments(Uri url, String where, String[] args) { if (url.getPathSegments().size() == 1) { this.table = url.getPathSegments().get(0); + if (!DatabaseHelper.isValidTable(this.table)) { + throw new IllegalArgumentException("Bad root path: " + this.table); + } this.where = where; this.args = args; } else if (url.getPathSegments().size() != 2) { @@ -91,6 +94,9 @@ public class SettingsProvider extends ContentProvider { throw new UnsupportedOperationException("WHERE clause not supported: " + url); } else { this.table = url.getPathSegments().get(0); + if (!DatabaseHelper.isValidTable(this.table)) { + throw new IllegalArgumentException("Bad root path: " + this.table); + } if ("system".equals(this.table) || "secure".equals(this.table)) { this.where = Settings.NameValueTable.NAME + "=?"; this.args = new String[] { url.getPathSegments().get(1) }; @@ -105,6 +111,9 @@ public class SettingsProvider extends ContentProvider { SqlArguments(Uri url) { if (url.getPathSegments().size() == 1) { this.table = url.getPathSegments().get(0); + if (!DatabaseHelper.isValidTable(this.table)) { + throw new IllegalArgumentException("Bad root path: " + this.table); + } this.where = null; this.args = null; } else { diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index d67dde0b75c4..6e307a58f827 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -1313,7 +1313,7 @@ class BackupManagerService extends IBackupManager.Stub { // If everything actually went through and this is the first time we've // done a backup, we can now record what the current backup dataset token // is. - if ((mCurrentToken == 0) && (status != BackupConstants.TRANSPORT_OK)) { + if ((mCurrentToken == 0) && (status == BackupConstants.TRANSPORT_OK)) { try { mCurrentToken = mTransport.getCurrentRestoreSet(); } catch (RemoteException e) { /* cannot happen */ } diff --git a/services/java/com/android/server/UiModeManagerService.java b/services/java/com/android/server/UiModeManagerService.java index 3606629d84a7..019245f332ee 100644 --- a/services/java/com/android/server/UiModeManagerService.java +++ b/services/java/com/android/server/UiModeManagerService.java @@ -44,6 +44,7 @@ import android.os.Message; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.SystemClock; import android.provider.Settings; import android.text.format.DateUtils; import android.text.format.Time; @@ -64,11 +65,13 @@ class UiModeManagerService extends IUiModeManager.Stub { private static final int MSG_UPDATE_TWILIGHT = 0; private static final int MSG_ENABLE_LOCATION_UPDATES = 1; + private static final int MSG_GET_NEW_LOCATION_UPDATE = 2; - private static final long LOCATION_UPDATE_MS = 30 * DateUtils.MINUTE_IN_MILLIS; + private static final long LOCATION_UPDATE_MS = 24 * DateUtils.HOUR_IN_MILLIS; + private static final long MIN_LOCATION_UPDATE_MS = 30 * DateUtils.MINUTE_IN_MILLIS; private static final float LOCATION_UPDATE_DISTANCE_METER = 1000 * 20; private static final long LOCATION_UPDATE_ENABLE_INTERVAL_MIN = 5000; - private static final long LOCATION_UPDATE_ENABLE_INTERVAL_MAX = 5 * DateUtils.MINUTE_IN_MILLIS; + private static final long LOCATION_UPDATE_ENABLE_INTERVAL_MAX = 15 * DateUtils.MINUTE_IN_MILLIS; private static final double FACTOR_GMT_OFFSET_LONGITUDE = 1000.0 * 360.0 / DateUtils.DAY_IN_MILLIS; private static final String ACTION_UPDATE_NIGHT_MODE = "com.android.server.action.UPDATE_NIGHT_MODE"; @@ -215,6 +218,21 @@ class UiModeManagerService extends IUiModeManager.Stub { } }; + private final BroadcastReceiver mUpdateLocationReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction())) { + if (!intent.getBooleanExtra("state", false)) { + // Airplane mode is now off! + mHandler.sendEmptyMessage(MSG_GET_NEW_LOCATION_UPDATE); + } + } else { + // Time zone has changed! + mHandler.sendEmptyMessage(MSG_GET_NEW_LOCATION_UPDATE); + } + } + }; + // A LocationListener to initialize the network location provider. The location updates // are handled through the passive location provider. private final LocationListener mEmptyLocationListener = new LocationListener() { @@ -304,6 +322,9 @@ class UiModeManagerService extends IUiModeManager.Stub { new IntentFilter(Intent.ACTION_DOCK_EVENT)); mContext.registerReceiver(mBatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); + IntentFilter filter = new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED); + filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); + mContext.registerReceiver(mUpdateLocationReceiver, filter); PowerManager powerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE); mWakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, TAG); @@ -586,7 +607,9 @@ class UiModeManagerService extends IUiModeManager.Stub { boolean mPassiveListenerEnabled; boolean mNetworkListenerEnabled; - + boolean mDidFirstInit; + long mLastNetworkRegisterTime = -MIN_LOCATION_UPDATE_MS; + @Override public void handleMessage(Message msg) { switch (msg.what) { @@ -599,6 +622,25 @@ class UiModeManagerService extends IUiModeManager.Stub { } } break; + case MSG_GET_NEW_LOCATION_UPDATE: + if (!mNetworkListenerEnabled) { + // Don't do anything -- we are still trying to get a + // location. + return; + } + if ((mLastNetworkRegisterTime+MIN_LOCATION_UPDATE_MS) + >= SystemClock.elapsedRealtime()) { + // Don't do anything -- it hasn't been long enough + // since we last requested an update. + return; + } + + // Unregister the current location monitor, so we can + // register a new one for it to get an immediate update. + mNetworkListenerEnabled = false; + mLocationManager.removeUpdates(mEmptyLocationListener); + + // Fall through to re-register listener. case MSG_ENABLE_LOCATION_UPDATES: // enable network provider to receive at least location updates for a given // distance. @@ -613,17 +655,21 @@ class UiModeManagerService extends IUiModeManager.Stub { } if (!mNetworkListenerEnabled && networkLocationEnabled) { mNetworkListenerEnabled = true; + mLastNetworkRegisterTime = SystemClock.elapsedRealtime(); mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, LOCATION_UPDATE_MS, 0, mEmptyLocationListener); - if (mLocation == null) { - retrieveLocation(); - } - synchronized (mLock) { - if (isDoingNightMode() && mLocation != null - && mNightMode == UiModeManager.MODE_NIGHT_AUTO) { - updateTwilightLocked(); - updateLocked(0, 0); + if (!mDidFirstInit) { + mDidFirstInit = true; + if (mLocation == null) { + retrieveLocation(); + } + synchronized (mLock) { + if (isDoingNightMode() && mLocation != null + && mNightMode == UiModeManager.MODE_NIGHT_AUTO) { + updateTwilightLocked(); + updateLocked(0, 0); + } } } } |