Please conduct the following tasks alone. For implementation details you can refer to the lecture slides or the Android developer website. Please do not hesitate to ask me or the tutor if you have any questions. Under „Tip“ you can find some hints for the task. The „Checklist“ specifies what should happen when your implementation is correct.
Develop an Android app that has the following functionality: The user is able to enter a decimal number. When he presses a button, a Service is started that waits for the specified number of seconds and then outputs the text „Service waited for X seconds“ to the console (where X is the specified number of seconds) The app should have the following user interface components (see screenshot): An EditText with input type „numberDecimal“ A TextView showing the description for the user A Button with the text „Start Service“
Implement a Service by subclassing from the class IntentService. The Service shall be started when the button is pressed and output the result using the Log class.
Don’t forget to register the Service in the Android Manifest. See the lecture slides for example code and hints
Checklist | |
---|---|
App outputs text to the console after the number of seconds specified in the EditText field |