Skip to content

Instantly share code, notes, and snippets.

View nitesh-singh-1307's full-sized avatar

Nitesh Singh nitesh-singh-1307

  • L&T pvt ltd
  • Banglore
View GitHub Profile
@nitesh-singh-1307
nitesh-singh-1307 / MainActivity
Created May 1, 2019 17:25
log in with email id
mAuth.createUserWithEmailAndPassword("axy@gmail.com", "123456")
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d("CreateUser", "createUserWithEmail:success");
FirebaseUser user = mAuth.getCurrentUser();
updateUI(user);
} else {
private FirebaseAuth mAuth;
private EditText edit_txtemail,edit_txtpass;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mAuth = FirebaseAuth.getInstance();
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
dependencies {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-auth:11.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#FFC107</color>
<color name="colorPrimaryDark">#FFA000</color>
<color name="backgroundcolor">#fcfcfc</color>
<color name="lightgray">#ededed</color>
<color name="deeppurple">#7c4dff</color>
<color name="yello">#ffb300</color>
<color name="green">#00bfa5</color>
<color name="colorAccent">#FF4081</color>
package com.example.demo.autocomplete;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
public class MainActivity extends AppCompatActivity {
AutoCompleteTextView autoCompleteTextView;
String[] names = {"Rick","Amul","Samul","Denim","Lee"};
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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">
<AutoCompleteTextView
android:id="@+id/autocomplete"