The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.
EmPubLite project has some initial resources. However, the defaults are not what
we want for the long term. So, in addition to adding new resources in future
tutorials, we will fix the ones we already have in this tutorial.
This is a continuation of the work we did in the previous tutorial.
Our application shows up everywhere as “EmPubLite”:
We should change that to be “EmPub Lite”, adding a space for easier reading,
and to illustrate that this is a “lite” version of the full
Double-click on the
res/values/strings.xml file in your project explorer.
In the XML editor for the string resources, you will find an element that looks like:
Change the text node in this element to
Then save your changes, giving you something like:
<resources> <string name="app_name">EmPub Lite</string> </resources>
The build tools provide us with a stock icon to use for the launcher — the actual image used varies by Android tools release. However, we can change it to something else. For example, we could use the icon portion of the CommonsWare logo:
Figure 57: CommonsWare
Download the molecule PNG file from the CommonsWare Web site and save it somewhere on your development machine.
Then, right-click over the
res/ directory in your
main source set
in the project explorer, and choose New > Image Asset from the context
menu. That will bring up the Asset Studio wizard:
Figure 58: Asset Studio Wizard, First Page
In the Icon Type drop-down, choose “Launcher Icons (Legacy only)”. This will change the wizard to look like:
Figure 59: Asset Studio Wizard, First Page, Legacy Mode
Click the “Image” radio button in the “Asset Type” row.
Then, click the “…” to the right of the “Path” field and choose
molecule.png file that you downloaded. Also, ensure that “Scaling”
is set to
“Shrink to Fit”,
and choose “None” from the “Shape” drop-down.
should give you a preview of what the icons will look like:
Figure 60: Asset Studio Wizard, First Page, After Loading Image
Leave the rest of the wizard alone, then click Next to proceed to the next page:
Figure 61: Asset Studio Wizard, Second Page
You should get a warning towards the bottom, indicating that
if you finish the wizard, you will overwrite existing files. This
is expected, as we are trying to replace the old
files with new ones. So, go ahead and click Finish.
The preview of this section was abducted by space aliens.
The preview of this section is [REDACTED].