Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Musical note symbols on Android

I'm working on an a piano quiz app and I'm at the point where I need to write all the letter notes on the keyboard, more exactly when the user tries to guess what note was played and will press a key the musical letter will appear on that key.

This a screenshot of the app when the user touches a key: enter image description here

My question is related to the musical symbol flat:

enter image description here

How can I achieve that symbol and implement it in the app? For example dflat is shown as "DB" and I need to rewrite it to "Dflat", flat as the musical symbol.

Edit: The letter notes are shown as text views.

like image 592
Iulian Buga Avatar asked Sep 05 '25 01:09

Iulian Buga


1 Answers

Are you asking whether there is a text character for a flat symbol? If so, check here: http://en.wikipedia.org/wiki/List_of_Unicode_characters

Are you asking how to set the font to one that supports said character? If so, check out the setTypeface() method of TextView: http://developer.android.com/reference/android/widget/TextView.html

You might also consider using icons instead of text.

Edit: The unicode character for the flat symbol ♭ is 266D, and you can use unicode in Java via the \u escape character. Something like this:

sampleText.setText("\u266D");

You have to be using a font that supports that character. And more importantly, so do your users. That's why it might be a better idea to use an icon instead.

like image 79
Kevin Workman Avatar answered Sep 07 '25 20:09

Kevin Workman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!