https://github.com/sabo99/firebaseauth-phonenumber
Firebase Authentication with Phone Number & Kotlin Programming Android Studio
https://github.com/sabo99/firebaseauth-phonenumber
android-studio firebase-auth firebase-phone-authentication kotlin-android
Last synced: 8 months ago
JSON representation
Firebase Authentication with Phone Number & Kotlin Programming Android Studio
- Host: GitHub
- URL: https://github.com/sabo99/firebaseauth-phonenumber
- Owner: sabo99
- Created: 2021-12-16T14:44:30.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-31T04:29:56.000Z (almost 4 years ago)
- Last Synced: 2025-03-04T12:24:30.495Z (11 months ago)
- Topics: android-studio, firebase-auth, firebase-phone-authentication, kotlin-android
- Language: Kotlin
- Homepage:
- Size: 1.38 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#
Firebase Authentication with Phone Number
Authentication Android application using `Firebase` with the login system using **Phone Number**
### **App Features Firebase Authentication with Phone Number** :
- **_Firebase_**
- Authentication with `PhoneNumber`
- Verification with `SmsCode`
- **_Country Code Picker_**
- Change Country Code | Ex : `(+62) ID`
- Auto Detect Country Code
## Important!
### Add Firebase to your Android project go to `Firebase Setup`
## Design UI App Firebase Authentication with Phone Number
### **`Preview Firebase Auth with Phone Number`**

### **`Preview UI FirebaseAuth-PhoneNumber`**
| Name Page | Preview UI |
| :----------: | :--------------------: |
| `OTP Send` |
|
| `OTP Send with Phone Number` |
|
| `Country Code Picker` |
|
| `OTP Verify` |
|
| `OTP Verify - Resend SmsCode` |
|
| `Home` |
|
## Result on Firebase Console
### **`Authentication`**

## Dependencies used
```groovy
/** Firebase */
implementation platform('com.google.firebase:firebase-bom:29.0.2')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.hbb20:ccp:2.5.0'
```
### Integration Step Used Binding in Kotlin
1. Add **viewBinding `true`** `build.gralde (Module)`
```groovy
android {
...
buildFeatures {
viewBinding true
}
}
```
2. Activity Kotlin Class
```kotlin
class MainActivity : AppCompatActivity() {
/** Add this */
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
/** Add this */
binding = ActivityMainBinding.inflate(layoutInflater)
/** Change this */
setContentView(binding.root)
/** Without findViewById */
binding.textView.text = "Bye bye findViewById"
}
}
```
3. Activity Java Class
```java
public class MainActivity extends AppCompatActivity {
/** Add this */
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/** Add this */
binding = ActivityMainBinding.inflate(getLayoutInflater());
/** Change this */
setContentView(binding.getRoot());
/** Without findViewById */
binding.textView.setText("Bye bye findViewById");
}
}
```
**binding** in kotlin can be used directly without initializing **findViewById** on widgets in layout xml