Android 1: Lesson 12

Android 1: Lesson 12: Image Swiper Part 1


INTRODUCTION
In this lesson you will be Importing a few more pictures into your app, and you’ll be creating an Activity that allows you to swipe in between them
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Swipe in between a few images
2. Add another Activity to the menu
3. Completely understand the manifest
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
Assignments
XML
  1. Before we get into the xml, import a few pictures into your app, put them the same place you put the logo and the icons. Can be any size. Name them pic1, pic2, and so on
  2. Create a new XML called anything you’d like. I chose image. Keep it in RelativeLayout
  3. make the width and height both ‘match_parent’
  4. Under that, Type ‘’
  5. Make the id for it ‘switcher’ and the width and height both ‘match_parent’
  6. Type ‘android:layout_alignParentTop=”true”’
  7. Below that, type ‘
  8. Make the id for it ‘gallery’
  9. make the background for it any color, I picked ‘#55000000’ which is black.
  10. Type out the align piece of code, but chose bottom. Make it true. You can actually switch this and the Imageswitcher, depending on where you want the pictures.
  11. Make the gravity ‘center_vertical’
  12. Type ‘android:spacing=”16dp’ or you can pick any number, 16dp looks good though
Java
  1. Start a new class, I called it ‘ImageSwitcher’
  2. Import ‘android.widget.ImageSwitcher;’
  3. extend the Activity
  4. ‘implements AdapterView.OnItemSelectedListener, ViewSwitcher.ViewFactory’
  5. Import the Activity, leave the other two for now.
  6. Import via override onCreate(Bundle)
  7. Under the ‘super’ type ‘requestWindowFeature(Window.FEATURE_NO_TITLE);
  8. Enter ‘setContentView(R.layout.image);’
  9. Ignore the errors. Enter ‘mSwitcher = (ImageSwitcher) findViewById(R.id.switcher);’
  10. Enter ‘mSwitcher.SetFactor(this);’
  11. Enter ‘mSwitcher.SetInAnimation(AnimationUtils.loadAnimation(this,android.R.anim.fade_in);’ import it.
  12. Enter and copy and paste the code from above, but change ‘in’ to ‘out’
  13. Go to the top, and import ‘android.widget.AdapterView;’, now move back down, below the override. and import the ‘onItemSelected’ and ‘onNothingSelected’
  14. For ‘ItemSelected’ erase what’s after ‘AdapterView’ and type ‘parent, View v, int position, long id) {‘
  15. Under that type ‘mSwitcher.setImageResource(mImageIds[position]);’
  16. Go to the top, and import ‘android.widget.ViewSwitcher;’ don’t touch any of the errors. Go back down to where you were typing, and under ‘NothingSelected’ import the ‘View makeView’

Android 1: Lesson 13

Android 1: Lesson 13: Image Swiper Part 2


INTRODUCTION
In this lesson you will be Importing a few more pictures into your app, and you’ll be creating an Activity that allows you to swipe in between them
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Swipe in between a few images
2. Add another Activity to the menu
3. Completely understand the manifest
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
Assignments
  1. Above the ‘return null’ type ‘ImageView i = new ImageView(this);’ import it
  2. Enter ‘i.setBackgroundColor(0xff000000);’ this should match up with what you had down in your xml
  3. Enter ‘i.setScaleType(ImageView.ScaleType.FIT_CENTER);’ this is how the picture fits on screen.
  4. Enter ‘i.setLayoutParams(new ImageSwitcher.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));’ go to the top and import ‘android.widget.Gallery.LayoutParams’
  5. Change ‘null’ to ‘i’
  6. Under the View ending brackets type ‘private ImageSwitcher mSwitcher;’
  7. Enter ‘public class ImageAdapter extends BaseAdapter’ You are extending another activity within this activity. Import the BaseAdapter, and add unimplemented methods of ImageAdapter
  8. Enter ‘public ImageAdapter(Context c) {
  9. Enter ‘mContext = c;’
  10. When you added the implemented methods of ImageAdapter, it generated some code. For the ‘getCount’ change 0 to ‘mSpaceIds.length’
  11. For ‘getItem’ change null to ‘position’
  12. For ‘getItemId’ change 0 to ‘position’
  13. Move down to the ‘getView; Above the ‘return’ type ‘ImageView i = new ImageView(mContext);’
  14. Enter ‘i.setImageResource(mSpaceIds[position]);’
  15. Enter ‘i.setAdjustViewBounds(true);’
  16. Enter ‘i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));’
  17. Enter ‘i.setBackgroundResource(R.drawable.testbackground);’ ‘testbackground’ should be whatever you named that picture that is in your drawable folder from the Logo lesson.
  18. Change null to i
  19. Under the ‘getView’ ending brackets, type ‘private Context mContext;’ import the context
  20. Under the ending brackets of that type ‘private Integer[] mSpaceIds = {R.drawable.pic1, R.drawable.pic2’
  21. Enter ‘private Integer[] mImageIds = {R.drawable.pic1, R.drawable.pic2’ for pic1 and 2, type out the names of the pictures you put in your app folders.
  22. Export and see how it works!

Android 1: Lesson 10

Android 1: Lesson 10: Accelerometer Part 1



INTRODUCTION
In this lesson you will be getting access to your accelerometer. And being able to read the x, y, and z values that it gives it.
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Access your accelerometer
2. Be able to read what the accelerometer is reading
3. Be able to set up a Sensor and SensorManager Activity
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
Assignments
  1. We’ll briefly hit the points for the XML layout in this one, you should be good with TextViews.
  2. Create a new XML document. We called it ‘accel’
  3. If it isn’t in ‘RelativeLayout’, then change the ‘LinearLayout’.
  4. Change the width and height to ‘match_parent’, and add ‘android:id=”@+id/relative” ‘ at the bottom.
  5. We’ll have 4 TextViews in this app. Make the first of them a slightly bigger text size than the others, because it will be the title. Name them like we do.
    1. ‘android:id=”@+id/name” ‘
    2. ‘android:id=”@+id/xval” ‘
    3. ‘android:id=”@+id/yval” ‘
    4. ‘android:id=”@+id/zval” ‘
  6. Make the width ‘fill_parent’ and the height ‘wrap_content’. Also, add
    2.‘android:layout_below=”@+id/name” ‘
    3.‘android:layout_below=”@+id/xval” ‘
    4.‘android:layout_below=”@+id/yval” ‘
    making them show up in that order
  7. Now for the Java. Start a new class, name it Accelerometer. Type ‘extends Activity implements SensorEventListener’ within the brackets. Import the Activity and SensorEventListener. And add the unimplemented methods of the Accelerometer.
  8. Now after the brackets, type ‘private SensorMangager mSensorManager;’
  9. Enter, ‘private Sensor mAccelerometer;
  10. Enter, ‘TextView title,tv, tv1,tv2;’
  11. Enter, ‘RelativeLayout layout;’
  12. Import ‘onCreate(Bundle)’ like you did in lesson 9.
  13. Below the ‘super.onCreate’ type, ‘setContentView(R.layout.accel);’
  14. Enter ‘mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
  15. Enter ‘mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);’

Android 1: Lesson 11

Android 1: Lesson 11: Accelerometer Part 2



INTRODUCTION
In this lesson you will be getting access to your accelerometer. And being able to read the x, y, and z values that it gives it.
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Access your accelerometer
2. Be able to read what the accelerometer is reading
3. Be able to set up a Sensor and SensorManager Activity
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
Assignments
  1. Continuing onwards, hit Enter ‘layout = (RelativeLayout)findViewById(R.id.relative);’
  2. Enter ’title=(TextView)findViewById(R.id.name); ’
  3. Enter ’tv=(TextView)findViewById(R.id.xval);’
  4. Enter ’tv1=(TextView)findViewById(R.id.yval);’
  5. Enter ’tv2=(TextView)findViewById(R.id.zval);’
  6. The ‘onAccuracyChanged’ should be untouched, and you won’t need to add any code here.
  7. The ‘onSensorchanged’ however will need a bit of coding. After the brackets add ‘float x = event.values[0];’
  8. Do the same for y and z, but setting y values to 1, and z to 2.
  9. Enter ’title.setText(R.string.app_name); ’ you’ll actually want to type ‘app_name” here, because it is referring to the ‘string.xml’ document, which is under the ‘values’ folder.
  10. Enter ’tv.setText(“X axis” + “tt” + x); ‘
  11. You’ll want to do the same for the y and for the x.
  12. Just changing all xs to y and z, and ‘tv’ to ‘tv1’ for y and ‘tv2’ for z.
  13. Import ‘onResume’ and ‘onPause’ like you did for the ‘onCreate(Bundle)’
  14. Under ‘Resume’ , before the ending bracket, you’ll want to type ‘mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);’
  15. Now for ‘Pause’, again before the ending bracket, you’ll want to type ‘mSensorManager.unregisterListener(this);’
  16. Now open up your Manifest.You’ll need to do something slightly different this time. Copy and paste the MainActivity activity below it. And cut out the ‘action’ and the ‘category’ They are unneeded.
  17. Change ‘MainActivity’ to the ‘Accelerometer’
  18. Also open up the Menu.java and change one of the examples to the same as the Java for your accelerometer.
  19. Export the app and see what your phone reads! If laying on a table, x and y should both read about 0, not absolutely zero because it will read the tiniest vibration. z will read the pull on the phone, aka, gravity, so it should read around 9.8. All of the readings will be in meters per second.

Android 1: Lesson 8

Android 1: Lesson 8: Logo and Start up music Java


INTRODUCTION
In this lesson you will be completeling the Java for the Logo and Start up music, and finally exporting your app
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Java for Logo
2. Java for music
3. Exporting
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
Assignments
Java
  1. After the ‘onCreate(Bundle’ you’ll see ‘savedInstanceState’ You can change this to anything you’d like. Just make sure that you change the ‘super.onCreate’ to the same thing. It is renaming the variable
  2. Hit enter and type out ‘setContentView(R.layout.background);’ make sure ‘background’ is changed to whatever you name your xml in your layout.
  3. Now we’ll need to go into the ‘AndroidManifest.xml’. This is the god of the app. It tells the app what to start first, and how to start it. The Manifest is below the ‘res’ folder.
  4. In the AndroidManifest.xml, you’ll see a lot of code. Highlight the ‘activity’ and copy it and paste it right below. Java likes it if the first activity is the one that starts first, so the Logo class.
  5. Move your cursor to the ‘android:name’ and change ‘MainActivity’ to the name of the Logo class. Make sure that the capitalization is correct.
  6. Move down to the MainActivity activity and change the ‘LAUNCHER’ to  ‘DEFAULT’
  7. Now go back to the java and type ‘ourSong = MediaPlayer.create(yyy.this, R.raw.xxx);’ yyy should be whatever the Java is called, and xxx should be whatever the name of your song is in your raw folder.
  8. Hit enter and type ‘ourSong.start();’
  9. Hit enter and type ‘Thread timer = new Thread(){‘
  10. Hit enter and type ‘public void run(){‘
  11. Hit enter and type ‘try{‘
  12. The ourSong java is telling the app that it will be playing music, along with the Mediaplayer. The thread timer is telling the app that it will only be for a certain amount of time, and that is going to be defined in the try section. The public void is an open class.
  13. After ‘try{‘ hit enter and type ‘sleep(5000);’ this is telling the app to kill the music and the background after 5 seconds (5000 milliseconds).
  14. Hit enter again and type ‘} catch (InterruptedException e){‘ enter ‘e.printStackTrace();’
    These are telling the app to check to see if the Java fully stopped, and if not, to stop it.  
  15. Enter ‘}finally{‘ enter ‘Intent openStartingPoint = new Intent(“xxx.MainActivity”);’ xxx should be your class home, where all the java is. This piece of code tells the app what to start after the music and background finish.
  16. Close off that piece of code using ‘;’, there usually is an error or two with closing, sometimes following what the software says is the right way to do it, sometimes not.
  17. Enter ‘timer.start();’
  18. Close that off with ‘}’ under it. Hit enter again and right click. Go to ‘source’ and then to ‘override’ again. This time select ‘onPause’ and hit ok.
Exporting
  1. Ok. Now we can finally export. Make sure there are no errors throughout your app, if there are, the app most likely will crash when you try to start it. Make sure everything is closed with either ; or }
  2. Right click on your app, go down to ‘Android Tools’ then ‘Export Signed Application Package’
  3. Choose the project and hit next
  4. Click ‘Create new keystore’ choose where you want to save the app. And make a password. Hit next.
  5. Fill in an Alias, this will be what shows up on the market place, if you decide to put it on there. Pick another password. pick a ‘Validity’ which will be up to 1000 years. And fill in at least one field below. Hit next
  6. Choose where you want to save the .apk file, and there you go. You have exported. Just move the .apk file and put it on your phone and install it using any file finder app.

Android 1: Lesson 9

Android 1: Lesson 9: List Menu


INTRODUCTION
In this lesson you will be creating a Menu that will list all of your activities in your app and allows you to pick which one to start
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
1. Create a List Menu
2. To expand your app with more Activities
3. Know more about the Manifest
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
Assignments
  1. Create a new class called ‘Menu’
  2. After Menu, type ‘extends ListActivity’, import it
  3. Below that line of text, right click and go to ‘source’ and go ‘override’ and you’ll see ‘ListActivity’ which was imported. Select ‘onCreate(Bundle)’ and hit ok.
  4. go below the ‘}’ and do the same as above, but select ‘onListItemClick’
  5. Inbetween the public class at top, and the override, Type out ‘String classes[] = { “MainActivity”, “example1”, “example2”};’ You can put as many examples as you want. This is what the Menu will actually show. The names should be the names of the classes
  6. Below the first override, under the super type ‘setListAdapter(new ArrayAdapter(Men.this, android.R.layout.));’ after the ‘layout.’ you’ll want to pick the ‘simple_list_item_1’ this will put the code in automatically for you. After that type’, classes’
  7. Ok now move below the second override. Type ‘String xxx = classes[postion];’ xxx can be anything you want. It’s just making it easier for you in the code to follow.
  8. Enter, ‘try{‘
  9. Enter ‘Class ourClass =  Class.forName(“xxx” + easy); xxx should be your package, make sure there is a period after the package and before the final “
  10. Enter ‘Intent ourIntent = new Intent(Menu.this, ourClass);’ import the intent
  11. Enter ‘startActivity(ourIntent);’
  12. After the ‘}’ right below the code you just typed, type ‘catch (ClassNotFoundException e){‘
  13. Enter ‘e.printStackTrace();’
  14. Now open up your ‘AndroidManifest.xml’, you’ll need to add the menu to it.
  15. Copy the MainActivity activity, and paste it above
  16. Change MainActivity to the name of your Menu class.
  17. Also change ‘.STARTINGPOINT’ to ‘.MENU’ save and export
  18. Congrats! you made a menu! export the app and test it!

Android 1: Lesson 7

Android 1: Lesson 7: Icon, Logo, and Start up music


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
  1. First, for the icons, you’ll want to make sure that the icons are the correct size.
  2. 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
  3. Within the workspace folder, you’ll see your app folder
  4. Open up the app folder and you’ll see a few folders and some other icons. Double click on the res folder
  5. 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
  6. Open the pictures in any photo editing software and change them to anyway you please
  7. When you save the pictures, make sure that they are the correct size, and that they are .png pictures
Logo
  1. For the logo, we’ll be displaying an image and playing a sound for a bit before the app officially opens
  2. In any photo editor, make an image that is 400×600, this will be your background. Make sure it’s a .png
  3. 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
  4. 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.
  5. Now open eclipse and go to the layout folder. Create a new xml.
  6. Right click on the ‘layout’ folder. Move your mouse to ‘New’ and then select ‘Android XML File’
  7. Name it whatever you want, I chose logo.
  8. After ‘android:orientation’, you’ll want to add the piece of code ‘android:background=”@drawable/*whatever you named your background*” ‘
  9. 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’
  10. 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.
  11. Move the cursor down past the ‘{‘ and hit enter. Type ‘MediaPlayer ourSong;’ import MediaPlayer.
  12. Hit enter and right click under ‘MediaPlayer’ Hover down to ‘Source’ and click on ‘Override/Implement Methods’
  13. Under ‘Activity’, you’ll want to select ‘onCreate(Bundle)’ and hit ok.

Sports Marketing Final Project: Photoshop Marketing Project

You and a partner have become partners in a Marketing & Graphic Design Firm which has received the
account for an NBA,NHL,NFL and MLB team. You will be assigned a team and asked to create an interior
and exterior marketing message for the team using the following themes:

Graphic 1: A timeline of team history using images and text which spans across a a 30 foot long wall which is 10 feet high.
You will be responsible for creating the graphic on an 8×10 format and also a  transferred copy of your design to photo of the interior provided you.
Link To Interior

Marketing Components:Product,Price,Place,Promotion,Branding,Team History

Photoshop Components:
multiple layers
layer effects & styles
fonts and font styles
shape tools and effects
resizing images and removing backgrounds as necessary for aesthetic purposes
5-10 total images

Graphic 2: An exterior poster marketing the upcoming season which can be used as an exterior poster and also a graphic for tv broadcast.

Marketing Components:Product,Price,Place,Promotion,Branding,Endorsement

Photoshop Components:
12-20 total images
multiple layers
layer effects & styles
fonts and font styles
shape tools and effects
resizing images and removing backgrounds as necessary for aesthetic purposes

Graphic 3:
After completing the timeline and poster using your Photoshop skills place the two graphics into your choice of interiors provided below. Be sure to place them propotionately correct and in proper size to the background. When all graphics are completed email me all three or four images(if two interiors) to:
danieldownsphotography@gmail.com

Photoshop Tools:
Resizing images
Skew and distort
Removing Backgrounds


Final Screen-cast Presentations Business Logo>Card>Brochure>Web Page Project

Final Screen-cast Presentations Business Logo-Card-Brochure-Web Site Project
Web Design 1 & 2
Mr.Downs
Tools: Screen-castomatic,Google Documents,Desktop Computer

Description:Using screen-cast-omatic you will create a detailed video in which describe the tools and
software used(Photoshop,Dreamweaver,Notepad,Illustrator,Templates for Brochures,Business
cards) and your own “personal design process” in the creation of the graphics for your web
design business.
In the videos you should show and describe your graphics work and “walk through the
process” of designing the logo by hand,bringing it into Illustrator and designing the business
card,brochure in Photoshop and ultimately the web page design skills used for your business
web page.
Be sure to discuss relevant topics such as the content of your materials and slogans and
taglines. Make clear in the video how all the components connect together “cohesively” .
Please write a thorough outline of how and what you will discuss in the video. Speak clearly and
intelligently and use no vulgar language. Be respectful of other students making their videos as
well.
Time Requirements For Video: 10 minutes
Content Requirements:
1.Thorough well developed outline to work from while discussing workconsideration for
the topics included above.(5 points)
2.Collected folder of work containing all files easily accessible while making the video.(5
points)
3. Logo design on paper and in final Illustrator.(20 points)
4. Final business card designed in Photoshop saved as a JPEG.(20 points)
5. Final Brochure Interior and Exterior Panels(2 separate files) saved in JPEG format.(25
points)
6. Final Website Design using mobile template with your content integrated and
organized to your personal business needs. Changes in color,text,layout,images.(25
Points)
*****Please see the “Dr.Downs Screencast
Video Guide Sheet” For More Details on
using screencastomatic.*************************