show root-cause for compile-message: Recompile with -Xlint:deprecation for details

if the compile-output shows something like: Recompile with -Xlint:deprecation for details Build-Output Then it is time to get to the details of this message: in Gradle-scripts/build.gradle (Project) include the following line(s): tasks.withType(JavaCompile) { options.compilerArgs << “-Xlint:unchecked” << “-Xlint:deprecation” } build.gradle example When you now run the app the root-cause is shown in the output: example […]

Error when adding Firebase to your app

When you add Firebase to your app and get similar error-messages like: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar […]

Android: get values of the Temperature Sensor, show them on the display

Mainactivity.java: [code] public class MainActivity extends AppCompatActivity implements SensorEventListener { private SensorManager mSM; private Sensor mTemp; private TextView sensorTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sensorTextView = findViewById(R.id.sensorTextview); mSM = (SensorManager) getSystemService(SENSOR_SERVICE); mTemp = mSM.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE); } @Override public void onSensorChanged(SensorEvent sensorEvent) { float tmpval = sensorEvent.values[0]; sensorTextView.setText("Temp :" + (tmpval) ); } @Override […]