How to make the first letter of a text in a textView large and capital using android studio like the one in the attached image.

How to make the first letter of a text in a textView large and capital using android studio like the one in the attached image.

Please try this code snippet, this will help you.
String str = "sample text";
//Change first character to capital letter
String tempStr = str.substring(0, 1).toUpperCase() + str.substring(1);
//Change font size of the first character. You can change 2f as you want
SpannableString spannableString = new SpannableString(tempStr);
spannableString.setSpan(new RelativeSizeSpan(2f), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//Set the formatted text to text view
tvSample.setText(spannableString);
You can use this :
String upperString = myString.substring(0,1).toUpperCase() + myString.substring(1);
100% work
Steps!
1) Use this library
compile 'com.novoda:drop-cap:1.1.0'
2) Define it in your layout
<com.novoda.dropcap.DropCapView
android:id="@+id/view_drop_cap"
style="@style/DropCap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/button1_detail" />
3) Define it into your styles.xml
<style name="DropCap">
<item name="android:paddingLeft">@dimen/drop_cap_padding_left</item>
<item name="android:paddingTop">@dimen/drop_cap_padding_top</item>
<item name="android:paddingRight">@dimen/drop_cap_padding_right</item>
<item name="android:paddingBottom">@dimen/drop_cap_padding_bottom</item>
<item name="dropCapTextSize">@dimen/drop_cap_text</item>
<item name="numberOfDropCaps">1</item>
<item name="dropCapFontPath">fonts/SANS-SERIF_Cabin-Regular.otf</item>
<item name="copyTextSize">@dimen/copy_text</item>
<item name="copyFontPath">fonts/neuropolitical_rg.ttf</item>
<item name="lineSpacingExtra">@dimen/drop_cap_linespacing_extra</item>
</style>
4)Define it into your dimens.xml
<dimen name="drop_cap_padding_left">10dp</dimen>
<dimen name="drop_cap_padding_top">10dp</dimen>
<dimen name="drop_cap_padding_right">10dp</dimen>
<dimen name="drop_cap_padding_bottom">10dp</dimen>
<dimen name="drop_cap_text">64sp</dimen>
<dimen name="copy_text">21sp</dimen>
<dimen name="scroll_view_height">200dp</dimen>
<dimen name="divider_height">1dp</dimen>
<dimen name="drop_cap_linespacing_extra">0sp</dimen>
4) In your java code just findItById and set Text.
Reference-> https://github.com/novoda/drop-cap
You can use one textView for character A and another textView for rest of text. i don't think is there any code to write like this because of alignment.