NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Sayfa Geçişli
1.sayfa kullanıcı adı şifre giriş,2.sayfa tercih yapmaları ekleme 3.sayfa sonuçları görüntüle (menülü yazı 19,20)
:::::::::::::main activity-1 :::::::::::::
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:layout_margin="16dp"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:text="KULLANICI ADI"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/kAdi"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<TextView
android:text="ŞİFRE"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<EditText
android:id="@+id/sifre"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<Button
android:id="@+id/girisBtn"
android:layout_margin="16dp"
android:layout_gravity="center"
android:text="GÖNDER"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

package com.example.user.ikinciuyg;

import android.content.Intent;
import android.support.v7.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 {

EditText kullaniciAdi, sifre;
Button gonder;
String isim , parola;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

kullaniciAdi = findViewById(R.id.kAdi);
sifre = findViewById(R.id.sifre);
gonder = findViewById(R.id.girisBtn);



gonder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
isim = kullaniciAdi.getText().toString();
parola = sifre.getText().toString();
if(isim.equalsIgnoreCase("esra") && parola.equalsIgnoreCase("123"))
{
Toast.makeText(MainActivity.this, "gitdi", Toast.LENGTH_SHORT).show();
Intent gonder = new Intent(getApplicationContext(), Main2Activity.class);
gonder.putExtra("kullanici",isim);
//gonder.putExtra("sifre",parola);
startActivity(gonder);
}
}
});




}
}
:::::::::::::Main activity-2 :::::::::::::
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context=".Main2Activity">

<TextView
android:id="@+id/main2Kullanici"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<TextView
android:text="CİNSİYET"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<RadioGroup
android:id="@+id/cinsiyetGrup"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/rdbKadin"
android:text="KADIN"
android:layout_width="wrap_content"
android:layout_height="match_parent"></RadioButton>

<RadioButton
android:id="@+id/rdbErkek"
android:text="ERKEK"
android:layout_width="wrap_content"
android:layout_height="match_parent"></RadioButton>

</RadioGroup>

<TextView
android:text="Eğitim"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<RadioGroup
android:id="@+id/egitimGrup"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/rdbio"
android:text="io"
android:layout_width="wrap_content"
android:layout_height="match_parent"></RadioButton>

<RadioButton
android:id="@+id/rdbLise"
android:text="lise"
android:layout_width="wrap_content"
android:layout_height="match_parent"></RadioButton>

<RadioButton
android:id="@+id/rdbLisans"
android:text="lisans"
android:layout_width="wrap_content"
android:layout_height="match_parent"></RadioButton>

</RadioGroup>

<TextView
android:text="DİLLER"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />


<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<CheckBox
android:id="@+id/ingCheck"
android:text="İNGİLİZCE"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/trkCheck"
android:text="türkçe"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/ispCheck"
android:text="ispanyolca"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/itaCheck"
android:text="italyanca"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>

<TextView
android:text="prog. diller"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<CheckBox
android:id="@+id/c"
android:text="c"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/java"
android:text="java"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/csharp"
android:text="c#"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/piton"
android:text="pthyon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>
<Button
android:id="@+id/kaydetBtn"
android:text="KAYDET"
android:layout_margin="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />


</LinearLayout>

package com.example.user.ikinciuyg;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

public class Main2Activity extends AppCompatActivity {

TextView isimTv;
RadioGroup radioGrupCinsiyet,radioGrupEgitim;
RadioButton kadin,erkek,io,lise,lisans;
CheckBox dIng,dTurk,dIta,dIsp,pC,pCsharp,pJava,pPiton;
Button gosterbuton;
String veri,data="";
Boolean cinsiyet;
Byte count=0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);

isimTv = findViewById(R.id.main2Kullanici);
radioGrupCinsiyet = findViewById(R.id.cinsiyetGrup);
radioGrupEgitim = findViewById(R.id.egitimGrup);
kadin = findViewById(R.id.rdbKadin);
erkek = findViewById(R.id.rdbErkek);
io = findViewById(R.id.rdbio);
lise = findViewById(R.id.rdbLise);
lisans = findViewById(R.id.rdbLisans);
dIng = findViewById(R.id.ingCheck);
dTurk = findViewById(R.id.trkCheck);
dIta = findViewById(R.id.itaCheck);
dIsp = findViewById(R.id.ispCheck);
pC = findViewById(R.id.c);
pCsharp = findViewById(R.id.csharp);
pJava = findViewById(R.id.java);
pPiton = findViewById(R.id.piton);
gosterbuton = findViewById(R.id.kaydetBtn);

Intent intent = getIntent();
Bundle bundle = intent.getExtras();

String misim = bundle.getString("kullanici");

isimTv.setText(misim);

radioGrupCinsiyet.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if(kadin.isChecked())
{
cinsiyet=true;
}
else if (erkek.isChecked())
{
cinsiyet=false;
}

}
});


radioGrupEgitim.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if(io.isChecked())
{
cinsiyet=true;
}
else if (erkek.isChecked())
{
cinsiyet=false;
}

}
});

}
}

:::::::::::::Intent İle Hesap Makinesi :::::::::::::
main activity-1
package com.deneme.intent;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
Button btnAktar;
EditText editvize,etAd,editfinal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnAktar = findViewById(R.id.btnAktar);
editvize = findViewById(R.id.editvize);
etAd = findViewById(R.id.etAd);
editfinal = findViewById(R.id.editfinal);
btnAktar.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View view) {
byte v=
Byte.parseByte(editvize.getText().toString());
byte f=
Byte.parseByte(editfinal.getText().toString());
byte bn =(byte) ((v+f)/2);
String isim = etAd.getText().toString();
Intent i = new
Intent(MainActivity.this,Main2Activity.class);
i.putExtra("isim",isim);
i.putExtra("basari",bn);
startActivity(i);
}
});

}
}
main activity-2 : : :
package com.deneme.intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class Main2Activity extends AppCompatActivity {
TextView tvAd,tvSonuc;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
tvAd = findViewById(R.id.tvAd);
tvSonuc = findViewById(R.id.tvSonuc);
String ad = getIntent().getExtras().getString("isim","");
tvAd.setText(ad);
byte bn = getIntent().getExtras().getByte("basari",
(byte)0);
tvSonuc.setText(String.valueOf(bn));
}
}
-----------Spinner Renkler-----------

<?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">

<LinearLayout
android:id="@+id/ekranLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/sonucTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="150dp"
/>

<ListView
android:id="@+id/renkListView"
android:entries="@array/renkler"
android:layout_marginTop="50dp"
android:layout_width="match_parent"
android:layout_height="300dp">
</ListView>

</LinearLayout>

</RelativeLayout>


string.xml

<resources>
<string name="app_name">hafta2</string>

<string-array name="renkler">
<item>Kırmızı</item>
<item>Sarı</item>
<item>Yeşil</item>
<item>Mavi</item>
<item>Gri</item>
<item>Siyah</item>
</string-array>
</resources>


main act.

package com.example.user.hafta2;

import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

:::spinner veri ekleme dahil içinde :::
public class MainActivity extends AppCompatActivity {

//String renkler [] = {"Kırmızı","Sarı","Yeşil","Mavi","Pembe"}; -- string.xmlden alacak renkleri
//tuğçe ekleme yöntemi
// private String egitim={"eğitim","ilkokul"};
//private Spinner spinnerEğitim;
//private ArrayAdapter<String> dataAdapterForEğitim;

String renk[];
ListView renklerLV;
TextView renklerTV;
LinearLayout ekran;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//tuce
//spinnerEğitim = (Spinner) findViewById(R.id.spnEgitim);
//dataAdapterForEğitim = new ArrayAdapter<String>(context:this,android.R.layout.simple_spinner_item);//spinden sonrası gözükmüyor
renklerLV = findViewById(R.id.renkListView);
renklerTV = findViewById(R.id.sonucTextView);
ekran = findViewById(R.id.ekranLayout);
renk = getResources().getStringArray(R.array.renkler);

//birden fazla seçenek olduğı için set on item click listener

renklerLV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//renklerTV.setText(""+i);
// renklerTV.setText(String.valueOf(i));
renklerTV.setText(renk[i]);

switch (i) {
case 0:
ekran.setBackgroundColor(Color.RED);
break;
case 1:
ekran.setBackgroundColor(Color.YELLOW);
break;
case 2:
ekran.setBackgroundColor(Color.GREEN);
break;
case 3:
ekran.setBackgroundColor(Color.BLUE);
break;
case 4:
ekran.setBackgroundColor(Color.GRAY);
break;
case 5:
ekran.setBackgroundColor(Color.BLACK);
break;
}
}
});

}
}

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.