Add and use log
This commit is contained in:
parent
e20a0a5403
commit
d7e82d07c2
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user