About the Book
The Busy Coder's Guide to Android Development is a book covering Android application development, from basics
through advanced capabilities. It is updated several times a year and is available through
the Warescription program. Subscribers also have access to office
hours chats and other benefits.
This repository contains the source code for the hundreds of sample apps profiled in the book. These
samples are updated as the book is, with git tags applied to tie sample code versions to book
versions.
The book, and the samples, were written by Mark Murphy. You may also have run into him through
Stack Overflow:
About the Code
All of the source code in this archive is licensed under the
Apache 2.0 license except as noted.
The names of the top-level directories roughly correspond to a
shortened form of the chapter titles. Since chapter numbers
change with every release, and since some samples are used by
multiple chapters, I am loathe to put chapter numbers in the
actual directory names.
Using in Android Studio
All of the projects should have a build.gradle file suitable for
importing the project into Android Studio. Note, though, that you
may need to adjust the compileSdkVersion in build.gradle if it
requests an SDK that you have not downloaded and do not wish to
download. Similarly, you may need to adjust the buildToolsVersion
value to refer to a version of the build tools that you have downloaded
from the SDK Manager.
The samples also have stub Gradle wrapper files, enough to allow for
easy import into Android Studio. However,
always check the gradle-wrapper.properties file before importing anything into Android Studio,
as there is always the chance that somebody has published material linking you to a hacked Gradle installation.
Using with Command-Line Gradle
Right now, you will need your own local installation of Gradle 3.3
in order to build the projects from the command line, as the repository
does not contain gradlew or its corresponding JAR for security reasons.
List of Samples
ACRA/
Accessibility/
ActionBar/
ActionBarDemoNative
HoloColor
MaterialColor
MaterialLogo
OverlayNative
SearchView
ShareNative
VersionedColor
ActionMode/
ActionModeMC
LongPress
ManualNative
Activities/
Explicit
Extras
FullScreen
LaunchWeb
Lifecycle
AlarmManager/
AlarmClock
AntiDoze
Scheduled
Simple
WakeCast
Wakeful
Animation/
AnimatorFade
AnimatorFadeBC
ObjectAnimator
SlidingPanel
SlidingPanelEx
ThreePane
ThreePaneBC
AppCompat/
ActionBar
ActionBarColor
ActionModeMC
Basic
Overlay
SearchView
Share
StatusBarColor
AppWidget/
LoremWidget
PairOfDice
Resize
TwoOrThreeDice
Assist/
AssistLogger
MoAssist
NoAssist
TapOffNow
Backup/
Bandwidth/
Basic/
Button
CheckBox
Field
ImageView
Label
RadioButton
Switch
ToggleButton
BasicMaterial/
Button
CheckBox
Field
RadioButton
Switch
Binding/
Callback/Client
Callback/Service
Local
Remote/Client
Remote/Service
SigCheck/Client
SigCheck/Service
Bitmaps/
Calendar/
Camera/
Content
EXIFRotater
FileProvider
ZXing
ConfigChange/
Bundle
DIY
FragmentBundle
Fragments
Contacts/
CallLog
Inserter
Spinners
Containers/
LinearPercent
Relative
RelativeOverlap
Scroll
Table
ContentProvider/
ConstantsPlus
Files
GrantUriPermissions
Pipe
V4FileProvider
CPU-Java/
AIDLOverhead
GoAsync
PrefsPersist
Database/
ConstantsAssets-AndroidStudio
ConstantsROWID
ConstantsSecure-AndroidStudio
FTS
SQLCipherPassphrase-AndroidStudio
DataBinding/
Basic
Chained
Conversion
Observable
Picasso
RecyclerView
Scored
Static
TwoWay
DesignSupport/
CoordinatedFAB
FAB
FABClans
FloatingLabel
FloatingLabelNative
Snackbar
SnackbarAction
TabLayout
TabLayoutPizza
DeviceAdmin/
LockMeNow
PasswordEnforcer
Diagnostics/
Activity
Overlay
WebServer
Dialogs/
Documents/
Consumer
DocumentTree
Provider
TinyTextEditor
DragDrop/
Action
Permissions
Simple
Drawable/
AnyVersusNo
Gradient
NinePatch
ScaleClip
Shape
TileMode
Vector
EventBus/
AsyncDemo
AsyncDemo3
GreenRobot
GreenRobot3
LocalBroadcastManager
Otto
Files/
Focus/
Fonts/
Fragments/
ActionBarNative
Dynamic
Static
GridLayout/
HTTP/
OkHttpProgress
Picasso
Retrofit
Volley
InputMethod/
Intents/
FauxSender
FauxSenderMNC
Local
OnBattery
OnBoot
Internet/
CA
Download
HttpClient
HTTPStacks
HURL
OkHttp
OkHttp3
Weather
Introspection/
CPProxy
EnvDump
FauxSender
Launchalot
PrefActivities
ProcessText
ProcessTextBlocker
QuickSender
Resolver
SAWMonitor
SAWMonitorTile
URLHandler
URLHandlerMNC
Jank/
JNI/
JobScheduler/
JVM/
KBMouse/
Context
CopyPaste
Hotkeys
HotkeysN
Tooltip
LargeScreen/
EU4You
EU4YouSingleActivity
EU4YouSlidingPane
EU4YouStaticCountries
Leaks/
AsyncTask
ConfigChange
Downloader
LeakedThread
StaticWidget
StaticWidgetLC
Leanback/
Loaders/
Location/
Manifest/
MapsV2/
Animator
Basic
Bounds
Camera
Drag
FlatMarkers
ImagePopups
Location
Markers
Models
MyLocation
MyLocationMNC
NooYawk
Pager
Poly
Popups
Taps
Media/
Audio
AudioRecording
AudioRecordStream
SoundRecordIntent
Video
VideoList
VideoRecordIntent
MediaProjection/
andcorder
andprojector
andshooter
MediaRouter/
ActionProvider
MRPLogService
RemotePlayback
RouteProvider
MiscSecurity/
MiscUI/
MultiWindow/
Classic
Legacy
MWSampler
MWTester
OptIn
NavDrawer/
NFC/
FileBeam
SecretAgentMan
URLTagger
WebBeam
Notifications/
BigLocal
BigNotify
CustomView
DownloadNotify
Foreground
FullScreen
Lollipop
Messaging
Pages
RemoteInput
Stacked
VoiceInput
WearActions
Parcelable/
Percent/
Permissions/
PermissionMonger
PermissionReporter
tutorial
Phone/
Prefs/
CustomSubtitle
Dependency
Fragment
FragmentsBC
NestedScreens
SingleHeader
SingleHeader2
Presentation/
Decktastic
Fragment
Simple
Simpler
Slides
Printing/
Progress/
BarSampler
Dialog
Styled
TitleBar
RecyclerView/
ActionModeList
ActionModeList2
ActivatedList
CardClickList
CardRippleList
CardRippleList2
CardRippleList3
CardViewList
ChoiceList
ExpandableRow
FlexDividerList
Grid
HeaderList
HorizontalVideoList
ManualDividerList
SimpleList
SingleActivatedList
SingleActivatedListKB
SortedList
VideoList
VideoTable
RestrictedProfiles/
RichText/
Selection/
AutoComplete
Checklist
Dynamic
Grid
HeaderDetailList
HeaderFooter
List
RateList
Spinner
ViewHolder
Sensor/
Service/
SMS/
Styles/
SystemEvents/
SystemServices/
ClipboardMonitor
ClipIP
ClipMusic
Tapjacking/
Tasks/
Docs
NoHistory
Nukesalot
PersistentCanary
ReparentDemo
RoundRobin
TaskCanary
Tasksalot
Testing/
Coverage
Espresso
EspressoIdle
EspressoIntents
EspressoMatcher
JUnit4
UiAutomator
Threads/
Toolbar/
EU4YouToolbar
SplitActionBar
SplitActionBar2
SplitActionBarCompat
UnitTest/
ViewPager/
ActionBar
Columns1
FlexColumns
Fragments
Indicator
MultiView1
MultiView2
Nested
Views/
ColorMixer
ReverseChronometer
WebKit/
Browser1
Browser2
Browser3
Browser4
GeoWeb1
GeoWeb2
WebServer/
Reusable
Secure
Simple
Template
WebSockets
WidgetCatalog/
AdapterViewFlipper
CalendarView
DatePicker
ExpandableListView
SeekBar
SlidingDrawer
StackView
Tab
TimePicker
ViewFlipper