How can I set my external keyboard to use a Dvorak layout? Tested in Samsung Galaxy Tab 8.9 and Samsung Galaxy S4 in >= Android 5.0.1 with Logitech Bluetooth keyboard and Apple Wireless keybord 3rd generation without rooting the phone and without external applications. Also tested in the CyanogenMod versions of the corresponding Androids.

I found a bug in Android main system's Dvorak in Lollipop >= 5.0.1, 11.1.2016. 
Connect Bluetooth keyboard to your system. Choose some keyboard Dvorak. Go to SMS. Double tap Space and Select English US Dvorak. Type with your Wireless keyboard (I use Apple Wireless keyboard 3rd gen). It types Qwerty put shows physically Dvorak in the screen. This is a bug in Android, which bug report is here with the issue number 198665. 



How can I set my external keyboard to use a Dvorak layout without hacks?
You can use External Keyboard Helper Pro to do it. No need for rooting. From version 2.7, the app supports Dvorak out-of-the-box.

Disclaimer: I'm the developer of this app.