Exercises

1. Add a new color resource with a value of #00ff00 to your Droidl project. Within the layout file, change the textColor attribute of the TextView control to the color resource you just created. Rerun the application and view the result.

2. Add a new dimension resource with a value of 22pt to your Droidl project. Within the layout file, change the textSize attribute of the TextView control to the dimension resource you just created. Rerun the application and view the result.

3. Add a new drawable graphics file resource to your Droid1 project. Within the layout file, add an ImageView control and set its src attribute to the drawable resource you just created. Rerun the application and view the result.

4. Add a raw text file resource to the Droidl project. Use the openRawResource() method to create an InputStream object and read the file. Output the contents of the file to the log by using the Log.v() method. Rerun the application and view the result.

0 0

Post a comment