Add and use log

This commit is contained in:
Benjamin Loison 2024-05-02 01:43:42 +02:00
parent e20a0a5403
commit d7e82d07c2
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -5,6 +5,7 @@ import android.os.Bundle;
import android.widget.TextView;
import android.content.Context;
import android.os.BatteryManager;
import android.util.Log;
public class MainActivity extends Activity {
@Override
@ -13,8 +14,13 @@ public class MainActivity extends Activity {
setContentView(R.layout.activity_main);
TextView text = (TextView)findViewById(R.id.my_text);
Context context = getApplicationContext();
BatteryManager batteryManager = (BatteryManager)context.getSystemService(Context.BATTERY_SERVICE);
Context context = getApplicationContext();
BatteryManager batteryManager = (BatteryManager)context.getSystemService(Context.BATTERY_SERVICE);
text.setText("Hello, worldg!" + batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER));
log("Hello from Camera app!");
}
private void log(String toLog) {
Log.i("Robust image source identification on modern smartphones camera", toLog);
}
}