Android Studio.    
  


      Android     .                .        ,     ,   ,    .                ?     .     ,  ,       .





 

Android Studio.    



.

      Android     .                .        ,     ,   ,    .

               ?     .     ,  ,       .

    , ,      ,    Java,     Android Studio , ,    . ,  ,    ,   .            .           ,       .

 ,     ,   Android Studio    .       File ? New ? New Project.    Empty Activity,    ,      .         ,     .  Next.








  Name     ,  MyTestProject,        ,  .

  Package name   ,      .       .

  Save location    ,   .

  (Language)  Java,  Minimum SDK  ,      100% .








 Finish    Android Studio   .








     , ,     :

AndroidManifest     ,     .       ,  AndroidManifest.xml       ,        .

Java-,          .       ,       MainActivity,      .

res   ,          : layout, , , , , , , .

Gradle Scripts     .








  ,             .








,  . ,      ,      ,    ,    .  ,           .

        .



  1. Layout.

Layout   ,              .  Java-   xml-.      xml  ,  ,    ,   ,  java  ,      . ,    MainActivity.java   activity_main.xml










         :

1) Code  ,       xml ,   ,      ,   .

2) Split     ,    .

3) Design      ,        .   ,    ,     Split.








         ,       .










  2. .

      ,    , , -, ,     .     -     ,      .       ( ).   ,     ,     ,    :      ,   ,    .

   ,      .

1) FrameLayout  , ,    .  ,     ,             .          .        ,       .

2) LinearLayout      :         .               ,  .            ,   ,          .            .

3) TableLayout   ,        ,      ,         .                .

4) RelativeLayout    ,      , ,       ,  ,     .

5) ConstraintLayout    ,     .             ,   .        ,        .

6) ScrollView  .     ,   ,        . ScrollView        ,  LinearLayout,        .



  3. .

    ,     ,    : ,  (  ), , ,  ,    .      ,        .

android:id="@+id/abc"  ID  (),    ,      Android Studio       ID.



android:layout_width="match_parent"   ,    "match_parent"      ,  "wrap_content"    ,     (, ). ,  ,    ,        ,  "200dp".    ,  121,  367.



android:layout_height="wrap_content"   .    ,    .



android:layout_weight="1"  .        LinearLayout,         ,     ,   .    ,    0,1.



android:orientation="vertical"   .  "vertical"  ,  "horizontal"  .



android:background="@color/cherry"   .         .      ,        color ("@color/cherry"),    ("#D12B68"),        ("@drawable/print", "@mipmap/print").



android:gravity="center"  .     ,      .



android:layout_gravity="center_horizontal"      .  ,   android:gravity    : "top"  , "bottom"  , "left"  , "right"  .



android:text="@string/text"           ,     , , .



android:paddingTop="10dp"  ,           ,    .



android:paddingBottom="10dp"   .



android:paddingLeft="10dp"   .



android:paddingRight="10dp"   .



android:padding="20dp"        .



android:layout_marginTop="15dp"     ,        ,      ,      (layout_marginTop),  (layout_marginBottom),  (layout_marginLeft)   (layout_marginRight).   dp   .



android:layout_margin="25dp"        .



style="@style/MyTextStyle"           ,    ,    .      , ,    -           ,    10, 20, 50   .



,        ,        .            .



  4.  .

      , - , ,   ,        .      .    .

       TextView  EditText.

TextView  ,              ,    .

EditText     ,        .

    :

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"/>



           ,   .

     ,    :

android:id="@+id/tv1"



 , , tv1.         , ,   ,         .

  , ,   - ,  !

    strings.xml,     ,   ,  :

<string name="str1"> !</string>



    :

android:text="@string/str1"



          ,   ,   ,   Android Studio     .

  :

android:textSize="35sp"     ,   .



      ,   :

android:textAllCaps="false"



   . ,     .     ,   colors.xml   :

<color name="blue">#1E88E5</color>



       :

android:textColor="@color/blue"



       ,       :

android:gravity="center"



    :

android:gravity="center"

android:layout_gravity="center"










       .   ,    .    :

<TextView

android:id="@+id/tv1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="@string/str1"

android:textColor="@color/blue"

android:textSize="35sp"

android:textAllCaps="false"

android:gravity="center"

android:layout_gravity="center"/>



,       EditText,    - ,  .

    .

<EditText

android:layout_width="match_parent"

android:layout_height="wrap_content"/>



  "match_parent"      ,      .         .










,    ,    ,       ?   ,     ,   ,    .        ,     .   .    :

android:layout_margin="40dp"



     .    :

<stringname="str2">  </string>



    :

android:hint="@string/str2"



   :

android:gravity="center"



,  :

<EditText

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_margin="40dp"

android:hint="@string/str2"

android:gravity="center"/>










     .        , ,  , ,   .




  .


   .

   ,     (https://www.litres.ru/pages/biblio_book/?art=67900008)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


