• 28-10-2019, 12:30:08
    #1
    Herkese merhaba. Mobil uygulama geliştirme konusunda çok bilgisizim. Fakat üniversite de bir uygulama geliştirilmesi gerekiyor. Sanırım aşırı basit bir olay fakat nasıl araştırma yapacağımı bilmediğim ve derslere 3 hafta boyunca giremediğim için sorun yaşıyorum.

    Yapılacak uygulama :

    Ad Soyad Alanı ve bir buton eklenecek.

    Ad Soyad girildikten sonra butona basılıp bir toast mesajı gelecek ve bu mesajda Abdullah Darçın hoşgeldiniz yazacak. Bunu bir videosu veya kısa kodu var ise paylaşabilir misiniz [IMG]https://*******.com/forum/images/smilies/smile.svg[/IMG] Teşekkür ederim[IMG]https://*******.com/forum/images/smilies/smile.svg[/IMG]
  • 28-10-2019, 12:54:07
    #2
    Activity
    package com.ridvan.example;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class MainActivity extends AppCompatActivity { private EditText name,lastName; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); name = findViewById(R.id.editTextName); lastName = findViewById(R.id.editTextLastName); button = findViewById(R.id.buttonToast); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (name.getText() != null && !name.getText().toString().equals("") && lastName.getText() != null && !lastName.getText().toString().equals("")){ Toast.makeText(MainActivity.this,name.getText().toString()+" " + lastName.getText().toString()+ " Hoş Geldiniz", Toast.LENGTH_LONG).show(); } } }); }}
    Xml Tarafı
    <?xml version="1.0" encoding="utf-8"?><RelativeLayout 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" tools:context=".MainActivity"> <EditText android:id="@+id/editTextName" android:layout_width="match_parent" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" android:layout_marginTop="20dp" android:hint="Name" android:layout_height="wrap_content" /> <EditText android:id="@+id/editTextLastName" android:layout_width="match_parent" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" android:layout_marginTop="20dp" android:hint="Last Name" android:layout_below="@+id/editTextName" android:layout_height="wrap_content" /> <Button android:layout_width="wrap_content" android:layout_below="@+id/editTextLastName" android:layout_marginTop="20dp" android:id="@+id/buttonToast" android:layout_alignParentEnd="true" android:layout_marginEnd="30dp" android:layout_height="wrap_content" android:text="Toast Get"/></RelativeLayout>
  • 28-10-2019, 12:56:56
    #3
    broscr adlı üyeden alıntı: mesajı görüntüle
    Activity
    package com.ridvan.example;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class MainActivity extends AppCompatActivity { private EditText name,lastName; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); name = findViewById(R.id.editTextName); lastName = findViewById(R.id.editTextLastName); button = findViewById(R.id.buttonToast); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (name.getText() != null && !name.getText().toString().equals("") && lastName.getText() != null && !lastName.getText().toString().equals("")){ Toast.makeText(MainActivity.this,name.getText().toString()+" " + lastName.getText().toString()+ " Hoş Geldiniz", Toast.LENGTH_LONG).show(); } } }); }}
    Xml Tarafı
    <?xml version="1.0" encoding="utf-8"?><RelativeLayout 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" tools:context=".MainActivity"> <EditText android:id="@+id/editTextName" android:layout_width="match_parent" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" android:layout_marginTop="20dp" android:hint="Name" android:layout_height="wrap_content" /> <EditText android:id="@+id/editTextLastName" android:layout_width="match_parent" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" android:layout_marginTop="20dp" android:hint="Last Name" android:layout_below="@+id/editTextName" android:layout_height="wrap_content" /> <Button android:layout_width="wrap_content" android:layout_below="@+id/editTextLastName" android:layout_marginTop="20dp" android:id="@+id/buttonToast" android:layout_alignParentEnd="true" android:layout_marginEnd="30dp" android:layout_height="wrap_content" android:text="Toast Get"/></RelativeLayout>
    Nedir Bu anlayamadım. Sayfa görüntülenemiyor
  • 28-10-2019, 12:57:54
    #4
    abdullahdarcin adlı üyeden alıntı: mesajı görüntüle
    Nedir Bu anlayamadım. Sayfa görüntülenemiyor
    Yenileyin düzelir.CODE
  • 28-10-2019, 13:00:58
    #5
    broscr adlı üyeden alıntı: mesajı görüntüle
    Activity
    package com.ridvan.example;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class MainActivity extends AppCompatActivity { private EditText name,lastName; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); name = findViewById(R.id.editTextName); lastName = findViewById(R.id.editTextLastName); button = findViewById(R.id.buttonToast); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (name.getText() != null && !name.getText().toString().equals("") && lastName.getText() != null && !lastName.getText().toString().equals("")){ Toast.makeText(MainActivity.this,name.getText().toString()+" " + lastName.getText().toString()+ " Hoş Geldiniz", Toast.LENGTH_LONG).show(); } } }); }}
    Xml Tarafı
    <?xml version="1.0" encoding="utf-8"?><RelativeLayout 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" tools:context=".MainActivity"> <EditText android:id="@+id/editTextName" android:layout_width="match_parent" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" android:layout_marginTop="20dp" android:hint="Name" android:layout_height="wrap_content" /> <EditText android:id="@+id/editTextLastName" android:layout_width="match_parent" android:layout_marginStart="30dp" android:layout_marginEnd="30dp" android:layout_marginTop="20dp" android:hint="Last Name" android:layout_below="@+id/editTextName" android:layout_height="wrap_content" /> <Button android:layout_width="wrap_content" android:layout_below="@+id/editTextLastName" android:layout_marginTop="20dp" android:id="@+id/buttonToast" android:layout_alignParentEnd="true" android:layout_marginEnd="30dp" android:layout_height="wrap_content" android:text="Toast Get"/></RelativeLayout>
    Teşekkür ederim hocam