CrashAnalytics Added

This commit is contained in:
smileomi18@gmail.com
2023-08-23 17:12:05 +05:30
parent 6c0e7dc31d
commit be78cff112
5 changed files with 44 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ plugins {
id 'com.google.gms.google-services'
id 'androidx.navigation.safeargs.kotlin'
id 'kotlin-kapt'
id 'com.google.firebase.crashlytics'
}
android {
@@ -49,17 +50,19 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
//firebase
implementation platform('com.google.firebase:firebase-bom:32.1.0')
// firebase
implementation("com.google.firebase:firebase-crashlytics-ktx")
implementation platform("com.google.firebase:firebase-bom:32.2.2")
implementation("com.google.firebase:firebase-analytics-ktx")
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.firebaseui:firebase-ui-firestore:8.0.2'
implementation 'com.google.android.gms:play-services-auth:20.5.0'
implementation 'com.google.android.gms:play-services-auth:20.6.0'
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
// Coroutine Lifecycle Scopes
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
@@ -71,8 +74,8 @@ dependencies {
kapt "androidx.hilt:hilt-compiler:1.0.0"
// Navigation Component
implementation "androidx.navigation:navigation-fragment-ktx:2.7.0-beta02"
implementation "androidx.navigation:navigation-ui-ktx:2.7.0-beta02"
implementation "androidx.navigation:navigation-fragment-ktx:2.7.0"
implementation "androidx.navigation:navigation-ui-ktx:2.7.0"
// Retrofit + GSON
implementation "com.squareup.retrofit2:retrofit:2.9.0"
@@ -86,12 +89,12 @@ dependencies {
//image
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
//Room
implementation "androidx.room:room-ktx:2.6.0-alpha02"
implementation "androidx.room:room-runtime:2.6.0-alpha02"
kapt ("androidx.room:room-compiler:2.6.0-alpha02")
implementation "androidx.room:room-ktx:2.6.0-alpha03"
implementation "androidx.room:room-runtime:2.6.0-alpha03"
kapt ("androidx.room:room-compiler:2.6.0-alpha03")
// Barcode scanner
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'

View File

@@ -14,5 +14,6 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
}
}

View File

@@ -8,6 +8,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
@@ -42,6 +43,21 @@ class UserListFragment : BaseFragment() {
sharedPreference = requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
setupViews()
return binding.root
//
// val view = inflater.inflate(R.layout.fragment_user_list, container, false)
//
// val crashButton = Button(requireContext())
// crashButton.text = "Test Crash"
// crashButton.setOnClickListener {
// throw RuntimeException("Test Crash") // Force a crash
// }
//
// val layout = view.findViewById<ViewGroup>(R.id.fragment_layout)
// layout.addView(crashButton, ViewGroup.LayoutParams(
// ViewGroup.LayoutParams.MATCH_PARENT,
// ViewGroup.LayoutParams.WRAP_CONTENT))
//
// return view
}
override fun onResume() {

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
@@ -6,7 +9,13 @@
android:layout_height="match_parent"
android:padding="24dp"
tools:context="com.example.hposregistration.ui.fragments.UserListFragment">
<LinearLayout
android:visibility="gone"
android:id="@+id/fragment_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<TextView
android:id="@+id/tv_title"
style="@style/title1"
@@ -75,4 +84,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -6,4 +6,5 @@ plugins {
id 'androidx.navigation.safeargs' version '2.7.0-beta02' apply false
id 'com.google.dagger.hilt.android' version '2.46' apply false
id "com.google.gms.google-services" version "4.3.15" apply false
id 'com.google.firebase.crashlytics' version "2.9.8" apply false
}