[Solved] Firebase Error : Failed to resolve : com.google.firebase:firebase-database:16.0.6 [closed]

In order to add firebase-database to your application, you also need to add the firebase-core libraries (which you commented out). app/build.gradle dependencies { // … implementation ‘com.google.firebase:firebase-core:16.0.6′ } If you haven’t done so, you also need to add rules to include Google services and Google’s Maven repository. Please read Add Firebase to Your Android Project … Read more

[Solved] How can I get the sum, difference, quotient, product of two values and printed out in textview [closed]

add two EditText for getting two numbers then add four button for different operation like add/sub/mul/div. Get value of editText and Set onClickListener and write appropriate code in that. EditText firstNumber; EditText secondNumber; TextView addResult; Button btnAdd; double num1,num2,sum; firstNumber = (EditText)findViewById(R.id.txtNumber1); secondNumber = (EditText)findViewById(R.id.txtNumber2); addResult = (TextView)findViewById(R.id.txtResult); btnAdd = (Button)findViewById(R.id.btnAdd); btnAdd.setOnClickListener(new OnClickListener() { public … Read more

[Solved] I only created a blank activity and the app keeps crashing. The logcat shows several FATAL EXCEPTIONS

@ Stephanie-JK when you create a new project i think you have select a BASE Activity hence arrive this problem. Next time when you create a new project please select a Empty Activity then its generate a only one Layout and your problem resolve..thanks 9 solved I only created a blank activity and the app … Read more

[Solved] How make addition of two or more numbers in a single EditText?

How to get text from edittext? initialize edittext: EditText editText = findViewById(R.id.edittext); String[] editTextValues = edittext.getText().toString().split(” “); now use editTextValues like this int firstValue = Integer.parse(editTextValues[0]); int secondValue = Integer.parse(editTextValues[1]); int sum = firstValue + secondValue; solved How make addition of two or more numbers in a single EditText?

[Solved] Intent throwing error in click listener in Android Studio

Problem is you are setting wrong layout in your UserLogin Activity. You are setting activity_main.xml instead you need to set your UserLogin Activity layout XML file . You are doing like this setContentView(R.layout.activity_main); Instead you need to do like setContentView(R.layout.YOUR_USER_LOGIN_ACTIVITY_LAYOUT); 8 solved Intent throwing error in click listener in Android Studio

[Solved] Android Studio doesn’t recognize images in hdpi folder

Try making new drawable folders for putting images after right clicking res folder and name folders like this drawable-hdpi drawable-mdpi drawable-xhdpi drawable-xxhdpi drawable-xxxhdpi Drag and drop image with same name according to their dimensions. The android takes drawable folder as one entity, picks up the best suited image and shows it on different resolution phones. … Read more

[Solved] How to use shared preference to send data from activity to fragment?

If you insist on shared preference use this code : To save the data private void saveSp(String key , String value){ PreferenceManager.getDefaultSharedPreferences(Context) .edit() .putString(key, value).apply(); } To get your data: PreferenceManager.getDefaultSharedPreferences(Context).getString(“string”, “default”) solved How to use shared preference to send data from activity to fragment?