NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

3 Ekranlı uygulama login, bilgi gir, sonuç yani 2. sayfayı görüntüle menüden renk boyut seç
*** projeyi açarken ilk olarak BASİC ekran aç adı: MainActivity olsun
*** ProcessActivity --> Empty ekran ve LoginActivity-->> Empty ekran

---MANİFEST---
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".LoginActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
<activity android:name=".ProcessActivity"></activity>
</application>

---menu_main.xml---
<item
android:id="@+id/redColor"
android:orderInCategory="100"
app:showAsAction="never"
android:title="kırmızı">

</item>
<item
android:id="@+id/bluecolor"
android:orderInCategory="100"
app:showAsAction="never"
android:title="mavi">

</item>
<item
android:id="@+id/blackcolor"
android:orderInCategory="100"
app:showAsAction="never"
android:title="black">

</item>


<item
android:id="@+id/fourteenSize"
android:orderInCategory="100"
app:showAsAction="never"
android:title="14">

</item>
<item
android:id="@+id/sixteenSize"
android:orderInCategory="100"
app:showAsAction="never"
android:title="16">

</item>
<item
android:id="@+id/eightteenSize"
android:orderInCategory="100"
app:showAsAction="never"
android:title="18">

</item>

---content_main.xml---
<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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">

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

</LinearLayout>


---activity_process.xml---
<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=".ProcessActivity">

<TextView
android:id="@+id/processUser"
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/genderGroup"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

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

<RadioButton
android:id="@+id/rdbMan"
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/educationGroup"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

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

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

<RadioButton
android:id="@+id/rdbBac"
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/php"
android:text="php"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

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


</LinearLayout>

---activity_login.xml---
<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/userName"
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/password"
android:layout_margin="16dp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

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

</LinearLayout>

---ProcessActivity.JAVA---
public class ProcessActivity extends AppCompatActivity {
TextView isimTv;
RadioGroup radioGroupGender, radioGroupEducation;
RadioButton woman, man, primary, highSchool, bachelor;
CheckBox dIng, dTurk, dIta, dIsp, pC, pCsharp, pJava, pPhp;
Button saveBtn;
String veri="", data="", dilVeri="",veriGender="";
Boolean gender;
Byte count = 0;

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

isimTv = findViewById(R.id.processUser);
radioGroupGender = findViewById(R.id.genderGroup);
radioGroupEducation = findViewById(R.id.educationGroup);
woman = findViewById(R.id.rdbWoman);
man = findViewById(R.id.rdbMan);
primary = findViewById(R.id.rdbPr);
highSchool = findViewById(R.id.rdbHs);
bachelor = findViewById(R.id.rdbBac);
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);
pPhp = findViewById(R.id.php);
saveBtn = findViewById(R.id.saveBtn);

Intent intent = getIntent();
Bundle bundle = intent.getExtras();
String misim = bundle.getString("kullanici");
isimTv.setText(misim);

radioGroupGender.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if (woman.isChecked()) {
gender = true;
veriGender += "kadın";
} else if (man.isChecked()) {
gender = false;
veriGender += "erkek";
}

}
});


radioGroupEducation.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if (primary.isChecked()) {
veri += "İlkokul";
} else if (highSchool.isChecked()) {
veri += "Lise";

} else if (bachelor.isChecked()) {
veri += "lisans";
}

}
});

saveBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (pC.isChecked()) {
data += "C ";
}
if (pCsharp.isChecked()) {
data += "C# ";
}
if (pJava.isChecked()) {
data += "Java ";
}
if (pPhp.isChecked()) {
data += "Php ";
}
if (dIng.isChecked()) {
dilVeri += "İngilizce ";
}
if (dTurk.isChecked()) {
dilVeri += "Türkçe ";
}
if (dIsp.isChecked()) {
dilVeri += "İspanyolca ";
}
if (dIta.isChecked()) {
dilVeri += "İtalyanca ";
}
// Toast.makeText(ProcessActivity.this, "..."+veriGender+veri+dilVeri+data, Toast.LENGTH_LONG).show();
sendToData();
}

});
}

private void sendToData() {
Intent sendData = new Intent(getApplicationContext(), MainActivity.class);
sendData.putExtra("send_gender", veriGender);
sendData.putExtra("send_education", veri);
sendData.putExtra("send_language", dilVeri);
sendData.putExtra("send_proglang", data);
startActivity(sendData);
}
}

---MainActivity.JAVA---
public class MainActivity extends AppCompatActivity {
TextView result;
String metin;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
// setSupportActionBar(toolbar);

result = findViewById(R.id.resultText);
// metin = result.getText().toString();

Intent incomingData = getIntent();
Bundle bundle = incomingData.getExtras();
String gender = bundle.getString("send_gender");
String edu = bundle.getString("send_education");
String lang = bundle.getString("send_language");
String proglang = bundle.getString("send_proglang");
result.setText(gender + "n" + edu + "n" + "n" + lang + "n" + proglang);


FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.fourteenSize) {
result.setTextSize(14);
} else if (id == R.id.sixteenSize) {
result.setTextSize(16);
} else if (id == R.id.eightteenSize) {
result.setTextSize(18);
} else if (id == R.id.blackcolor) {
result.setTextColor(Color.BLACK);
} else if (id == R.id.bluecolor) {
result.setTextColor(Color.BLUE);
} else if (id == R.id.redColor) {
result.setTextColor(Color.RED);
}

return super.onOptionsItemSelected(item);
}
}

---LoginActivity.JAVA---
public class LoginActivity extends AppCompatActivity {
EditText userName, password;
Button saveBtn;
String isim, parola;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
userName = findViewById(R.id.userName);
password = findViewById(R.id.password);
saveBtn = findViewById(R.id.loginBtn);


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


}
}















     
 
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.