INTRODUCTION
In this lesson you will be using photoshop, or another photo editor. And you will be changing the icon of the app. And adding a logo, of your choosing, to your application.
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Adding Icon
2. Adding Music
3. Adding Logo
LEARNING SEQUENCE
|
|
Required Reading
|
Read the following:
Introduction To Development Environment
· Eclipse
· Android
· Considerations for beginning programming.
|
Resources
|
View the following:
1. Eclipse
2. Android Development
3. Photo Editor Software
|
Assignments
|
Icons
First, for the icons, you’ll want to make sure that the icons are the correct size.
Find your workspace folder on your hard drive or flash drive and open it. It won’t work if you drag and drop the pictures into eclipse
Within the workspace folder, you’ll see your app folder
Open up the app folder and you’ll see a few folders and some other icons. Double click on the res folder
Here you’ll see 5 ‘drawable’ folders, with different name following them. These are the icons for the app, differing on the type of screen the phone is
Open the pictures in any photo editing software and change them to anyway you please
When you save the pictures, make sure that they are the correct size, and that they are .png pictures
Logo
For the logo, we’ll be displaying an image and playing a sound for a bit before the app officially opens
In any photo editor, make an image that is 400x600, this will be your background. Make sure it’s a .png
In any of the ‘drawable’ folders, you can place the background. The picture’s name should be something simple so you can type it out easily in java
Now create a new folder within the res folder called ‘raw’ And place any song that you want inside the folder, this will be the song that is played at the very beginning when the app opens up.
Now open eclipse and go to the layout folder. Create a new xml.
Right click on the ‘layout’ folder. Move your mouse to ‘New’ and then select ‘Android XML File’
Name it whatever you want, I chose logo.
After ‘android:orientation’, you’ll want to add the piece of code ‘android:background=”@drawable/*whatever you named your background*” ‘
Now you need to make the java for it, move to ‘com.example.test’ and right click it and select new, and click class. Name the Java ‘Logo’
The file should open. You’ll want to move down to the ‘public class’ and type ‘extends Activity. They hover over the error and import the Activity.
Move the cursor down past the ‘{‘ and hit enter. Type ‘MediaPlayer ourSong;’ import MediaPlayer.
Hit enter and right click under ‘MediaPlayer’ Hover down to ‘Source’ and click on ‘Override/Implement Methods’
Under ‘Activity’, you’ll want to select ‘onCreate(Bundle)’ and hit ok.
|
No comments:
Post a Comment