diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/guide/practices/design/jni.jd | 51 | ||||
-rw-r--r-- | docs/html/guide/topics/data/backup.jd | 10 | ||||
-rw-r--r-- | docs/html/guide/topics/graphics/hardware-accel.jd | 36 | ||||
-rw-r--r-- | docs/html/guide/topics/ui/how-android-draws.jd | 2 | ||||
-rw-r--r-- | docs/html/sitemap.txt | 27 |
5 files changed, 64 insertions, 62 deletions
diff --git a/docs/html/guide/practices/design/jni.jd b/docs/html/guide/practices/design/jni.jd index 9980efd..ddfa0e3 100644 --- a/docs/html/guide/practices/design/jni.jd +++ b/docs/html/guide/practices/design/jni.jd @@ -17,7 +17,7 @@ page.title=JNI Tips <li><a href="#extended_checking">Extended Checking</a> </li> <li><a href="#native_libraries">Native Libraries</a></li> <li><a href="#64_bit">64-bit Considerations</a></li> - <li><a href="#unsupported">Unsupported Features</a></li> + <li><a href="#unsupported">Unsupported Features/Backwards Compatibility</a></li> <li><a href="#faq_ULE">FAQ: Why do I get <code>UnsatisfiedLinkError</code></a></li> <li><a href="#faq_FindClass">FAQ: Why didn't <code>FindClass</code> find my class?</a></li> <li><a href="#faq_sharing">FAQ: How do I share raw data with native code?</a></li> @@ -514,40 +514,57 @@ that use 64-bit pointers, <strong>you need to stash your native pointers in a <a name="unsupported" id="unsupported"></a> -<h2>Unsupported Features</h2> +<h2>Unsupported Features/Backwards Compatibility</h2> -<p>All JNI 1.6 features are supported, with the following exceptions:</p> +<p>All JNI 1.6 features are supported, with the following exception:</p> <ul> <li><code>DefineClass</code> is not implemented. Android does not use Java bytecodes or class files, so passing in binary class data doesn't work.</li> - <li>"Weak global" references are implemented, but may only be passed - to <code>NewLocalRef</code>, <code>NewGlobalRef</code>, and - <code>DeleteWeakGlobalRef</code>. (The spec strongly encourages - programmers to create hard references to weak globals before doing - anything with them, so this should not be at all limiting.)</li> - <li><code>GetObjectRefType</code> (new in JNI 1.6) is implemented but not fully - functional — it can't always tell the difference between "local" and - "global" references.</li> </ul> -<p>For backward compatibility, you may need to be aware of:</p> +<p>For backward compatibility with older Android releases, you may need to +be aware of:</p> <ul> - <li>Until Android 2.0 (Eclair), the '$' character was not properly + <li><b>Dynamic lookup of native functions</b> + <p>Until Android 2.0 (Eclair), the '$' character was not properly converted to "_00024" during searches for method names. Working around this requires using explicit registration or moving the native methods out of inner classes. - <li>Until Android 2.0 (Eclair), it was not possible to use a <code>pthread_key_create</code> + <li><b>Detaching threads</b> + <p>Until Android 2.0 (Eclair), it was not possible to use a <code>pthread_key_create</code> destructor function to avoid the "thread must be detached before exit" check. (The runtime also uses a pthread key destructor function, so it'd be a race to see which gets called first.) - <li>Until Android 2.2 (Froyo), weak global references were not implemented. + <li><b>Weak global references</b> + <p>Until Android 2.2 (Froyo), weak global references were not implemented. Older versions will vigorously reject attempts to use them. You can use the Android platform version constants to test for support. - <li>Until Android 4.0 (Ice Cream Sandwich), JNI local references were + <p>Until Android 4.0 (Ice Cream Sandwich), weak global references could only + be passed to <code>NewLocalRef</code>, <code>NewGlobalRef</code>, and + <code>DeleteWeakGlobalRef</code>. (The spec strongly encourages + programmers to create hard references to weak globals before doing + anything with them, so this should not be at all limiting.) + <p>From Android 4.0 (Ice Cream Sandwich) on, weak global references can be + used like any other JNI references.</li> + <li><b>Local references</b> + <p>Until Android 4.0 (Ice Cream Sandwich), local references were actually direct pointers. Ice Cream Sandwich added the indirection necessary to support better garbage collectors, but this means that lots - of JNI bugs are undetectable on older releases. + of JNI bugs are undetectable on older releases. See + <a href="http://android-developers.blogspot.com/2011/11/jni-local-reference-changes-in-ics.html">JNI Local Reference Changes in ICS</a> for more details. + <li><b>Determining reference type with <code>GetObjectRefType</code></b> + <p>Until Android 4.0 (Ice Cream Sandwich), as a consequence of the use of + direct pointers (see above), it was impossible to implement + <code>GetObjectRefType</code> correctly. Instead we used a heuristic + that looked through the weak globals table, the arguments, the locals + table, and the globals table in that order. The first time it found your + direct pointer, it would report that your reference was of the type it + happened to be examining. This meant, for example, that if + you called <code>GetObjectRefType</code> on a global jclass that happened + to be the same as the jclass passed as an implicit argument to your static + native method, you'd get <code>JNILocalRefType</code> rather than + <code>JNIGlobalRefType</code>. </ul> diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd index dec2146..79dfd88 100644 --- a/docs/html/guide/topics/data/backup.jd +++ b/docs/html/guide/topics/data/backup.jd @@ -708,17 +708,9 @@ you must use synchronized statements each time you perform a read or write. For in any Activity where you read and write the file, you need an object to use as the intrinsic lock for the synchronized statements:</p> -<div class="sidebox-wrapper"> -<div class="sidebox"> -<p><strong>Interesting Fact:</strong></p> -<p>A zero-length array is lighter-weight than a normal Object, so it's great for an -intrinsic lock.</p> -</div> -</div> - <pre> // Object for intrinsic lock -static final Object[] sDataLock = new Object[0]; +static final Object sDataLock = new Object(); </pre> <p>Then create a synchronized statement with this lock each time you read or write the files. For diff --git a/docs/html/guide/topics/graphics/hardware-accel.jd b/docs/html/guide/topics/graphics/hardware-accel.jd index c8703a5..39ccbf4 100644 --- a/docs/html/guide/topics/graphics/hardware-accel.jd +++ b/docs/html/guide/topics/graphics/hardware-accel.jd @@ -283,8 +283,6 @@ changed.</li> <li>{@link android.graphics.Canvas#drawPicture drawPicture()}</li> - <li>{@link android.graphics.Canvas#drawPosText drawPosText()}</li> - <li>{@link android.graphics.Canvas#drawTextOnPath drawTextOnPath()}</li> <li>{@link android.graphics.Canvas#drawVertices drawVertices()}</li> @@ -302,6 +300,16 @@ changed.</li> <li>{@link android.graphics.Paint#setRasterizer setRasterizer()}</li> </ul> </li> + + <li> + <strong>Xfermodes</strong> + + <ul> + <li>{@link android.graphics.AvoidXfermode AvoidXfermode}</li> + + <li>{@link android.graphics.PixelXorXfermode PixelXorXfermode}</li> + </ul> + </li> </ul> <p>In addition, some operations behave differently with hardware acceleration enabled:</p> @@ -317,12 +325,6 @@ changed.</li> <li>{@link android.graphics.Canvas#drawBitmapMesh drawBitmapMesh()}: colors array is ignored</li> - - <li>{@link android.graphics.Canvas#drawLines drawLines()}: anti-aliasing is not - supported</li> - - <li>{@link android.graphics.Canvas#setDrawFilter setDrawFilter()}: can be set, but is - ignored</li> </ul> </li> @@ -341,6 +343,24 @@ changed.</li> </li> <li> + <strong>PorterDuffXfermode</strong> + + <ul> + <li>{@link android.graphics.PorterDuff.Mode#DARKEN PorterDuff.Mode.DARKEN} will + be equivalent to {@link android.graphics.PorterDuff.Mode#SRC_OVER} when blending + against the framebuffer.</li> + + <li>{@link android.graphics.PorterDuff.Mode#LIGHTEN PorterDuff.Mode.LIGHTEN} will + be equivalent to {@link android.graphics.PorterDuff.Mode#SRC_OVER} when blending + against the framebuffer.</li> + + <li>{@link android.graphics.PorterDuff.Mode#OVERLAY PorterDuff.Mode.OVERLAY} will + be equivalent to {@link android.graphics.PorterDuff.Mode#SRC_OVER} when blending + against the framebuffer.</li> + </ul> + </li> + + <li> <strong>ComposeShader</strong> <ul> diff --git a/docs/html/guide/topics/ui/how-android-draws.jd b/docs/html/guide/topics/ui/how-android-draws.jd index 3a57afa..6a8cd86 100644 --- a/docs/html/guide/topics/ui/how-android-draws.jd +++ b/docs/html/guide/topics/ui/how-android-draws.jd @@ -62,7 +62,7 @@ and each View is responsible for drawing itself. <p> The measure pass uses two classes to communicate dimensions. The - {@link android.view.View.MeasureSpec} class is used by Views to tell their parents how they + {@link android.view.ViewGroup.LayoutParams} class is used by Views to tell their parents how they want to be measured and positioned. The base LayoutParams class just describes how big the View wants to be for both width and height. For each dimension, it can specify one of:</p> diff --git a/docs/html/sitemap.txt b/docs/html/sitemap.txt index 0298a8e..cfbda2b 100644 --- a/docs/html/sitemap.txt +++ b/docs/html/sitemap.txt @@ -231,7 +231,6 @@ http://developer.android.com/resources/samples/JetBoy/index.html http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html http://developer.android.com/resources/samples/LunarLander/index.html http://developer.android.com/resources/samples/MultiResolution/index.html -http://developer.android.com/resources/samples/NFCDemo/index.html http://developer.android.com/resources/samples/NotePad/index.html http://developer.android.com/resources/samples/SampleSyncAdapter/index.html http://developer.android.com/resources/samples/SearchableDictionary/index.html @@ -1996,17 +1995,6 @@ http://developer.android.com/reference/java/io/Reader.html http://developer.android.com/reference/android/content/DialogInterface.html http://developer.android.com/reference/org/apache/http/message/BasicHeaderIterator.html http://developer.android.com/reference/org/apache/http/message/BasicListHeaderIterator.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/TagViewer.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/NdefMessageParser.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/ParsedNdefRecord.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/SmartPoster.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/TextRecord.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/UriRecord.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/FakeTagsActivity.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/MockNdefMessages.html -http://developer.android.com/resources/samples/NFCDemo/res/index.html -http://developer.android.com/resources/samples/NFCDemo/src/index.html -http://developer.android.com/resources/samples/NFCDemo/AndroidManifest.html http://developer.android.com/reference/java/lang/InternalError.html http://developer.android.com/reference/java/lang/Error.html http://developer.android.com/reference/java/lang/VirtualMachineError.html @@ -3039,7 +3027,6 @@ http://developer.android.com/sdk/api_diff/3/changes/pkg_dalvik.system.html http://developer.android.com/sdk/api_diff/3/changes/pkg_java.lang.html http://developer.android.com/sdk/api_diff/3/changes/pkg_java.util.jar.html http://developer.android.com/sdk/api_diff/3/changes/pkg_java.util.logging.html -http://developer.android.com/resources/samples/NFCDemo/src/com/index.html http://developer.android.com/sdk/api_diff/9/changes/alldiffs_index_removals.html http://developer.android.com/sdk/api_diff/9/changes/alldiffs_index_additions.html http://developer.android.com/sdk/api_diff/9/changes/alldiffs_index_changes.html @@ -3514,7 +3501,6 @@ http://developer.android.com/reference/javax/sql/ConnectionPoolDataSource.html http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/LabelView.html http://developer.android.com/resources/samples/ApiDemos/res/layout/custom_view_1.html http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/index.html http://developer.android.com/reference/org/apache/http/conn/ssl/SSLSocketFactory.html http://developer.android.com/reference/android/location/package-descr.html http://developer.android.com/resources/samples/AccessibilityService/res/values/strings.html @@ -3939,10 +3925,6 @@ http://developer.android.com/reference/android/graphics/drawable/shapes/RoundRec http://developer.android.com/resources/samples/ContactManager/res/drawable-mdpi/icon.html http://developer.android.com/resources/samples/BackupRestore/src/com/example/index.html http://developer.android.com/reference/org/apache/http/message/package-descr.html -http://developer.android.com/resources/samples/NFCDemo/res/drawable/index.html -http://developer.android.com/resources/samples/NFCDemo/res/layout/index.html -http://developer.android.com/resources/samples/NFCDemo/res/raw/index.html -http://developer.android.com/resources/samples/NFCDemo/res/values/index.html http://developer.android.com/reference/android/bluetooth/package-descr.html http://developer.android.com/resources/samples/SipDemo/res/drawable/index.html http://developer.android.com/resources/samples/SipDemo/res/layout/index.html @@ -4110,7 +4092,6 @@ http://developer.android.com/sdk/api_diff/9/changes/methods_index_removals.html http://developer.android.com/sdk/api_diff/9/changes/methods_index_additions.html http://developer.android.com/sdk/api_diff/9/changes/methods_index_changes.html http://developer.android.com/reference/android/media/audiofx/package-descr.html -http://developer.android.com/resources/samples/NFCDemo/res/values/strings.html http://developer.android.com/reference/android/sax/ElementListener.html http://developer.android.com/reference/android/sax/EndElementListener.html http://developer.android.com/reference/android/sax/EndTextElementListener.html @@ -4599,7 +4580,6 @@ http://developer.android.com/resources/samples/SoftKeyboard/src/com/index.html http://developer.android.com/reference/android/text/method/package-descr.html http://developer.android.com/resources/samples/JetBoy/JETBOY_content/JETBOY_Music.logic/LgDoc/index.html http://developer.android.com/resources/samples/TicTacToeMain/res/layout/main.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/index.html http://developer.android.com/resources/samples/SearchableDictionary/res/drawable-mdpi/ic_menu_search.html http://developer.android.com/resources/samples/TicTacToeMain/res/values/strings.html http://developer.android.com/sdk/api_diff/7/changes/alldiffs_index_additions.html @@ -4637,9 +4617,6 @@ http://developer.android.com/resources/samples/SoftKeyboard/res/values/index.htm http://developer.android.com/resources/samples/SoftKeyboard/res/values-land/index.html http://developer.android.com/resources/samples/SoftKeyboard/res/xml/index.html http://developer.android.com/reference/junit/runner/package-descr.html -http://developer.android.com/resources/samples/NFCDemo/res/layout/tag_divider.html -http://developer.android.com/resources/samples/NFCDemo/res/layout/tag_text.html -http://developer.android.com/resources/samples/NFCDemo/res/layout/tag_viewer.html http://developer.android.com/resources/samples/AccelerometerPlay/res/drawable-ldpi/icon.html http://developer.android.com/resources/samples/CubeLiveWallpaper/src/com/example/index.html http://developer.android.com/reference/android/text/style/package-descr.html @@ -4726,14 +4703,12 @@ http://developer.android.com/resources/samples/SoftKeyboard/res/values-land/dime http://developer.android.com/sdk/api_diff/3/changes/classes_index_additions.html http://developer.android.com/sdk/api_diff/3/changes/classes_index_changes.html http://developer.android.com/resources/samples/WiktionarySimple/src/com/index.html -http://developer.android.com/resources/samples/NFCDemo/res/drawable/icon.html http://developer.android.com/resources/samples/SearchableDictionary/res/drawable-hdpi/ic_menu_search.html http://developer.android.com/resources/samples/SipDemo/res/values/strings.html http://developer.android.com/resources/samples/SpinnerTest/src/com/android/index.html http://developer.android.com/sdk/api_diff/3/changes/methods_index_removals.html http://developer.android.com/sdk/api_diff/3/changes/methods_index_additions.html http://developer.android.com/sdk/api_diff/3/changes/methods_index_changes.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/index.html http://developer.android.com/resources/samples/SoftKeyboard/res/xml/method.html http://developer.android.com/resources/samples/SoftKeyboard/res/xml/qwerty.html http://developer.android.com/resources/samples/SoftKeyboard/res/xml/symbols.html @@ -5326,8 +5301,6 @@ http://developer.android.com/resources/samples/ApiDemos/res/drawable-ldpi/stylog http://developer.android.com/sdk/api_diff/5/changes/alldiffs_index_removals.html http://developer.android.com/sdk/api_diff/5/changes/alldiffs_index_additions.html http://developer.android.com/sdk/api_diff/5/changes/alldiffs_index_changes.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/index.html -http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/index.html http://developer.android.com/resources/samples/BackupRestore/src/com/example/android/index.html http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/index.html http://developer.android.com/resources/samples/ContactManager/src/com/example/android/index.html |