I'm new to Android Studio. And I want to align a TextView to the center of the activity and use margins. I have tried all the layouts available but none worked.
This is what I get like a preview in the Design tab of Android Studio.

And that is what I get when testing on my phone.

My code is:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="Welcome to my app"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
If I change something in the code it shows the text at the max left and it shows only half of the text. If I try to align it to the right it shows like a white block that blocks viewing the text. I just want to align it horizontally so I can add other items. But if a textview cannot be placed like I want, how can adjust other items?
If someone has a good solution for that, please share it so I can adjust my code.
And thanks in advance.

android:layout_widthofTextViewtomatch_parent