Skip to content

An evolving project given as a reference for Android course at Shenkar College of Engineering and Design

Notifications You must be signed in to change notification settings

auval/AndroidWorkshop

Repository files navigation

Android Development Workshop

Shenkar
Amir Uval

Useful links

Workshop Lessons


Lesson #1

Slides

Installing & Configuring Android Studio

Install Android SDK's

Recommended Plugins:

Useful Android Studio shortcuts: (And More Shortcuts)

Operation Shortcut
Comment line Ctrl+/
Duplicate line (or selection) ctrl+d
Go to last edited location ctrl+shift+Backspace
Jump to a particular type or file Shift, Shift
Move lines up or down ctrl+shift+up or ctrl+shift+down arrow
Navigate left Alt+Left arrow (Mac: Command+Shift+[)
Navigate right Alt+right arrow (Mac: Command+Shift+])
Navigate to the source definition Windows+Click (Linux: ctrl+click, Mac: Command+click)
Open Settings ctrl+alt+s
Organize the import statements Ctrl+Alt+O
Reformat file alt+ctrl+shit+L
Rename an object Shift+F6
Search through files Ctrl+Shift+F (Mac: Command+Shift+F)

Tips:

  • Use middle button of the mouse to select across rows, and edit all.

Homework: Create a project in Android studio and upload it to your GitHub account.


Lesson #2

Slides

Useful git commands:

  • git status
  • git log
  • git show: Show various types of objects
  • git tag: tag specific points in history as being important
    • for example, these commits were tagged with annotation and comment:
      • git tag -a 2 -m "lecture #2"
      • git tag -a 2.1 -m "lecture #2.1"
    • you can now jump between them using:
      • git checkout 2 (..or 2.1)
    • you can see the diff between 2 tags (or between branches) by adding /compare to the end of the github workspace URL.
  • git add .
    • adds all un-staged files to your local git index

Lesson #3

Slides

####class exercise

  • Make main menu for exercises
    • Refactoring: rename MainActivity and related layout to Lesson2Activity and lesson2_layout
    • Create a new MainActivity to serve as a high level menu for exercises
    • Mark the new activity as MAIN in the manifest

Lesson #4

Slides

Code compare

print the content of the property file on the emulator

adb -s emulator-5554 shell 'cat /data/data/org.shenkar.auval.codesamples/shared_prefs/org.shenkar.auval.codesamples_preferences.xml'

Tips

  • clone this workspace to your local pc

  • creating App Toolbar activity

    • Follow the tutorial
      • It's missing some important steps, so read here as well.
    • create an svg resource icon
      • New > “Vector Asset” from the context menu
    • define some menu options
      • New > “Android resource directory” from the context menu
      • Change the “Resource type” drop-down to be “menu”, then click OK to create the directory
      • right-click over your new res/menu/ directory and choose New > “Menu resource file” from the context menu
      • name it "lesson3.xml"
      • add <item> resources, like the example in the tutorial or your own.
    • Add onCreateOptionsMenu(Menu menu) {} to the activity, to inflate menu items

Lesson 5

Slides


Lesson 6

RecyclerView, Scene Transitions, Low Level Graphics

Slides


Lesson 7

 Custom View Animation

Slides

Lots of examples:

  1. Animated view (rotating dot): MyAnimatedGraphicsView
    • This view draws directly on the screen buffer, which clears every frame.
  2. Animated view (rotating dot on offscreen Bitmap): MyBitmapAnimatedGraphicsView
    • This view draws on an offscreen Bitmap I created, so on each draw I add just one dot, and the bitmaps keeps all the past drawings.
    • It calculates dot position as a function of time, so the movement is independent neither of the speed of the phone nor hiccups of the UI thread.
  3. SpriteAnimationActivity just puts a custom ViewGroup on the screen.
    • Notice that instead of ConstraintsLayout as root in the xml I use SpriteAnimationView. custom ViewGroup.
    • The animation happens in SpriteAnimationView
  4. SvgViewsActivity demonstrates using SVG as a background image, and 4 svgs as frames for animation-list drawable.
    • The drawable is set as src of ImageView, and started from the Activity.
    • When touching a butterfly, it will fly elsewhere, using Scene Transition. This may be a useful reference for building your own game.
    • Notice that this activity has fixed orientation set in AndroidManifest.xml.
  5. BmpAndSvgActivity is not animated. It demonstrates combining simple Bitmap as a background and an SVG as a srcCompat drawable of a view.
    • Notice how the svg doesn't lose quality when scaled up or down.
    • On the upper right corner there's a cool (but complex) hack: I took the SVG parsing code from the support library, and here I demonstrate how I turned a raw SVG to a Path object that Canvas can draw directly.

Note regarding working on the project: You should learn this method on how to collaborate using GitHub. Both students must contribute.


Lesson 8

 Sound & Music

Slides


Lesson 9

- Help with projects

Slides

Lesson 10

- Testing
- Firebase Analytics
- Building APK for production

Slides

testing from command line: gradlew test


####Download Project apk

####All the lessons slides


project specifications

About

An evolving project given as a reference for Android course at Shenkar College of Engineering and Design

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages