With 4.1 jellybean, Robot has started to make appearances throughout the system UI. I would like to use the new attribute 'fontFamily' within Eclipse as documented in the Font Families section of this page: http://developer.android.com/about/versions/android-4.1.html#UI
The goal would be to use Roboto on all devices that support it (without including it in /assets) and have the typeface degrade gracefully to Droid sans on all non 4.0+ devices. Again, don't want to have to include in my .apk, understand that is easy enough to do.
Would love to see sample code or feedback on successful use of fontFamily with API 16.
Its pretty easy, since older versions of Android will ignore xml attributes they don't understand you can just set it on your text views or your app's styles. Or you could set it manually in code but thats more work :p
And if you're using the regular version of Roboto you don't need to do anything special, its the default in 4.0+ (you might need a holo based theme, I can't remember), and Roboto bold and italic are accessible using TextView's TextStyle attribute.
In xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
/>
Or in code
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
textView.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));
}