java.lang.IllegalArgumentException: Given String is empty or null - java

i am making login page so i have connected this app with firebase database there is email and password in database so i am trying to
Signinwithemailandpassword but it doesn't work whenever i try to run the apps it crashes
loginpage.java
public class loginpage extends AppCompatActivity {
ActivityLoginpageBinding binding;
Button loginbtn;
TextView login;
FirebaseAuth auth;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityLoginpageBinding.inflate(getLayoutInflater());
setContentView(R.layout.activity_loginpage);
login=findViewById(R.id.login);
auth=FirebaseAuth.getInstance();
loginbtn=findViewById(R.id.loginbtn);
loginbtn.setOnClickListener(new View.OnClickListener() {
final String email=binding.email.getText().toString();
final String password=binding.pwd.getText().toString();
#Override
public void onClick(View view) {
auth.signInWithEmailAndPassword(binding.email.getText().toString(),binding.pwd.getText().toString()).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
Intent intent=new Intent(loginpage.this,MainActivity.class);
startActivity(intent);
Toast.makeText(loginpage.this, "successfull", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(loginpage.this, "failed", Toast.LENGTH_SHORT).show();
Log.d("MyTag", task.getException().getMessage());
}
}
});
}
});
login.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent=new Intent(loginpage.this,signup.class);
startActivity(intent);
}
});
}
}
loginpage.xml
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".loginpage">
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="Instagram"
android:textSize="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="242dp"
android:layout_height="235dp"
android:layout_marginTop="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView14"
app:srcCompat="#drawable/instagram" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to social world"
android:textSize="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView3" />
<EditText
android:id="#+id/email"
android:layout_width="297dp"
android:layout_height="49dp"
android:layout_marginTop="44dp"
android:background="#drawable/inputbg"
android:ems="10"
android:hint="Email"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.491"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView16" />
<EditText
android:id="#+id/pwd"
android:layout_width="297dp"
android:layout_height="49dp"
android:layout_marginTop="16dp"
android:background="#drawable/inputbg"
android:ems="10"
android:hint="Password"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.491"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/email"
app:layout_constraintVertical_bias="0.017" />
<Button
android:id="#+id/loginbtn"
android:layout_width="298dp"
android:layout_height="51dp"
android:layout_marginTop="36dp"
android:text="login"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/pwd" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Don't have a account? "
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/login"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/loginbtn"
app:layout_constraintVertical_bias="0.859" />
<TextView
android:id="#+id/login"
android:layout_width="63dp"
android:layout_height="18dp"
android:text="Sign up!"
android:textColor="#F10606"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/textView15"
app:layout_constraintTop_toBottomOf="#+id/loginbtn"
app:layout_constraintVertical_bias="0.86" />
</androidx.constraintlayout.widget.ConstraintLayout>`
Error
12/24 12:13:07: Launching 'app' on Pixel 5 API 26.
App restart successful without requiring a re-install.
$ adb shell am start -n "com.example.instagram/com.example.instagram.signup" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 28962 on device 'Pixel_5_API_26 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/zygote: Late-enabling -Xcheck:jni
W/zygote: Unexpected CPU variant for X86 using defaults: x86
I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
W/zygote: Skipping duplicate class check due to unrecognized classloader
I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:86 and remote module com.google.android.gms.measurement.dynamite:15
I/DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
D/FirebaseAuth: Notifying id token listeners about user ( xmoP2dPpYhUD9acalVCdTqBiJ7e2 ).
I/FirebaseInitProvider: FirebaseApp initialization successful
I/zygote: Background concurrent copying GC freed 5896(1215KB) AllocSpace objects, 2(40KB) LOS objects, 62% free, 910KB/2MB, paused 1.368ms total 117.164ms
V/FA: onActivityCreated
V/FA: App measurement collection enabled
V/FA: App measurement enabled for app package, google app id: com.example.instagram, 1:582042892352:android:f97df8209dee5aa33f87a5
I/FA: App measurement initialized, version: 74029
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.instagram
D/FA: Debug-level message logging enabled
D/FA: Resetting session stitching token to not null
I/zygote: NativeAllocBackground concurrent copying GC freed 4528(591KB) AllocSpace objects, 7(140KB) LOS objects, 59% free, 1046KB/2MB, paused 3.590ms total 105.851ms
V/FA: Connecting to remote service
V/FA: Detected application was in foreground
V/FA: Session started, time: 37468155
I/zygote: Do partial code cache collection, code=30KB, data=30KB
V/FA: Connection attempt already in progress
I/zygote: After code cache collection, code=24KB, data=28KB
I/zygote: Increasing code cache capacity to 128KB
I/FA: Tag Manager is not found and thus will not be used
I/zygote: Do partial code cache collection, code=24KB, data=46KB
I/zygote: After code cache collection, code=24KB, data=46KB
I/zygote: Increasing code cache capacity to 256KB
I/zygote: JIT allocated 71KB for compiled code of void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
D/OpenGLRenderer: HWUI GL Pipeline
V/FA: Connection attempt already in progress
I/chatty: uid=10097(u0_a97) Measurement Wor identical 1 line
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 37468263
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
D/: HostConnection::get() New Host Connection established 0x9f3f98c0, tid 29000
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
D/EGL_emulation: eglCreateContext: 0x9f4d4620: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x9f4d4620: ver 2 0 (tinfo 0x9f6ff450)
D/EGL_emulation: eglMakeCurrent: 0x9f4d4620: ver 2 0 (tinfo 0x9f6ff450)
I/Choreographer: Skipped 51 frames! The application may be doing too much work on its main thread.
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 7
W/View: dispatchProvideAutofillStructure(): not laid out, ignoring
I/AssistStructure: Flattened final assist data: 3448 bytes, containing 1 windows, 12 views
I/zygote: Do full code cache collection, code=124KB, data=61KB
I/zygote: After code cache collection, code=120KB, data=46KB
V/FA: Inactivity, disconnecting from the service
I/zygote: Do partial code cache collection, code=122KB, data=50KB
I/zygote: After code cache collection, code=122KB, data=50KB
I/zygote: Increasing code cache capacity to 512KB
V/FA: Recording user engagement, ms: 54118
V/FA: onActivityCreated
V/FA: Connecting to remote service
V/FA: Connection attempt already in progress
V/FA: Activity paused, time: 37522383
V/FA: Activity resumed, time: 37522548
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
D/EGL_emulation: eglMakeCurrent: 0x9f4d4620: ver 2 0 (tinfo 0x9f6ff450)
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 4
W/View: dispatchProvideAutofillStructure(): not laid out, ignoring
I/AssistStructure: Flattened final assist data: 2780 bytes, containing 1 windows, 10 views
I/zygote: Do full code cache collection, code=249KB, data=167KB
I/zygote: After code cache collection, code=249KB, data=134KB
V/FA: Inactivity, disconnecting from the service
I/zygote: Do partial code cache collection, code=249KB, data=139KB
I/zygote: After code cache collection, code=249KB, data=139KB
I/zygote: Increasing code cache capacity to 1024KB
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.instagram, PID: 28962
java.lang.IllegalArgumentException: Given String is empty or null
at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(com.google.android.gms:play-services-basement##18.1.0:2)
at com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(com.google.firebase:firebase-auth##21.1.0:1)
at com.example.instagram.loginpage$1.onClick(loginpage.java:44)
at android.view.View.performClick(View.java:6256)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1219)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
need to find out the mistake and why app crashes

Where have you set the values for the email and password when you are authenticating with firebase?
In your code, you are doing binding.email.getText().toString() and binding.pwd.getText().toString(). These are potentially empty as I am not seeing you set the value of those views either in your xml or in your code and hence the exception is being thrown.
Just try setting those in your xml or via code and try authentication, it should work.

Related

My login activity keeps on crashing when I press the login button [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 5 months ago.
I am new to android studio and I don't know how to fix this. My login activity keeps on crashing if I click the login button. I just copied and replaced some details from my registration activity and it's working totally fine. I don't know what's the problem here someone please help me
Here's my XML:
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Login"
android:background="#drawable/bg">
<TextView
android:id="#+id/tVLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/alatsi"
android:text="LOGIN"
android:textColor="#color/sea5"
android:textSize="50sp"
android:textStyle="bold"
android:layout_marginTop="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.097" />
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/inputEmailLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/tVLogo"
android:layout_marginTop="50dp"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:inputType="textEmailAddress"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/inputPasswordLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/inputEmailLog"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="#+id/forgotPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Forgot Password"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="#+id/inputPasswordLog"
app:layout_constraintTop_toBottomOf="#+id/inputPasswordLog" />
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/btnLogin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:background="#drawable/bg_btn"
android:textColor="#color/white"
android:text="Login"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/forgotPassword" />
<TextView
android:id="#+id/tVNewAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Create new Account"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/btnLogin" />
</androidx.constraintlayout.widget.ConstraintLayout>
Here's my java code:
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.material.textfield.TextInputLayout;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
public class Login extends AppCompatActivity {
private TextInputLayout inputEmail, inputPassword;
Button log;
TextView forgotPassword, createNewAccount;
ProgressDialog mLoadingBar;
FirebaseAuth mAuth;
ProgressBar progressBar;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
inputEmail = findViewById(R.id.inputEmailLog);
inputPassword = findViewById(R.id.inputPasswordLog);
log = findViewById(R.id.btnLogin);
forgotPassword = findViewById(R.id.forgotPassword);
createNewAccount = findViewById(R.id.tVNewAccount);
createNewAccount.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent = new Intent(Login.this, Register.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
});
log.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
String email = inputEmail.getEditText().getText().toString();
String password = inputPassword.getEditText().getText().toString();
if (email.isEmpty() || !email.contains("#gmail")){
showError(inputEmail, "Email is not valid");
} else if(password.isEmpty() || password.length()<5) {
showError(inputPassword, "Password must be more than 5 characters");
} else {
mLoadingBar.setTitle("Logging in...");
mLoadingBar.setMessage("Please wait...");
mLoadingBar.setCanceledOnTouchOutside(false);
mLoadingBar.show();
mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task) {
if(task.isSuccessful()) {
mLoadingBar.dismiss();
Toast.makeText(Login.this, "Login Successful", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Login.this, Home.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
} else {
mLoadingBar.dismiss();
Toast.makeText(Login.this, "Login Failed", Toast.LENGTH_SHORT).show();
}
}
});
}
}
});
}
private void showError(TextInputLayout field, String text) {
field.setError(text);
field.requestFocus();
}
}
Here's the logcat:
2022-09-29 21:43:46.331 15808-15808/com.example.asinantravelmate I/sinantravelmat: Late-enabling -Xcheck:jni
2022-09-29 21:43:46.560 15808-15808/com.example.asinantravelmate D/ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
2022-09-29 21:43:47.502 15808-15808/com.example.asinantravelmate D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10468; state: ENABLED
2022-09-29 21:43:48.138 15808-15808/com.example.asinantravelmate V/GraphicsEnvironment: ANGLE Developer option for 'com.example.asinantravelmate' set to: 'default'
2022-09-29 21:43:48.138 15808-15808/com.example.asinantravelmate V/GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
2022-09-29 21:43:48.149 15808-15808/com.example.asinantravelmate D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-09-29 21:43:48.151 15808-15808/com.example.asinantravelmate D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-09-29 21:43:48.195 15808-15808/com.example.asinantravelmate I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2022-09-29 21:43:48.310 15808-15808/com.example.asinantravelmate D/FirebaseAuth: Notifying id token listeners about user ( PFwouMYoLoVGe6uo8YQpkFjb07b2 ).
2022-09-29 21:43:48.316 15808-15808/com.example.asinantravelmate I/FirebaseInitProvider: FirebaseApp initialization successful
2022-09-29 21:43:48.429 15808-15953/com.example.asinantravelmate I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:83 and remote module com.google.android.gms.measurement.dynamite:79
2022-09-29 21:43:48.429 15808-15953/com.example.asinantravelmate I/DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
2022-09-29 21:43:48.605 15808-15953/com.example.asinantravelmate V/FA: onActivityCreated
2022-09-29 21:43:48.817 15808-15808/com.example.asinantravelmate W/sinantravelmat: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
2022-09-29 21:43:48.818 15808-15808/com.example.asinantravelmate W/sinantravelmat: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
2022-09-29 21:43:48.903 15808-16064/com.example.asinantravelmate V/FA: App measurement collection enabled
2022-09-29 21:43:48.908 15808-16064/com.example.asinantravelmate V/FA: App measurement enabled for app package, google app id: com.example.asinantravelmate, 1:361014781921:android:9633899b6124c9538614a0
2022-09-29 21:43:48.913 15808-16064/com.example.asinantravelmate I/FA: App measurement initialized, version: 73000
2022-09-29 21:43:48.914 15808-16064/com.example.asinantravelmate I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2022-09-29 21:43:48.915 15808-16064/com.example.asinantravelmate I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.asinantravelmate
2022-09-29 21:43:48.915 15808-16064/com.example.asinantravelmate D/FA: Debug-level message logging enabled
2022-09-29 21:43:49.115 15808-15808/com.example.asinantravelmate W/libc: Access denied finding property "ro.vendor.perf.scroll_opt.heavy_app"
2022-09-29 21:43:49.202 15808-16064/com.example.asinantravelmate V/FA: Connecting to remote service
2022-09-29 21:43:49.245 15808-16064/com.example.asinantravelmate V/FA: Detected application was in foreground
2022-09-29 21:43:49.251 15808-16064/com.example.asinantravelmate V/FA: Session started, time: 1353029547
2022-09-29 21:43:49.275 15808-15808/com.example.asinantravelmate I/BufferQueueConsumer: [](id:3dc000000000,api:0,p:-1,c:15808) connect: controlledByApp=false
2022-09-29 21:43:49.285 15808-15808/com.example.asinantravelmate I/BLASTBufferQueue: [ViewRootImpl[MainActivity]#0] constructor()
2022-09-29 21:43:49.363 15808-16014/com.example.asinantravelmate D/hw-ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
2022-09-29 21:43:49.390 15808-16064/com.example.asinantravelmate V/FA: Connection attempt already in progress
2022-09-29 21:43:49.392 15808-16014/com.example.asinantravelmate E/OpenGLRenderer: Device claims wide gamut support, cannot find matching config, error = EGL_SUCCESS
2022-09-29 21:43:49.392 15808-16014/com.example.asinantravelmate W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
2022-09-29 21:43:49.396 15808-16064/com.example.asinantravelmate I/FA: Tag Manager is not found and thus will not be used
2022-09-29 21:43:49.463 15808-16014/com.example.asinantravelmate I/BufferQueueProducer: [ViewRootImpl[MainActivity]#0(BLAST Consumer)0](id:3dc000000000,api:1,p:15808,c:15808) connect: api=1 producerControlledByApp=true
2022-09-29 21:43:49.540 15808-16155/com.example.asinantravelmate E/ion: ioctl c0044901 failed with code -1: Invalid argument
2022-09-29 21:43:49.547 15808-16014/com.example.asinantravelmate D/hw-ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
2022-09-29 21:43:49.745 15808-16064/com.example.asinantravelmate V/FA: Connection attempt already in progress
2022-09-29 21:43:49.767 15808-16064/com.example.asinantravelmate V/FA: Connection attempt already in progress
2022-09-29 21:43:49.776 15808-16064/com.example.asinantravelmate V/FA: Connection attempt already in progress
2022-09-29 21:43:49.776 15808-16064/com.example.asinantravelmate V/FA: Activity resumed, time: 1353029367
2022-09-29 21:43:50.056 15808-16014/com.example.asinantravelmate E/OpenGLRenderer: fbcNotifyFrameComplete error: undefined symbol: fbcNotifyFrameComplete
2022-09-29 21:43:50.056 15808-16014/com.example.asinantravelmate E/OpenGLRenderer: fbcNotifyNoRender error: undefined symbol: fbcNotifyNoRender
2022-09-29 21:43:50.091 15808-16064/com.example.asinantravelmate V/FA: Connection attempt already in progress
2022-09-29 21:43:50.092 15808-16064/com.example.asinantravelmate V/FA: Connection attempt already in progress
2022-09-29 21:43:50.171 15808-15808/com.example.asinantravelmate V/ImeFocusController: onWindowFocus: DecorView#56b6cff[MainActivity] softInputMode=STATE_UNSPECIFIED|ADJUST_PAN|IS_FORWARD_NAVIGATION
2022-09-29 21:43:50.171 15808-15808/com.example.asinantravelmate V/ImeFocusController: Restarting due to isRestartOnNextWindowFocus as true
2022-09-29 21:43:50.172 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=DecorView#56b6cff[MainActivity], mServedView=null
2022-09-29 21:43:50.172 15808-15808/com.example.asinantravelmate V/ImeFocusController: checkFocus: view=null next=DecorView#56b6cff[MainActivity] force=true package=<none>
2022-09-29 21:43:50.181 15808-16064/com.example.asinantravelmate D/FA: Connected to remote service
2022-09-29 21:43:50.207 15808-16064/com.example.asinantravelmate V/FA: Processing queued up service tasks: 7
2022-09-29 21:43:51.111 15808-16064/com.example.asinantravelmate V/FA: Recording user engagement, ms: 2033
2022-09-29 21:43:51.159 15808-15953/com.example.asinantravelmate V/FA: onActivityCreated
2022-09-29 21:43:51.234 15808-16064/com.example.asinantravelmate V/FA: Activity paused, time: 1353031402
2022-09-29 21:43:51.239 15808-15808/com.example.asinantravelmate D/skia: SkJpegCodec::onGetPixels +
2022-09-29 21:43:51.259 15808-15808/com.example.asinantravelmate D/skia: SkJpegCodec::onGetPixels -
2022-09-29 21:43:51.623 15808-16064/com.example.asinantravelmate V/FA: Activity resumed, time: 1353031919
2022-09-29 21:43:51.718 15808-15808/com.example.asinantravelmate I/BufferQueueConsumer: [](id:3dc000000001,api:0,p:-1,c:15808) connect: controlledByApp=false
2022-09-29 21:43:51.719 15808-15808/com.example.asinantravelmate I/BLASTBufferQueue: [ViewRootImpl[Login]#1] constructor()
2022-09-29 21:43:51.722 15808-16014/com.example.asinantravelmate I/BufferQueueProducer: [ViewRootImpl[Login]#1(BLAST Consumer)1](id:3dc000000001,api:1,p:15808,c:15808) connect: api=1 producerControlledByApp=true
2022-09-29 21:43:51.956 15808-15808/com.example.asinantravelmate V/ImeFocusController: onWindowFocus: DecorView#e3cd112[Login] softInputMode=STATE_UNSPECIFIED|ADJUST_PAN|IS_FORWARD_NAVIGATION
2022-09-29 21:43:51.957 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=DecorView#e3cd112[Login], mServedView=null
2022-09-29 21:43:51.957 15808-15808/com.example.asinantravelmate V/ImeFocusController: checkFocus: view=null next=DecorView#e3cd112[Login] force=false package=<none>
2022-09-29 21:43:52.273 15808-16014/com.example.asinantravelmate I/BufferQueueProducer: [ViewRootImpl[MainActivity]#0(BLAST Consumer)0](id:3dc000000000,api:1,p:15808,c:15808) disconnect: api 1
2022-09-29 21:43:52.284 15808-15808/com.example.asinantravelmate I/BLASTBufferQueue: [ViewRootImpl[MainActivity]#0] destructor()
2022-09-29 21:43:52.284 15808-15808/com.example.asinantravelmate I/BufferQueueConsumer: [ViewRootImpl[MainActivity]#0(BLAST Consumer)0](id:3dc000000000,api:0,p:-1,c:15808) disconnect
2022-09-29 21:43:52.308 15808-16305/com.example.asinantravelmate I/BLASTBufferQueue: releaseBufferCallbackThunk bufferId:67894843015168 framenumber:1 blastBufferQueue is dead
2022-09-29 21:43:54.437 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F.P.... 0,0-936,167}, mServedView=DecorView#e3cd112[Login]
2022-09-29 21:43:54.455 15808-15808/com.example.asinantravelmate V/ImeFocusController: checkFocus: view=DecorView#e3cd112[Login] next=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F.P..ID 0,0-936,167 aid=1073741824} force=false package=com.example.asinantravelmate
2022-09-29 21:43:54.463 15808-15808/com.example.asinantravelmate D/CompatibilityChangeReporter: Compat change id reported: 163400105; UID 10468; state: ENABLED
2022-09-29 21:43:54.521 15808-15808/com.example.asinantravelmate I/AssistStructure: Flattened final assist data: 2372 bytes, containing 1 windows, 15 views
2022-09-29 21:43:54.899 15808-15808/com.example.asinantravelmate I/AssistStructure: Flattened final assist data: 2372 bytes, containing 1 windows, 15 views
2022-09-29 21:43:55.465 15808-15808/com.example.asinantravelmate D/InsetsController: show(ime(), fromIme=true)
2022-09-29 21:43:55.521 15808-15808/com.example.asinantravelmate D/InsetsController: show(ime(), fromIme=true)
2022-09-29 21:43:56.681 15808-16064/com.example.asinantravelmate V/FA: Inactivity, disconnecting from the service
2022-09-29 21:43:59.561 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F....ID 0,0-936,167 aid=1073741824}, mServedView=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F....ID 0,0-936,167 aid=1073741824}
2022-09-29 21:43:59.612 15808-15808/com.example.asinantravelmate V/ImeFocusController: onWindowFocus: com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F....ID 0,0-936,167 aid=1073741824} softInputMode=STATE_UNSPECIFIED|ADJUST_PAN
2022-09-29 21:43:59.612 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F....ID 0,0-936,167 aid=1073741824}, mServedView=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. .F....ID 0,0-936,167 aid=1073741824}
2022-09-29 21:44:07.605 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. ........ 0,0-936,167 aid=1073741824}, mServedView=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. ........ 0,0-936,167 aid=1073741824}
2022-09-29 21:44:07.610 15808-15808/com.example.asinantravelmate D/ImeFocusController: onViewFocusChanged, view=com.google.android.material.textfield.TextInputEditText{d744ea6 VFED..CL. .F.P.... 0,0-936,167 aid=1073741825}, mServedView=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. ......ID 0,0-936,167 aid=1073741824}
2022-09-29 21:44:07.616 15808-15808/com.example.asinantravelmate V/ImeFocusController: checkFocus: view=com.google.android.material.textfield.TextInputEditText{645fcb3 VFED..CL. ......ID 0,0-936,167 aid=1073741824} next=com.google.android.material.textfield.TextInputEditText{d744ea6 VFED..CL. .F.P..ID 0,0-936,167 aid=1073741825} force=false package=com.example.asinantravelmate
2022-09-29 21:44:07.672 15808-15808/com.example.asinantravelmate I/AssistStructure: Flattened final assist data: 2396 bytes, containing 1 windows, 15 views
2022-09-29 21:44:11.502 15808-15808/com.example.asinantravelmate D/CompatibilityChangeReporter: Compat change id reported: 150939131; UID 10468; state: ENABLED
2022-09-29 21:44:12.170 15808-15808/com.example.asinantravelmate D/AndroidRuntime: Shutting down VM
--------- beginning of crash
2022-09-29 21:44:12.173 15808-15808/com.example.asinantravelmate E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.asinantravelmate, PID: 15808
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ProgressDialog.setTitle(java.lang.CharSequence)' on a null object reference
at com.example.asinantravelmate.Login$2.onClick(Login.java:60)
at android.view.View.performClick(View.java:7512)
at android.view.View.performClickInternal(View.java:7489)
at android.view.View.access$3700(View.java:857)
at android.view.View$PerformClick.run(View.java:29017)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8396)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
2022-09-29 21:44:12.236 15808-15808/com.example.asinantravelmate I/Process: Sending signal. PID: 15808 SIG: 9
Lol it's now working. I forgot to add the code for the mAuth and mLoadingBar in the java. Thanks Alex Mamo for reminding me of the logcat
mAuth = FirebaseAuth.getInstance();
mLoadingBar = new ProgressDialog(this);

Android app works on emulator, installs on phone, and crashes on device [duplicate]

This question already has answers here:
android.content.res.Resources$NotFoundException: Resource ID #0x7f07006e
(3 answers)
Unfortunately MyApp has stopped. How can I solve this?
(23 answers)
Closed 2 years ago.
This is a weird and I'm not sure what I have done wrong. The app installs perfectly fine on my Samsung J7 but as soon as I move from the MainActivity to the ScheduleActivity it crashes. On the other hand my fiance who lives in the the Netherlands has a Huawei Mate 20 pro and she can use it fine. I've sent her many iterations and she just updates the app and uses it. I built this app with mvc architecture so there are no calls to the database or model. I'll include the layout, some images, and the java code. If I can add anything else please let me know. Thank you for your help solving this.
MainActvity:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button scheduleButton = findViewById(R.id.schedule_button);
scheduleButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, ScheduleActivity.class);
startActivity(intent);
}
});
}
activity_main.xml:
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/grade"
android:orientation="vertical"
tools:context=".MainActivity">
<ImageView
android:id="#+id/rest_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/rest_meaning"
android:src="#drawable/rest_logo_update"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="#+id/schedule_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/borderlessButtonStyle"
android:layout_marginEnd="36dp"
android:layout_marginBottom="16dp"
android:background="#drawable/button_state"
android:padding="8dp"
android:text="#string/schedule_text"
android:textColor="#drawable/button_text_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rest_img"
app:layout_constraintVertical_bias="1.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
How the main layout looks:
Also here is a visual on the apps structure:
All I am doing is moving from the main package to the ui package and accessing the ScheduleActvity which has this code:
public class ScheduleActivity extends AppCompatActivity implements View.OnClickListener {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_schedule);
Button mondayButton = findViewById(R.id.monday_button);
Button tuesdayButton = findViewById(R.id.tuesday_button);
Button wednesdayButton = findViewById(R.id.wednesday_button);
Button thursdayButton = findViewById(R.id.thursday_button);
Button fridayButton = findViewById(R.id.friday_button);
Button saturdayButton = findViewById(R.id.saturday_button);
Button sundayButton = findViewById(R.id.sunday_button);
mondayButton.setOnClickListener(this);
tuesdayButton.setOnClickListener(this);
wednesdayButton.setOnClickListener(this);
thursdayButton.setOnClickListener(this);
fridayButton.setOnClickListener(this);
saturdayButton.setOnClickListener(this);
sundayButton.setOnClickListener(this);
}
#Override
public void onClick(View view) {
switch (view.getId()){
case R.id.monday_button:
Intent monday_intent = new Intent(ScheduleActivity.this, MondayActivity.class);
startActivity(monday_intent);
break;
case R.id.tuesday_button:
Intent tuesday_intent = new Intent(ScheduleActivity.this, TuesdayActivity.class);
startActivity(tuesday_intent);
break;
case R.id.wednesday_button:
Intent wednesday_intent = new Intent(ScheduleActivity.this, WednesdayActivity.class);
startActivity(wednesday_intent);
break;
case R.id.thursday_button:
Intent thursday_intent = new Intent(ScheduleActivity.this, ThursdayActivity.class);
startActivity(thursday_intent);
break;
case R.id.friday_button:
Intent friday_intent = new Intent(ScheduleActivity.this, FridayActivity.class);
startActivity(friday_intent);
break;
case R.id.saturday_button:
Intent saturday_intent = new Intent(ScheduleActivity.this, SaturdayActivity.class);
startActivity(saturday_intent);
case R.id.sunday_button:
Intent sunday_intent = new Intent(ScheduleActivity.this, SundayActivity.class);
startActivity(sunday_intent);
}
}
This is the respective layout file activity_schedule which has these buttons:
<Button
android:id="#+id/thursday_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="#drawable/button_state"
android:text="#string/thursday"
android:textColor="#drawable/button_text_color"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/monday_button" />
And looks like this (I so badly wish I could easily add a drop shadow to the image):
The buttons lead to a given day you want to know more about such as ThursdayActivity or MondayActvity (I'm still not sure on the ui but I'm getting closer):
All of the daysoftheweek activities look the same as this and this ThursdayActivity:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_thursday);
//groupsArrayList = new ArrayList<>(); --debug
DatabaseHandler db = new DatabaseHandler(ThursdayActivity.this);
/* Uncomment and insert the group data*/
db.thursdayAddGroup(new Groups("Thursday","Daily reflection|Just for Today","9:00 AM","10:00 AM"));
db.thursdayAddGroup(new Groups("Thursday","12 Step|Sponsorship","12:00 PM","1:00 PM"));
db.thursdayAddGroup(new Groups("Thursday","HVN (Hearing voices network)","1:15 PM","2:45 PM"));
db.thursdayAddGroup(new Groups("Thursday","WRAP","3:00 PM","4:00 PM"));
TextView thursdayGroupNameOne = findViewById(R.id.thursday_group_name_one);
TextView thursdayGroupStartTimeOne = findViewById(R.id.thursday_group_start_time_one);
TextView thursdayGroupEndTimeOne = findViewById(R.id.thursday_group_end_time_one);
/* Explicitly indexing the database objects */
List<Groups> groupsList = db.getAllThursdayGroups();
thursdayGroupNameOne.setText(groupsList.get(0).getGroupDay());
thursdayGroupStartTimeOne.setText(groupsList.get(0).getGroupStartTime()); thursdayGroupEndTimeOne.setText(groupsList.get(0).getGroupEndTime());
All daysoftheweek layouts have a cardview that contain the textviews to get and display the data from the database set in the given activity such as this actvity_thursday.xml:
<androidx.cardview.widget.CardView
android:id="#+id/cardView"
android:layout_width="300dp"
android:layout_height="330dp"
android:layout_marginTop="16dp"
android:foregroundGravity="center"
android:orientation="vertical"
app:cardPreventCornerOverlap="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/grade_two">
<TextView
android:id="#+id/thursday_group_name_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:text="#string/group_name"
android:textColor="#android:color/black"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/thursday_group_start_time_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="#string/start_time"
android:textColor="#android:color/black"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="#+id/thursday_group_name_one" />
<TextView
android:id="#+id/thursday_group_end_time_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="108dp"
android:text="#string/end_time"
android:textColor="#android:color/black"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/thursday_group_name_one" />
<TextView
android:id="#+id/dash_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="#string/dash"
android:textColor="#android:color/black"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="#+id/thursday_group_end_time_one"
app:layout_constraintStart_toEndOf="#+id/thursday_group_start_time_one"
app:layout_constraintTop_toBottomOf="#+id/thursday_group_name_one" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
Got the crash log for my device:
06-24 07:50:27.826 22232-22232/? E/Zygote: v2
06-24 07:50:27.826 22232-22232/? I/libpersona: KNOX_SDCARD checking this for 10171
06-24 07:50:27.826 22232-22232/? I/libpersona: KNOX_SDCARD not a persona
06-24 07:50:27.826 22232-22232/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0035
06-24 07:50:27.826 22232-22232/? E/Zygote: accessInfo : 0
06-24 07:50:27.826 22232-22232/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.wesleyruede.rest
06-24 07:50:27.826 22232-22232/? I/art: Late-enabling -Xcheck:jni
06-24 07:50:27.866 22232-22232/? D/ActivityThread: Added TimaKeyStore provider
06-24 07:50:27.896 22232-22232/? W/ResourcesManager: Resource getTopLevelResources for package com.wesleyruede.restoverlayDirs =Null
06-24 07:50:27.916 22232-22232/com.wesleyruede.rest W/System: ClassLoader referenced unknown path: /data/app/com.wesleyruede.rest-1/lib/arm
06-24 07:50:27.916 22232-22232/com.wesleyruede.rest D/ContextRelationManager: ContextRelationManager() : FEATURE_ENABLED=true
06-24 07:50:27.936 22232-22232/com.wesleyruede.rest W/ResourcesManager: Resource getTopLevelResources for package com.wesleyruede.restoverlayDirs =Null
06-24 07:50:27.956 22232-22232/com.wesleyruede.rest W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-24 07:50:27.996 22232-22232/com.wesleyruede.rest I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
06-24 07:50:27.996 22232-22232/com.wesleyruede.rest I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
06-24 07:50:28.136 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:28.156 22232-22232/com.wesleyruede.rest D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{a799c60 I.E...... R.....ID 0,0-0,0}
06-24 07:50:28.156 22232-22232/com.wesleyruede.rest D/SecWifiDisplayUtil: Metadata value : SecSettings2
06-24 07:50:28.156 22232-22253/com.wesleyruede.rest D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-24 07:50:28.216 22232-22253/com.wesleyruede.rest I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.UM.5.3_RB1.06.00.01.211.047_msm8937_32_refs/tags/AU_LINUX_ANDROID_LA.UM.5.3_RB1.06.00.01.211.047__release_AU (I88e9891e40)
OpenGL ES Shader Compiler Version: XE031.08.00.00
Build Date: 08/09/16 Tue
Local Branch:
Remote Branch: refs/tags/AU_LINUX_ANDROID_LA.UM.5.3_RB1.06.00.01.211.047
Local Patches: NONE
Reconstruct Branch: NOTHING
06-24 07:50:28.226 22232-22253/com.wesleyruede.rest I/OpenGLRenderer: Initialized EGL, version 1.4
06-24 07:50:28.266 22232-22232/com.wesleyruede.rest D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 48 - 0, 0) vi=Rect(0, 48 - 0, 0) or=1
06-24 07:50:28.286 22232-22253/com.wesleyruede.rest D/libGLESv1: DTS_GLAPI : DTS is not allowed for Package : com.wesleyruede.rest
06-24 07:50:28.316 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.316 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.326 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
06-24 07:50:28.376 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.376 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.386 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
06-24 07:50:28.406 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.406 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.416 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
06-24 07:50:28.426 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateShaderSEC
06-24 07:50:28.426 22232-22253/com.wesleyruede.rest E/libGLESv2: HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
06-24 07:50:28.446 22232-22232/com.wesleyruede.rest I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#81b441d time:3489958
06-24 07:50:50.296 22232-22232/com.wesleyruede.rest D/ViewRootImpl: ViewPostImeInputStage processPointer 0
06-24 07:50:50.356 22232-22232/com.wesleyruede.rest D/ViewRootImpl: ViewPostImeInputStage processPointer 1
06-24 07:50:50.366 22232-22232/com.wesleyruede.rest I/Timeline: Timeline: Activity_launch_request id:com.wesleyruede.rest time:3511872
06-24 07:50:50.416 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.416 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest D/TextView: setTypeface with style : 0
06-24 07:50:50.426 22232-22232/com.wesleyruede.rest W/ResourceType: Failure getting entry for 0x7f080068 (t=7 e=104) (error -75)
06-24 07:50:50.436 22232-22232/com.wesleyruede.rest W/ResourceType: Failure getting entry for 0x7f080068 (t=7 e=104) (error -75)
06-24 07:50:50.436 22232-22232/com.wesleyruede.rest D/AndroidRuntime: Shutting down VM
06-24 07:50:50.436 22232-22232/com.wesleyruede.rest E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wesleyruede.rest, PID: 22232
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wesleyruede.rest/com.wesleyruede.rest.ui.ScheduleActivity}: android.view.InflateException: Binary XML file line #118: Binary XML file line #118: Error inflating class ImageView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3322)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3418)
at android.app.ActivityThread.access$1100(ActivityThread.java:231)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.view.InflateException: Binary XML file line #118: Binary XML file line #118: Error inflating class ImageView
at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.wesleyruede.rest.ui.ScheduleActivity.onCreate(ScheduleActivity.java:22)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3269)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3418) 
at android.app.ActivityThread.access$1100(ActivityThread.java:231) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:7422) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Caused by: android.view.InflateException: Binary XML file line #118: Error inflating class ImageView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:380) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
at com.wesleyruede.rest.ui.ScheduleActivity.onCreate(ScheduleActivity.java:22) 
at android.app.Activity.performCreate(Activity.java:6904) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3269) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3418) 
at android.app.ActivityThread.access$1100(ActivityThread.java:231) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:7422) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f080068
at android.content.res.Resources.getValue(Resources.java:2598)
at androidx.appcompat.widget.ResourceManagerInternal.loadDrawableFromDelegates(ResourceManagerInternal.java:252)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:139)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:132)
at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:104)
at androidx.appcompat.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:59)
at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:78)
at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:68)
at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:187)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:107)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1407)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:758)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:847) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:527) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:429) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:380) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
at com.wesleyruede.rest.ui.ScheduleActivity.onCreate(ScheduleActivity.java:22) 
at android.app.Activity.performCreate(Activity.java:6904) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3269) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3418) 
at android.app.ActivityThread.access$1100(ActivityThread.java:231) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:7422) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
I hope this isn't too much and I did remove all unnecessary code so as not to throw the whole thing at you. Thanks truly, Wes.

Retrieve Data from multiple documents from Firestore Database

Unable to fetch a value from the Firestore database. Trying to retrieve the value of the mobile number as and when the value of flat and block matches the entry in the database. Below is the code I am using. I have also attached the issues that are registered in LogCat file. Please check and help.
public class Test extends AppCompatActivity {
Button btn;
private FirebaseFirestore firestore;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
firestore = FirebaseFirestore.getInstance();
btn = (Button) findViewById(R.id.button3);
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
getmobile();
//makecall();
}
});
}
private void makecall(){
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
intent.setData(Uri.parse("tel:9890910640"));
startActivity(intent);
}
private void getmobile() {
firestore.collection("users").get().addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
#Override
public void onSuccess(QuerySnapshot documentSnapshots) {
String a = "101";
String b = "F1A";
for(DocumentSnapshot document: documentSnapshots){
if(document.getString("flat")==a&&document.getString("block")==b){
String mobilefromdatabase = document.get("mobile").toString();
Toast.makeText(Test.this, "mobile" + mobilefromdatabase, Toast.LENGTH_LONG).show();
break;
}
}
}
});
}
}
Logcat Details
05-05 03:59:26.721 8805-8805/? E/libprocessgroup: failed to make and chown /acct/uid_10058: Read-only file system
05-05 03:59:26.721 8805-8805/? W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
05-05 03:59:26.722 8805-8805/? I/art: Not late-enabling -Xcheck:jni (already on)
05-05 03:59:26.770 8805-8805/com.example.myrwaapp I/MultiDex: VM with version 2.1.0 has multidex support
05-05 03:59:26.770 8805-8805/com.example.myrwaapp I/MultiDex: Installing application
05-05 03:59:26.770 8805-8805/com.example.myrwaapp I/MultiDex: VM has multidex support, MultiDex support library is disabled.
05-05 03:59:26.842 8805-8805/com.example.myrwaapp V/FA: Registered activity lifecycle callback
05-05 03:59:26.857 8805-8831/com.example.myrwaapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
05-05 03:59:26.861 8805-8805/com.example.myrwaapp I/FirebaseInitProvider: FirebaseApp initialization successful
05-05 03:59:26.907 8805-8834/com.example.myrwaapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
05-05 03:59:26.925 8805-8834/com.example.myrwaapp I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
05-05 03:59:26.986 8805-8805/com.example.myrwaapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
05-05 03:59:27.010 8805-8805/com.example.myrwaapp V/FA: onActivityCreated
05-05 03:59:27.047 8805-8805/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
05-05 03:59:27.047 8805-8805/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
05-05 03:59:27.048 8805-8830/com.example.myrwaapp V/FA: App measurement collection enabled
05-05 03:59:27.049 8805-8830/com.example.myrwaapp V/FA: App measurement enabled for app package, google app id: com.example.myrwaapp, 1:649640616763:android:9025242f82dd4767798d1e
05-05 03:59:27.052 8805-8830/com.example.myrwaapp I/FA: App measurement initialized, version: 21028
05-05 03:59:27.052 8805-8830/com.example.myrwaapp I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
05-05 03:59:27.052 8805-8830/com.example.myrwaapp I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.myrwaapp
05-05 03:59:27.052 8805-8830/com.example.myrwaapp D/FA: Debug-level message logging enabled
05-05 03:59:27.077 8805-8830/com.example.myrwaapp V/FA: Connecting to remote service
05-05 03:59:27.089 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:27.143 8805-8830/com.example.myrwaapp V/FA: Activity resumed, time: 8622127
05-05 03:59:27.145 8805-8830/com.example.myrwaapp I/FA: Tag Manager is not found and thus will not be used
05-05 03:59:27.151 8805-8838/com.example.myrwaapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-05 03:59:27.154 8805-8805/com.example.myrwaapp D/Atlas: Validating map...
05-05 03:59:27.159 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:27.159 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:27.188 8805-8838/com.example.myrwaapp I/OpenGLRenderer: Initialized EGL, version 1.4
05-05 03:59:27.188 8805-8838/com.example.myrwaapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
05-05 03:59:27.215 8805-8838/com.example.myrwaapp D/EGL_emulation: eglCreateContext: 0xa2003100: maj 2 min 0 rcv 2
05-05 03:59:27.240 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:27.243 8805-8838/com.example.myrwaapp D/OpenGLRenderer: Enabling debug mode 0
05-05 03:59:27.294 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:27.738 8805-8830/com.example.myrwaapp D/FA: Connected to remote service
05-05 03:59:27.738 8805-8830/com.example.myrwaapp V/FA: Processing queued up service tasks: 4
05-05 03:59:32.795 8805-8830/com.example.myrwaapp V/FA: Inactivity, disconnecting from the service
05-05 03:59:38.884 8805-8830/com.example.myrwaapp V/FA: Recording user engagement, ms: 11740
05-05 03:59:38.886 8805-8830/com.example.myrwaapp V/FA: Connecting to remote service
05-05 03:59:38.892 8805-8830/com.example.myrwaapp V/FA: Activity paused, time: 8633867
05-05 03:59:38.894 8805-8805/com.example.myrwaapp V/FA: onActivityCreated
05-05 03:59:38.913 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:38.913 8805-8830/com.example.myrwaapp V/FA: Activity resumed, time: 8633895
05-05 03:59:38.926 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:38.926 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:38.993 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.034 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.051 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.177 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.222 8805-8830/com.example.myrwaapp D/FA: Connected to remote service
05-05 03:59:39.222 8805-8830/com.example.myrwaapp V/FA: Processing queued up service tasks: 4
05-05 03:59:39.224 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.335 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:44.247 8805-8830/com.example.myrwaapp V/FA: Inactivity, disconnecting from the service
05-05 03:59:48.704 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:48.871 8805-8849/com.example.myrwaapp W/DynamiteModule: Local module descriptor class for providerinstaller not found.
05-05 03:59:48.877 8805-8849/com.example.myrwaapp I/DynamiteModule: Considering local module providerinstaller:0 and remote module providerinstaller:0
05-05 03:59:48.877 8805-8849/com.example.myrwaapp W/ProviderInstaller: Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
05-05 03:59:48.881 8805-8849/com.example.myrwaapp W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
05-05 03:59:48.881 8805-8849/com.example.myrwaapp W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
05-05 03:59:48.942 8805-8849/com.example.myrwaapp W/linker: libconscrypt_gmscore_jni.so: unused DT entry: type 0x6ffffffe arg 0x13dc
05-05 03:59:48.942 8805-8849/com.example.myrwaapp W/linker: libconscrypt_gmscore_jni.so: unused DT entry: type 0x6fffffff arg 0x2
05-05 03:59:48.948 8805-8849/com.example.myrwaapp V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 284 native methods...
05-05 03:59:48.963 8805-8820/com.example.myrwaapp I/art: Background sticky concurrent mark sweep GC freed 976(49KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 8MB/8MB, paused 5.861ms total 31.265ms
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
05-05 03:59:49.002 8805-8849/com.example.myrwaapp I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
First of all, String comparison in Java, should not be performed using == operator, as it will always compare the address of the objects from the memory and not the actual values. String comparison should be done using equals() method.
Moreover, if you need an AND operation, you should not get all documents that exist within the users collection and make the comparison on the client. For that, you should use a query that looks exactly like this:
String a = "101";
String b = "F1A";
FirebaseFirestore rootRef = FirebaseFirestore.getInstance();
CollectionReference usersRef = rootRef.collection("users");
Query query = usersRef.whereEqualTo("flat", a).whereEqualTo("block", b);
query.get().addOnSuccessListener(/* ... */);
In this way, you are going to get only the documents where the flat property holds the value of 101 AND the value of block holds F1A. As I think that only one apartment has that constraint, you'll be billed with only one read operation.

Logcat Displays Various Types of Errors for The SQLite Database I Created for My Android App

I'm trying to build and an Android app and managed to get through the main purpose of it. However, I'm severely stuck in successfully implementing an SQLite database to have users login if they already have an account off the SQLite database OR create and register for an account.
The relevant classes and XML files for these instructions are correct in my perspective but I believe there's something wrong with my SQLite Query or something wrong when I'd try to look into the Logcat and check for the the registered information from the app user and would display numerous of errors that I find too difficult to debug at this rate.
I will attach the relevant classes, XML files, and what it says at Logcat. Hopefully this way, I can receive the help I'd need as this is severely stopping me from even entering to the main purpose of the app. Your help would be very appreciated. Thank You.
login.java
public class login extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.login);
final EditText etUsername = (EditText)findViewById(R.id.editText);
final EditText etPassword = (EditText)findViewById(R.id.editText2);
final Button bLogin = (Button)findViewById(R.id.loginbutton);
final Button bRegister = (Button)findViewById(R.id.registernowbutton);
bRegister.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View v){
Intent registerIntent = new
Intent(login.this,RegisterUser.class);
login.this.startActivity(registerIntent);
}
});
}
}
RegisterUser.java
public class RegisterUser extends Activity {
EditText USER_NAME, USER_PASS, CON_PASS;
String user_name, user_pass, con_pass;
Button REG;
Context ctx = this;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_user);
USER_NAME = findViewById(R.id.reg_user);
USER_PASS = findViewById(R.id.reg_pass);
CON_PASS = findViewById(R.id.con_pass);
REG = findViewById(R.id.registerbutton);
REG.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
user_name = USER_NAME.getText().toString();
user_pass = USER_PASS.getText().toString();
con_pass = CON_PASS.getText().toString();
if(!(user_pass.equals(con_pass))){
Toast.makeText(getBaseContext(),"Passwords Do Not
Match",Toast.LENGTH_LONG).show();
USER_NAME.setText("");
USER_PASS.setText("");
CON_PASS.setText("");
}
else{
DatabaseOperations DB = new DatabaseOperations(ctx);
DB.putInformation(DB, user_name, user_pass);
Toast.makeText(getBaseContext(), "Registration Success",
Toast.LENGTH_LONG).show();
finish();
}
}
});
}
}
DatabaseOperations.java
public class DatabaseOperations extends SQLiteOpenHelper {
public static final int database_version = 1;
public String CREATE_QUERY = "CREATE TABLE
"+TableData.TableInfo.TABLE_NAME+"("+TableData.TableInfo.USER_NAME+"
TEXT,"+TableData.TableInfo.USER_PASSWORD+" TEXT );";
public DatabaseOperations(Context context) {
super(context, TableData.TableInfo.DATABASE_NAME, null,
database_version);
Log.d("Database operations", "Database created");
}
#Override
public void onCreate(SQLiteDatabase sdb) {
sdb.execSQL(CREATE_QUERY);
Log.d("Database operations","Table created");
}
#Override
public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
}
public void putInformation(DatabaseOperations dop, String name, String
pass){
SQLiteDatabase SQ = dop.getWritableDatabase();
ContentValues cv = new ContentValues();
cv.put(TableData.TableInfo.USER_NAME, name);
cv.put(TableData.TableInfo.USER_PASSWORD, pass);
SQ.insert(TableData.TableInfo.TABLE_NAME, null,cv);
Log.d("Database operations", "One raw inserted");
}
}
login.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:background="#drawable/gradient"
tools:context=".login"
android:id="#+id/relativeLayout">
<EditText
android:id="#+id/editText"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/editText2"
android:layout_centerVertical="true"
android:background="#11000000"
android:drawableStart="#drawable/ic_action_user"
android:ems="10"
android:hint="PSU Email"
android:inputType="text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/editText2"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/loginbutton"
android:layout_below="#+id/editText"
android:layout_marginTop="22dp"
android:background="#11000000"
android:drawableStart="#drawable/ic_action_pass"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText"
app:layout_constraintVertical_bias="0.008" />
<Button
android:id="#+id/loginbutton"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_below="#+id/editText2"
android:layout_centerHorizontal="true"
android:layout_marginTop="38dp"
android:background="#ff77aa"
android:text="Login"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.692" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="400dp"
android:layout_height="200dp"
android:layout_above="#+id/editText"
android:layout_centerHorizontal="true"
android:layout_marginBottom="42dp"
android:src="#drawable/pennstateshield"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.249" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/loginbutton"
android:layout_centerHorizontal="true"
android:layout_marginTop="44dp"
android:gravity="center"
android:text="Not Registered? Please Join!"
android:textAlignment="center" />
<Button
android:id="#+id/registernowbutton"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/loginbutton"
android:layout_below="#+id/textView3"
android:background="#ff77aa"
android:text="Register Now"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.692" />
</RelativeLayout>
activity_register_user.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:background="#drawable/gradient"
tools:context="m.rami.psucalculator.RegisterUser"
android:id="#+id/relativeactivityregister">
<ImageView
android:id="#+id/registerpsulogo"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:src="#drawable/pennstateshield"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.249" />
<EditText
android:id="#+id/reg_user"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#11000000"
android:drawableStart="#drawable/ic_action_user"
android:ems="10"
android:hint="Enter PSU Email"
android:inputType="text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/reg_pass"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/reg_user"
android:layout_below="#+id/reg_user"
android:layout_marginTop="20dp"
android:background="#11000000"
android:drawableStart="#drawable/ic_action_pass"
android:ems="10"
android:hint="Enter Password"
android:inputType="textPassword"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText"
app:layout_constraintVertical_bias="0.008" />
<EditText
android:id="#+id/con_pass"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/reg_pass"
android:layout_below="#+id/reg_pass"
android:layout_marginTop="20dp"
android:background="#11000000"
android:drawableStart="#drawable/ic_action_pass"
android:ems="10"
android:hint="Re-Enter Password"
android:inputType="textPassword"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText"
app:layout_constraintVertical_bias="0.008" />
<Button
android:id="#+id/registerbutton"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/con_pass"
android:layout_below="#+id/con_pass"
android:layout_marginTop="32dp"
android:background="#ff77aa"
android:text="Register"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.692" />
</RelativeLayout>
Information from Logcat of Errors:
04-20 12:37:32.428 22018-22018/m.rami.psucalculator I/zygote: Not late-
enabling -Xcheck:jni (already on)
04-20 12:37:32.437 22018-22018/m.rami.psucalculator W/zygote: Unexpected
CPU variant for X86 using defaults: x86
04-20 12:37:32.841 22018-22018/m.rami.psucalculator I/InstantRun: starting
instant run server: is main process
04-20 12:37:33.301 22018-22048/m.rami.psucalculator D/OpenGLRenderer: HWUI
GL Pipeline
04-20 12:37:33.351 22018-22048/m.rami.psucalculator I/OpenGLRenderer:
Initialized EGL, version 1.4
04-20 12:37:33.351 22018-22048/m.rami.psucalculator D/OpenGLRenderer: Swap
behavior 1
04-20 12:37:33.352 22018-22048/m.rami.psucalculator W/OpenGLRenderer:
Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying
without...
04-20 12:37:33.352 22018-22048/m.rami.psucalculator D/OpenGLRenderer: Swap
behavior 0
04-20 12:37:33.428 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglCreateContext: 0xa0e052a0: maj 2 min 0 rcv 2
04-20 12:37:33.488 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:33.608 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:36.566 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:36.745 22018-22018/m.rami.psucalculator I/AssistStructure:
Flattened final assist data: 2212 bytes, containing 1 windows, 7 views
04-20 12:37:42.827 22018-22023/m.rami.psucalculator I/zygote: Do partial
code cache collection, code=23KB, data=27KB
04-20 12:37:42.829 22018-22023/m.rami.psucalculator I/zygote: After code
cache collection, code=23KB, data=27KB
04-20 12:37:42.829 22018-22023/m.rami.psucalculator I/zygote: Increasing
code cache capacity to 128KB
04-20 12:37:42.902 22018-22023/m.rami.psucalculator I/zygote: Do partial
code cache collection, code=30KB, data=56KB
04-20 12:37:42.902 22018-22023/m.rami.psucalculator I/zygote: After code
cache collection, code=30KB, data=56KB
04-20 12:37:42.902 22018-22023/m.rami.psucalculator I/zygote: Increasing
code cache capacity to 256KB
04-20 12:37:42.902 22018-22023/m.rami.psucalculator I/zygote: JIT allocated
71KB for compiled code of void android.widget.TextView.<init>
(android.content.Context, android.util.AttributeSet, int, int)
04-20 12:37:42.902 22018-22023/m.rami.psucalculator I/zygote: Compiler
allocated 4MB to compile void android.widget.TextView.<init>
(android.content.Context, android.util.AttributeSet, int, int)
04-20 12:37:42.989 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:43.025 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:43.038 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:43.077 22018-22018/m.rami.psucalculator I/AssistStructure:
Flattened final assist data: 2060 bytes, containing 1 windows, 6 views
04-20 12:37:45.457 22018-22023/m.rami.psucalculator I/zygote: Do full code
cache collection, code=124KB, data=78KB
04-20 12:37:45.460 22018-22023/m.rami.psucalculator I/zygote: After code
cache collection, code=122KB, data=53KB
04-20 12:37:47.316 22018-22023/m.rami.psucalculator I/zygote: Do partial
code cache collection, code=124KB, data=58KB
04-20 12:37:47.320 22018-22023/m.rami.psucalculator I/zygote: After code
cache collection, code=124KB, data=58KB
04-20 12:37:47.320 22018-22023/m.rami.psucalculator I/zygote: Increasing
code cache capacity to 512KB
04-20 12:37:51.958 22018-22018/m.rami.psucalculator D/Database operations:
Database created
04-20 12:37:51.962 22018-22018/m.rami.psucalculator E/SQLiteLog: (1) table
reg_info has no column named user_password
04-20 12:37:51.965 22018-22018/m.rami.psucalculator E/SQLiteDatabase: Error
inserting user_password=Rami user_name=ram6077
android.database.sqlite.SQLiteException: table reg_info has no column named
user_password (code 1): , while compiling: INSERT INTO
reg_info(user_password,user_name) VALUES (?,?)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native
Method)
at
android.database.sqlite.SQLiteConnection.
acquirePreparedStatement(SQLiteConnection.java:889)
at android.database.sqlite.SQLiteConnection.
prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.
insertWithOnConflict(SQLiteDatabase.java:1472)
at android.database.sqlite.SQLiteDatabase.
insert(SQLiteDatabase.java:1343)
at
m.rami.psucalculator.DatabaseOperations.
putInformation(DatabaseOperations.java:44)
at m.rami.psucalculator.RegisterUser$1.onClick(RegisterUser.java:43)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
04-20 12:37:51.965 22018-22018/m.rami.psucalculator D/Database operations:
One raw inserted
04-20 12:37:52.083 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:52.103 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:52.238 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:52.274 22018-22048/m.rami.psucalculator I/chatty:
uid=10085(u0_a85) RenderThread identical 1 line
04-20 12:37:52.301 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:52.346 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:52.380 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:37:52.387 22018-22048/m.rami.psucalculator D/OpenGLRenderer:
endAllActiveAnimators on 0x8e9f3500 (Button) with handle 0xa0e03740
04-20 12:37:52.808 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:39:33.362 22018-22023/m.rami.psucalculator I/zygote: Do full code
cache collection, code=249KB, data=150KB
04-20 12:39:33.363 22018-22023/m.rami.psucalculator I/zygote: After code
cache collection, code=245KB, data=134KB
04-20 12:39:44.912 22018-22023/m.rami.psucalculator I/zygote: Do partial
code cache collection, code=245KB, data=137KB
04-20 12:39:44.913 22018-22023/m.rami.psucalculator I/zygote: After code
cache collection, code=245KB, data=137KB
04-20 12:39:44.913 22018-22023/m.rami.psucalculator I/zygote: Increasing
code cache capacity to 1024KB
04-20 12:40:02.461 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:02.507 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:02.516 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:02.564 22018-22018/m.rami.psucalculator I/AssistStructure:
Flattened final assist data: 2060 bytes, containing 1 windows, 6 views
04-20 12:40:16.580 22018-22018/m.rami.psucalculator D/Database operations:
Database created
04-20 12:40:16.585 22018-22018/m.rami.psucalculator E/SQLiteLog: (1) table
reg_info has no column named user_password
04-20 12:40:16.587 22018-22018/m.rami.psucalculator E/SQLiteDatabase: Error
inserting user_password=Rami user_name=ram6077
android.database.sqlite.SQLiteException: table reg_info has no column named
user_password (code 1): , while compiling: INSERT INTO
reg_info(user_password,user_name) VALUES (?,?)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native
Method)
at
android.database.sqlite.SQLiteConnection.
acquirePreparedStatement(SQLiteConnection.java:889)
at
android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at
android.database.sqlite.SQLiteDatabase.
insertWithOnConflict(SQLiteDatabase.java:1472)
at android.database.sqlite.SQLiteDatabase.
insert(SQLiteDatabase.java:1343)
at
m.rami.psucalculator.DatabaseOperations.
putInformation(DatabaseOperations.java:44)
at m.rami.psucalculator.RegisterUser$1.onClick(RegisterUser.java:43)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
04-20 12:40:16.588 22018-22018/m.rami.psucalculator D/Database operations:
One raw inserted
04-20 12:40:16.648 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:16.662 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:16.733 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:16.774 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:16.879 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:16.920 22018-22048/m.rami.psucalculator I/chatty:
uid=10085(u0_a85) RenderThread identical 1 line
04-20 12:40:17.056 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 12:40:17.067 22018-22048/m.rami.psucalculator D/OpenGLRenderer:
endAllActiveAnimators on 0x9c5dc880 (Button) with handle 0xa0e03fa0
04-20 12:40:17.361 22018-22048/m.rami.psucalculator D/EGL_emulation:
eglMakeCurrent: 0xa0e052a0: ver 2 0 (tinfo 0xa0e032e0)
04-20 18:32:41.232 22018-22024/m.rami.psucalculator I/zygote:
Thread[3,tid=22024,WaitingInMainSignalCatcherLoop,
Thread*=0xaa3dac00,peer=0x131c0088,"Signal Catcher"]: reacting to signal 3
04-20 18:32:41.375 22018-22024/m.rami.psucalculator I/zygote: Wrote stack
traces to '/data/anr/traces.txt'
The insert into table reg_info isn't working because of
no column named user_password
, as per :-
table reg_info has no column named user_password (code 1): , while compiling: INSERT INTO reg_info(user_password,user_name) VALUES (?,?)
This is likely due to the table having been modified in your table create SQL (user_password column added at a guess), but that hasn't been applied due to how the onCreate method is invoked.
That is the onCreate method is invoked once when the database itself is created (unless invoked elsewhere), it is not run every time the App is run.
The quickest fix is to either :-
Delete the App's data from settings/Apps or
Uninstall the App
and to then rerun the App.
Noting that this deletes the database and thus any data stored in the database.
If you need to preserve data then you would need to run the SQL ALTER TABLE reg_info ADD COLUMN user_password TEXT at an appropriate place within the code.

esp8266 android connection via telnet

Ive been trying from a very long time to send a string from android app to esp8266 through Telnet. I wish to see the output on serial monitor of arduino IDE.I have used the code from send string to esp8266 via android using telnet
Here are the logs that Im getting on running my android code on connecting connect and send button.
01/18 20:02:32: Launching app
Cold swapped changes.
$ adb shell am start -n "com.example.manveenkaur.optimized/com.example.manveenkaur.optimized.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 9556 on device samsung-sm_e700h-268ada67
I/InstantRun: Instant Run Runtime started. Android package is com.example.manveenkaur.optimized, real application class is null.
D/SecWifiDisplayUtil: Metadata value : none
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/PhoneWindow: *FMB* installDecor mIsFloating : false
D/PhoneWindow: *FMB* installDecor flags : -2139029248
D/ViewRootImpl: Buffer Count from app info with ::-1 && -1 for :: com.example.manveenkaur.optimized from View :: -1 DBQ Enabled ::false false
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: (I716aebe4f9)
OpenGL ES Shader Compiler Version: E031.25.03.04
Build Date: 07/01/15 수
Local Branch: AU_LINUX_ANDROID_LA.BR.1.1.3_RB1.05.01.00.032.031_02060873_02063264
Remote Branch:
Local Patches:
Reconstruct Branch:
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 4096
D/OpenGLRenderer: Enabling debug mode 0
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#1e34142f time:924988396
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl: Buffer Count from app info with ::-1 && -1 for :: com.example.manveenkaur.optimized from View :: -1 DBQ Enabled ::false false
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN`
1. I am unable to resolve this ACTION_DOWN statement
2. Also Id like to know what `Buffer Count from app info with ::-1 && -1 for :: com.example.manveenkaur.optimized from View :: -1 DBQ Enabled ::false false means
3. Further on clicking disconnect it shows me the following :-
W/System.err: java.io.IOException: BufferedInputStream is closed
W/System.err: at java.io.BufferedInputStream.streamClosed(BufferedInputStream.java:125)
W/System.err: at java.io.BufferedInputStream.read(BufferedInputStream.java:257)
W/System.err: at java.io.BufferedInputStream.read(BufferedInputStream.java:290)
W/System.err: at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:98)
W/System.err: at org.apache.commons.io.input.TeeInputStream.read(TeeInputStream.java:127)
W/System.err: at java.io.InputStreamReader.read(InputStreamReader.java:231)
W/System.err: at java.io.BufferedReader.fillBuf(BufferedReader.java:145)
W/System.err: at java.io.BufferedReader.readLine(BufferedReader.java:397)
W/System.err: at com.example.manveenkaur.optimized.PioneerController$1.run(PioneerController.java:41)
W/System.err: at java.lang.Thread.run(Thread.java:818)
Also
heres activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.manveenkaur.optimized.MainActivity">
<EditText
android:id="#+id/EditTextMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:hint="#string/message"
android:inputType="text"></EditText>
<Button
android:id="#+id/sendButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/send_button_text"></Button>
<Button
android:id="#+id/connectButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/connect_button_text"></Button>
<Button
android:id="#+id/disconnectButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/disconnect_button_text"></Button>
</LinearLayout>
</FrameLayout>
One question upfront: Are you using SoftwareSerial or HardwareSerial to talk to the ESP8266? Using SoftwareSerial is not going to make you happy.

Categories