kzlsn
Üyeliği Durdurulmuş
Banlı Kullanıcı
-
Üyelik
08.04.2018
-
Yaş/Cinsiyet
24 / E
-
Meslek
serbest
-
Konum
İstanbul Anadolu
-
Ad Soyad
S** K**
-
Mesajlar
127
-
Beğeniler
24 / 31
-
Ticaret
1, (%100)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.tutkugurur.realchat"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.android.support recyclerview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
Şimdi dener misin ?
-
Üyelik
16.12.2016
-
Yaş/Cinsiyet
31 / E
-
Meslek
Öğrenci
-
Konum
Kütahya
-
Ad Soyad
T** K**
-
Mesajlar
22
-
Beğeniler
3 / 0
-
Ticaret
0, (%0)
Giriş Aktivty
package com.tutkugurur.realchat;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.inputmethod.InputConnectionCompat;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.annotations.NotNull;
public class GirisActivity extends AppCompatActivity {
EditText kullaniciAdiEditText;
Button kayitOlButton;
FirebaseDatabase firebaseDatabase;
DatabaseReference reference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_giris);
tanimla();
}
public void tanimla()
{ kullaniciAdiEditText = (EditText)findViewById(R.id.kullaniciEditText);
kayitOlButton = (Button)findViewById(R.id.kayitOlButton);
firebaseDatabase = FirebaseDatabase.getInstance();
reference = firebaseDatabase.getReference();
kayitOlButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String username = kullaniciAdiEditText.getText().toString();
kullaniciAdiEditText.setText("");
ekle(username);
}
public void ekle(final String kadi){
{ reference.child("Kullanıcılar").child(kadi).child("kullanicidiadi").setValue(kadi).addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if(task.isSuccessful()) {
Toast.makeText(getApplicationContext(),"Başarı ile Kayıt Oldunuz", Toast.LENGTH_LONG).show(); }
Intent intent = new Intent(GirisActivity.this,MainActivity.class);
intent.putExtra("kadi",kadi);
startActivity(intent);
}
});
};
}
}
);
}
}
Main Aktivty
package com.tutkugurur.realchat;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
FirebaseDatabase firebaseDatabase;
DatabaseReference reference;
List list;
String userName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tanimla();
listele();
}
public void tanimla()
{
userName = getIntent().getExtras().getString("kadi");
firebaseDatabase = FirebaseDatabase.getInstance();
reference=firebaseDatabase.getReference();
list = new ArrayList<>();
}
public void listele()
{
reference.child("Kullanıcılar").addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
if (!dataSnapshot.getKey().equals("userName"))
list.add(dataSnapshot.getKey());
Log.i("Kullanıcı", dataSnapshot.getKey());
Log.i("Kullanıcı : ", dataSnapshot.getKey());
}
@Override
public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
}
-
Üyelik
16.12.2016
-
Yaş/Cinsiyet
31 / E
-
Meslek
Öğrenci
-
Konum
Kütahya
-
Ad Soyad
T** K**
-
Mesajlar
22
-
Beğeniler
3 / 0
-
Ticaret
0, (%0)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.tutkugurur.realchat"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.android.support recyclerview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
kzlsn
Üyeliği Durdurulmuş
Banlı Kullanıcı
-
Üyelik
08.04.2018
-
Yaş/Cinsiyet
24 / E
-
Meslek
serbest
-
Konum
İstanbul Anadolu
-
Ad Soyad
S** K**
-
Mesajlar
127
-
Beğeniler
24 / 31
-
Ticaret
1, (%100)
Anydesk id atar mısınız ?
-
Üyelik
02.01.2014
-
Yaş/Cinsiyet
30 / E
-
Meslek
Öğrenci
-
Konum
Ankara
-
Ad Soyad
R** Ç**
-
Mesajlar
248
-
Beğeniler
49 / 60
-
Ticaret
2, (%100)
"apply plugin: 'com.google.gms.google-services'" kodu app gradle dosyasının en altında olacak
www