Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.


AnDevCon Boot Camp

The Android Development Boot Camp for AnDevCon IV in December 2012 by Jim McKeeth and Mike Wolfson

Jim McKeeth

on 4 December 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of AnDevCon Boot Camp

Development Android
Boot Camp About Us About Mike @mikewolfson About Jim Developer Tools Company
Android, iOS & .NET
20% Discount AnDevCon4 Meta Agenda Install & Configure Android Tools
Overview of Android Development
Hands-on Android Lab
Tools & Debugging
Other Conference Sessions
Questions & Answers Installation Java JDK Is Android Java? Java Developer Kit
(JDK) Android Developer Tools
(ADT) Same Libraries
Same syntax
Same tools ADT Bundle Eclipse IDE
ADT Plugin
Latest Platform
Latest System Image
Emulator Work in progress
More slides coming
and continuous updating Java JDK Install in default
location for platform. ADT Bundle Mac Instructions Unzip into /Developer
Final paths should be:
/Developer/adt/eclipse ADT Bundle Win Instructions Unzip into C:\Development
Or somewhere with write permissions.
Don't use C:\Program Files ADT Overview Eclipse IDE
SDK Manager
AVD Manager
Command Line Tools
Learn more:
http://developer.android.com/sdk/ AnDevCon IV - December 2012
Jim McKeeth - RemObjects Software
Mike Wolfson - Able Android Android SDK Manager Android Virtual Device (AVD) Manager Making a device debuggable
Settings > Developer Options
USB Debugging
Installing device drivers
From Hardware Manufacturer
Hack the Google USB Drivers
Connecting to a device using ADB
adb devices
Restarting ADB (troubleshooting)
adb kill-server
adb start-server
(Rooted devices can use ADB Wireless) Setup Device Android Virtual Device (AVD) Manager Device Definitions
Hardware & Sensors (Camera)
Performance issues
Eclipse device perspective
Completely supported via ADB command-line HelloWorld.apk Import into Eclipse Debugging Intro Make app debuggable
Using ADB Hands-on Lab Expense Tracker Generate expense item
Amount of expense
Use web service currency conversion
Share expense item BDTSD Process Maximum Interactivity for Understanding and Retention Benefit Introduction
Discussion - Why Useful
Technical Details
Show - We show a demo
Do - You Do it "hands-on" Retention Questions increase retention
Understand the why, before the how
10/24/7 Rule for maximum retention
Recap in 10 minutes
Review in 24 hours
Attend more sessions and review for 7 days Understanding "What I hear I forget,
What I see I remember,
What I do I understand."
- Xunzi (245 BC) Confucian scholar New Project Wizard Activity Provides a Screen Interacts with user
Display information
Collect input
Usually fills screen
May float over others
Respond to layout events What are some
uses for Activities? Is a
App Widget
an Activity? What kind of Apps
might not include any
Activities? Layouts A ViewGroup that defines the
Visual Structure for a
user interface (within an activity) Different layout types for different structures
Not visible itself, but controls the way views are structured
A Layout adds attributes to Views it contains
Can be nested, but try to keep it shallow Views & ViewGroups Displaying in an Activity Views draw on the screen
ViewGroups hold other Views or ViewGroups Linear Layout All children are in a row
Orientation is Horizontal or Vertical
Adds scroll bar if necessary Relative Layout Child objects locations are relative to:
To the parent object
Aligned to top
Other child objects
Left, Right, etc. vs. Linear Layout Relative Layout Differences?
When use each? Show & Do Meta Meta Meta Demo Getting Started 1 Create New Project
2 Start emulator or connect device
3 Checkpoints
3.1 Access Git
3.2 Import Code
3.3 Overview of Process 1, 2, 3 Checkpoint Display Title
Add edit texts bellow title
Use LinearLayout
Use strings.xml Show & Do Checkpoint Add button
Switch to Relative Layout
Align button to right
Align text views to fill parent Show & Do Checkpoint Change amount edit to use current keyboard
Add hints for both edits
Apply margins 3:4:6:8 Ratio Icon Sizes
36x36 for low-density
48x48 for medium-density
72x72 for high-density
96x96 for extra high-density Screen Sizes & Densities Four Sizes small
xlarge Four Densities ldpi (low)
mdpi (medium)
hdpi (high)
xhdpi (extra high) Measurements Not just metric vs. imperial dp - Density-Independent Pixels
Relative to density of screen
Based on 160 dpi screen
sp - Scale-Independent Pixels
Scales with font preference
pt - Points 1/72 of an inch
px - Pixels
mm & in - Millimeters & Inches Why should you always use dp (Density-Independent Pixels) for UI elements and sp (Scale-Independent Pixels) for fonts? What happens if drawables are not provided for each density? Show & Do Checkpoint Make the button an arrow
Change the app icon
Using AssetTool create image resources for each resolution Activity Lifecycle Destroyed when memory is needed
Persist state in onPause
Restore state in onCreate
Heavy-load persistence in onStop
Use onDestroy to clean up long used resources
Activity never stays in Created or Started states When do you destroy background threads?
When best to persist to a database?
What state interacting with the user?
When to restore state?
Which event might not get called? Learn more http://sn.im/android-activity-lifecycle ??? ??? logcat Peek Inside a Running Android Access output via IDE or "adb logcat"
Log messages at different levels with custom tags
TAG is a string, usually class name.
Log.wtf(TAG, "What a Terrible Failure");
Log.e(TAG, "This is an Error");
Log.w(TAG, "Just a Warning");
Log.d(TAG, "Useful Debugging");
Log.i(TAG, "Just Information");
Log.v(TAG, "Very Verbose - chatty"); Why remove Log calls when you ship?
Why leave Log calls in a shipping app?
Purpose of TAG?
Purpose of different levels?
When would you use the debugger?
When would you use logging? ? ? ? ? ? ? Show & Do Checkpoint Capture button and activity events
Add log statements to each event
Use logcat in Eclipse
Use adb logcat Manifest Describes Your App Unique package name
Needed permissions
Minimum API level
Linked Libraries
Describes components
Content Providers
Broadcast Receivers
Intent Filters <manifest/> Services Long running operations
No user interface
Can run when App is not in use
Runs in main App thread
May be restarted by system
Optionally accessible outside of your app Services What are service use cases?

What are risks of a service? ??? Content Providers Manage access to structured data
Encapsulates the data
Provides security controls
Used to share data between processes
Used to copy and paste complex data
An app may consume another content provider, publish a provider, or both Content Providers What is a content provider your app might consume, and how?

What is a content provider your app might publish? ??? Calendar
Media Store
Call Log
User Dictionary Some Built-In Content Providers Show & Do Checkpoint Create a new Activity
Make it the default
Edit the layout Intents Message objects passed between activities, services and broadcast receivers
Used to launch new activities and services
Simple communication between apps via broadcast receivers
Can request result back
Can pass simple data
Either to Explicit class, or Implicitly via Intent Filters Show & Do Checkpoint Change main activity back to default
Use intent to start details activity http://sn.im/android-actionbar Action Bar Pattern Action Bar Flexibility What are the pros and cons of a dedicated action bar vs. a traditional Android menu? Current Android Device Distribution Action Bar requires API level 11! Based accesses to the Play store. Historical Distribution Alternatives to Increasing API Level Android Support Library
Include OS features in app specifically
Increases App size
Open Source Libraries
Similar functionality via 3rd-Party
ActionBarSherlock.com Show & Do Checkpoint Set API to 11
Add menu.xml
Main Activity
Implement ActionBar Show & Do Checkpoint Send String and Int values as Intent extras to Activity #2
ActionBar Intents to call system actions Permissions Asking permission for your app Defined in AndroidManifest.xml
User authorizes during install
Common permission examples:
SET_WALLPAPER Calling Web Services Android Web Framework
Don't block UI Thread
Need Permission
JSON Conversion Schedule 9:00 AM - Install & Overview
10:30 AM - Break
10:45 AM - Activities & Layouts
12:30 PM - Lunch
12:30 PM - Intents & ActionBar
3:00 PM - Break
3:15 PM - Web, AsyncTask, JSON, etc. The Code Github repository
Commit History has a check-in for each task
Use to catch up, or as a reference
View diff to see code changes Resources http://developer.android.com
http://vogella.com/android.html Wed
10:00 AM - Developer Tool Essentials, Part I
10:00 AM - Dive into Android Fragments
11:30 AM - Advanced Developer Tools, Part II
1:45 PM - Instrumentation 101
2:30 PM - Android OpenGL ES Essentials
4:00 PM - Making Successful Apps Thurs
8:30 AM - Android Fundamentals
11:30 AM - Android Tools and Techniques
1:45 PM - Optimizing Android UI
8:30 AM - Tips, Tricks and Secrets of the Android Multimedia APIs
3:30 PM - Exposing the Android Camera Stack Put a Socket In It! The Tale of Two Sockets DefaultHttpClient - Apache Socket library - Stable & Easy to use
HttpURLConnection - Active improvements & new development in after Android 2.3
Full transcript