summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Phil Burk <philburk@google.com> 2015-07-30 22:10:38 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2015-07-30 22:10:38 +0000
commit4b472ef750b7d4610e2ecd714f390fdad2c1d023 (patch)
tree1a6e5c5a516c010e20906f3661503f5955136bbc
parentb98ca14fae59d8fe0cbcd3f660ac30436dcbe78e (diff)
parentab4a5554042605014b3f6f019d449981c47baa3e (diff)
am ab4a5554: am d1261ec8: am de6272a7: am 9d4fad24: am fdcd8216: Merge "MIDI package doc: add hasSystemFeature() call" into mnc-dev
* commit 'ab4a5554042605014b3f6f019d449981c47baa3e': MIDI package doc: add hasSystemFeature() call
-rw-r--r--media/java/android/media/midi/package.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/media/java/android/media/midi/package.html b/media/java/android/media/midi/package.html
index 673c4ba9bfeb..a6753913bf3e 100644
--- a/media/java/android/media/midi/package.html
+++ b/media/java/android/media/midi/package.html
@@ -75,6 +75,18 @@ Then the app will not appear in the Play Store for old devices that do not suppo
&lt;uses-feature android:name="android.software.midi" android:required="true"/>
</pre>
+<h2 id=check_feature>Check for Feature Support</h2>
+
+<p>An app can also check at run-time whether the MIDI feature is supported on a platform.
+This is particularly useful during development when you install apps directly on a device.
+</p>
+
+<pre class=prettyprint>
+if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_MIDI)) {
+ // do MIDI stuff
+}
+</pre>
+
<h2 id=the_midimanager>The MidiManager</h2>