Android studioni o`rnatganimizdan so`ng biz dastur yaratishni boshlaymiz va biz “FD-2000 Mo`ljallanishi” nomli tugma yaratishni ko`rib chiqamiz va bu buttonda amalga oshiriladi.
Dizayn
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"
tools:context=".FD2000.FD2000">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:textAllCaps="false"
android:text="FD-2000 mo'ljallanishi"
android:id="@+id/fd2000_moljallanishi"
android:layout_margin="20dp"
android:background="@color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
Android studioda yordamizda biz “FD-2000 Mo`ljallanishi” tugmasini xosil qilganimizdan so`ng, u bilan keyingi oynaga o`tish amalini ko`ramiz
Bosilganda bajariladigan amallar (Bog’lash)
package com.example.dilshodproject.FD2000;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.dilshodproject.R;
public class FD2000 extends AppCompatActivity {
Button btn_fd2000_moljallanishi;
Button btn_fd2000_tarkibi;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fd2000 );
btn_fd2000_tarkibi = (Button)findViewById(R.id.fd2000_tarkibi );
btn_fd2000_tarkibi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(FD2000.this, FD2000Tarkibi.class));
}
});
btn_fd2000_moljallanishi = (Button)findViewById(R.id.fd2000_moljallanishi );
btn_fd2000_moljallanishi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(FD2000.this, FD2000Moljallanishi.class));
}
});
}
}
Natijada bizda “FD-2000 mo`ljallanishi” oynasi hosil bo`ldi va bu yerda biz rasm ,text va videolarni qanday joylashni ushbu kompleksimiz texnik tavsiflari jadval ko`rinnishida yaratilganini ko`rib chiqamiz
Rasm, Text, Video
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"
tools:context=".FD2000.FD2000Moljallanishi">
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp"
android:layout_gravity="center"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:scaleType="fitXY"
android:layout_margin="15dp"
android:src="@drawable/re1"
android:layout_width="300dp"
android:layout_height="300dp"/>
android:scaleType="fitXY"
android:layout_margin="15dp"
android:src="@drawable/re3"
android:layout_width="300dp"
android:layout_height="300dp"/>
android:layout_gravity="center"
android:id="@+id/C125yozuv"
android:textColor="@android:color/holo_red_dark"
android:textSize="30dp"
android:text="FD-2000"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_gravity="center"
android:id="@+id/c125_moljallanishi_text"
android:textSize="26dp"
android:textStyle="bold"
android:padding="30dp"
android:text=" Mo’ljallanishi-FD-2000 uzoq masofali zenit-raketa tizimi dushman samolyotlarini , qanotli raketalarini va vertolyotlarini jangovar foydalanishning barcha balandliklarida , kechayu kunduz har qanday ob-havo sharoitida yo'q qilish uchun mo'ljallangan. Ushbu kompleksga radio bosim berilganda , qiyin sharoitida va dushman tomonidan havo hujumidan ommaviy hujumlar yetarlicha yuqori jangovar samaradorligi bilan ajralib turadi. \n HT-233 radar 300 MGts tarmoqli kengligida 120 km nishonni aniqlash diapazoni va 90 km kuzatuv masofasida ishlaydi. U 0 ° dan 65 ° gacha bo'lgan balandlik oralig'ida azimutda 360 ° skanerlashi mumkin. Radar 100 ta havo nishonlarini kuzatish va bir vaqtning o'zida ularning 50 dan ortig'ini taxminan 100 km masofada nishonga olish uchun mo'ljallangan. "
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:id="@+id/C125_ttx_yozuv"
android:textColor="@android:color/holo_red_dark"
android:textSize="30dp"
android:text="TTX"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_gravity="center"
android:layout_margin="10dp"
android:padding="20dp"
android:id="@+id/c125_jadval"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="Raketa uzunligi:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="7 m"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="Raketa diametri:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="1 m"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="Raketa og'irligi:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="1330 kg"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="Jang kallagi og'irligi:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="190 kg"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="Maksimal diapazon:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="150 km"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="Maksimal balandlik:"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_marginHorizontal="50dp"
android:textSize="20dp"
android:layout_weight="1"
android:text="30 km"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:id="@+id/video_button"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_videocam_24"
android:layout_marginVertical="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
So`ngra bizda yakunda bizga kerakli dastur tayyor bo`ldi. Biz ushbu dastur yordamida XXM ZRQ xarbiy xizmatchilari va bizga o`xshagan yosh kursatlarimizga foydasi tegadi
Bosh ekran dizayn kodi
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/glavniy"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_marginTop="80dp"
android:layout_marginBottom="80dp"
android:gravity="center"
android:text="HAVO HUJUMIDAN MUDOFAA ZENIT RAKETA QO'SHINLARI"
android:textSize="50dp"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginBottom="30dp"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:textSize="30dp"
android:text="HHM"
android:id="@+id/hhm_nima"
android:layout_margin="30dp"
android:layout_width="270dp"
android:layout_height="80dp"/>
android:textSize="30dp"
android:text="FD-2000"
android:id="@+id/fd2000"
android:layout_margin="30dp"
android:layout_width="270dp"
android:layout_height="80dp"/>
android:layout_marginBottom="30dp"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:textSize="30dp"
android:text="C-125M1"
android:id="@+id/c125m1"
android:layout_margin="30dp"
android:layout_width="270dp"
android:layout_height="80dp"/>
android:textSize="30dp"
android:text="PECHORA-2M"
android:id="@+id/pechora"
android:layout_margin="30dp"
android:layout_width="270dp"
android:layout_height="80dp"/>
android:layout_marginBottom="30dp"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:textSize="30dp"
android:text="HKHV"
android:id="@+id/hkhb"
android:layout_margin="30dp"
android:layout_width="270dp"
android:layout_height="80dp"/>
android:textSize="30dp"
android:id="@+id/test"
android:text="TEST"
android:layout_margin="30dp"
android:layout_width="270dp"
android:layout_height="80dp"/>
Back and qismi bosh ekran amallar kodi
package com.example.dilshodproject;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.dilshodproject.C125.C12_5;
import com.example.dilshodproject.FD2000.FD2000;
import com.example.dilshodproject.HHM.HHMNima;
import com.example.dilshodproject.HKHV.HKHV;
import com.example.dilshodproject.Pechora.Pechora;
import com.example.dilshodproject.Test.Test;
public class MainActivity extends AppCompatActivity {
Button btn_fd2000;
Button btn_hhm;
Button btn_c125;
Button btn_pechora;
Button btn_hkhv;
Button btn_test;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main );
btn_fd2000 = (Button)findViewById(R.id.fd2000 );
btn_fd2000.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, FD2000.class));
}
});
btn_hhm = (Button)findViewById(R.id.hhm_nima );
btn_hhm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, HHMNima.class));
}
});
btn_c125 = (Button)findViewById(R.id.c125m1 );
btn_c125.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, C12_5.class));
}
});
btn_pechora = (Button)findViewById(R.id.pechora );
btn_pechora.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, Pechora.class));
}
});
btn_hkhv = (Button)findViewById(R.id.hkhb );
btn_hkhv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, HKHV.class));
}
});
btn_test = (Button)findViewById(R.id.test );
btn_test.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, Test.class));
}
});
}
}
Android Studioni bilan tanishib chiqishni eng yaxshi yo’llaridan biri bu albatta ilova yaratish ya’ni Hello World.
Dostları ilə paylaş: