Programming Windows Store Apps With HTML CSS and JavaScript Second Edition Kraig Brockschmidt Download
Programming Windows Store Apps With HTML CSS and JavaScript Second Edition Kraig Brockschmidt Download
https://textbookfull.com/product/programming-windows-store-apps-
with-html-css-and-javascript-second-edition-kraig-brockschmidt/
https://textbookfull.com/product/programming-windows-store-apps-
with-html-css-and-javascript-second-edition-kraig-brockschmidt/
https://textbookfull.com/product/sams-teach-yourself-html-css-
and-javascript-all-in-one-julie-c-meloni/
https://textbookfull.com/product/web-development-for-beginners-
learn-html-css-javascript-step-by-step-with-this-coding-guide-
programming-guide-for-beginners-website-development-1st-edition-
mastery/
https://textbookfull.com/product/sams-teach-yourself-html-css-
and-javascript-all-in-one-1st-edition-meloni-julie-c/
Web Design Playground: HTML + CSS the Interactive Way,
Second Edition Paul Mcfedries
https://textbookfull.com/product/web-design-playground-html-css-
the-interactive-way-second-edition-paul-mcfedries/
https://textbookfull.com/product/new-perspectives-on-html-5-and-
css-8th-edition-patrick-m-carey/
https://textbookfull.com/product/learning-php-mysql-javascript-
with-jquery-css-html5-5th-edition-robin-nixon/
https://textbookfull.com/product/new-perspectives-on-html-5-and-
css-comprehensive-8th-edition-patrick-m-carey/
https://textbookfull.com/product/reactive-programming-with-
javascript-1st-edition-hayward-jonathan/
PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
All rights reserved. No part of the contents of this book may be reproduced or tr ansmitted in any form or by any means
without the written permission of the publisher.
Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to
this book, email Microsoft Press Book Support at [email protected]. Please tell us what you think of this
book at http://aka.ms/tellpress.
Unless otherwise noted, the companies, organizations, products, domain names, e -mail addresses, logos, people,
places, and events depicted in examples herein are fictitious. No association with any real company, organization,
product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under
copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any
purpose, without the express written permission of Microsoft Corporation.
This book expresses the author’s views and opinions. The information contained in this book is provided without any
express, statutory, or implied warranties. Neither the authors, Microsoft Cor poration, nor its resellers, or distributors will
be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
1
Table of Contents
Introduction ........................................................................................................................ 21
Who This Book Is For ........................................................................................................ 23
What You'll Need (Can You Say “Samples”?) ...................................................................... 24
A Formatting Note............................................................................................................ 25
Acknowledgements .......................................................................................................... 26
Free Ebooks from Microsoft Press ..................................................................................... 28
The “Microsoft Press Guided Tours” App ........................................................................... 28
Errata & Book Support ...................................................................................................... 28
We Want to Hear from You............................................................................................... 29
Stay in Touch ................................................................................................................... 29
Chapter 1 The Life Story of a Windows Store App: Characteristics of the
Windows Platform .............................................................................................................. 30
Leaving Home: Onboarding to the Windows Store ............................................................. 32
Discovery, Acquisition, and Installation.............................................................................. 35
Playing in Your Own Room: The App Container .................................................................. 39
Different Views of Life: Views and Resolution Scaling ......................................................... 42
Those Capabilities Again: Getting to Data and Devices ........................................................ 46
Taking a Break, Getting Some Rest: Process Lifecycle Management ..................................... 49
Remembering Yourself: App State and Roaming................................................................. 51
Coming Back Home: Updates and New Opportunities ........................................................ 56
And, Oh Yes, Then There’s Design ..................................................................................... 58
Feature Roadmap and Cross-Reference ............................................................................. 59
Chapter 2 Quickstart .......................................................................................................... 65
A Really Quick Quickstart: The Blank App Template ............................................................ 65
Blank App Project Structure .......................................................................................... 68
2
QuickStart #1: Here My Am! and an Introduction to Blend for Visual Studio ........................ 72
Design Wireframes ....................................................................................................... 73
Create the Markup ....................................................................................................... 76
Styling in Blend............................................................................................................. 78
Adding the Code........................................................................................................... 83
Extra Credit: Improving the App ........................................................................................ 97
Receiving Messages from the iframe ............................................................................. 98
Improving the Placeholder Image with a Canvas Element ................................................ 99
Handling Variable Image Sizes ..................................................................................... 100
Moving the Captured Image to AppData (or the Pictures Library) .................................. 103
Using a Thumbnail Instead of the Full Image ................................................................ 105
The Other Templates: Projects and Items ........................................................................ 107
Navigation App Template............................................................................................ 107
Grid App Template ..................................................................................................... 107
Hub App Template...................................................................................................... 108
Split Template ............................................................................................................ 108
Item Templates .......................................................................................................... 108
What We’ve Just Learned ............................................................................................... 109
Chapter 3 App Anatomy and Performance Fundamentals .................................................. 111
App Activation ............................................................................................................... 112
Branding Your App 101: The Splash Screen and Other Visuals ....................................... 113
Activation Event Sequence .......................................................................................... 117
Activation Code Paths ................................................................................................. 119
WinJS.Application Events ............................................................................................ 121
Optimizing Startup Time ............................................................................................. 124
WinRT Events and removeEventListener.......................................................................... 126
App Lifecycle Transition Events and Session State ............................................................ 128
Suspend, Resume, and Terminate................................................................................ 129
3
Basic Session State in Here My Am! ............................................................................. 133
Page Controls and Navigation ......................................................................................... 136
WinJS Tools for Pages and Page Navigation .................................................................. 136
The Navigation App Template, PageControl Structure, and PageControlNavigator ......... 139
The Navigation Process and Navigation Styles .............................................................. 146
Optimizing Page Switching: Show-and-Hide ................................................................. 148
Page-Specific Styling ................................................................................................... 149
Async Operations: Be True to Your Promises .................................................................... 151
Using Promises ........................................................................................................... 151
Joining Parallel Promises ............................................................................................. 153
Sequential Promises: Nesting and Chaining .................................................................. 153
Managing the UI Thread with the WinJS Scheduler........................................................... 156
Scheduler Priorities .................................................................................................... 157
Scheduling and Managing Tasks .................................................................................. 158
Setting Priority in Promise Chains ................................................................................ 160
Long-Running Tasks .................................................................................................... 162
Debugging and Profiling.................................................................................................. 165
Debug Output and Logging.......................................................................................... 165
Error Reports and the Event Viewer............................................................................. 166
Async Debugging ........................................................................................................ 169
Performance and Memory Analysis ............................................................................. 170
The Windows App Certification Toolkit ........................................................................ 175
What We’ve Just Learned ............................................................................................... 176
Chapter 4 Web Content and Services ................................................................................ 177
Network Information and Connectivity ............................................................................ 179
Network Types in the Manifest.................................................................................... 180
Network Information (the Network Object Roster) ....................................................... 181
The ConnectionProfile Object...................................................................................... 183
4
Connectivity Events .................................................................................................... 184
Cost Awareness .......................................................................................................... 185
Running Offline .......................................................................................................... 189
Hosting Content: the WebView and iframe Elements ....................................................... 191
Local and Web Contexts (and iframe Elements) ............................................................ 192
Dynamic Content........................................................................................................ 195
App Content URIs ....................................................................................................... 197
The <x-ms-webview> Element..................................................................................... 198
HTTP Requests ............................................................................................................... 209
Using WinJS.xhr.......................................................................................................... 210
Using Windows.Web.Http.HttpClient........................................................................... 211
Suspend and Resume with Online Content................................................................... 216
Prefetching Content ................................................................................................... 218
Background Transfer ...................................................................................................... 219
Basic Downloads ........................................................................................................ 221
Basic Uploads ............................................................................................................. 225
Completion and Error Notifications ............................................................................. 226
Providing Headers and Credentials .............................................................................. 227
Setting Cost Policy ...................................................................................................... 227
Grouping Transfers ..................................................................................................... 228
Suspend, Resume, and Restart with Background Transfers ............................................ 228
Authentication, the Microsoft Account, and the User Profile ............................................ 230
The Credential Locker ................................................................................................. 231
The Web Authentication Broker .................................................................................. 233
Single Sign-On ............................................................................................................ 237
Using the Microsoft Account ....................................................................................... 238
The User Profile (and the Lock Screen Image) ............................................................... 244
What We’ve Just Learned ............................................................................................... 246
5
Chapter 5 Controls and Control Styling .............................................................................. 248
The Control Model for HTML, CSS, and JavaScript ............................................................ 249
HTML Controls ............................................................................................................... 251
Extensions to HTML Elements ..................................................................................... 254
WinJS Controls ............................................................................................................... 255
Syntax for data-win-options ........................................................................................ 259
WinJS Control Instantiation ......................................................................................... 261
Strict Processing and processAll Functions ................................................................... 262
Example: WinJS.UI.HtmlControl................................................................................... 263
Example: WinJS.UI.Rating (and Other Simple Controls) ................................................. 264
Example: WinJS.UI.Tooltip .......................................................................................... 265
Example: WinJS.UI.ItemContainer ............................................................................... 266
Working with Controls in Blend ....................................................................................... 269
Control Styling ............................................................................................................... 272
Styling Gallery: HTML Controls .................................................................................... 274
Styling Gallery: WinJS Controls .................................................................................... 276
Some Tips and Tricks .................................................................................................. 284
Custom Controls ............................................................................................................ 285
Implementing the Dispose Pattern .............................................................................. 288
Custom Control Examples ........................................................................................... 289
Custom Controls in Blend ............................................................................................ 293
What We’ve Just Learned ............................................................................................... 297
Chapter 6 Data Binding, Templates, and Collections .......................................................... 298
Data Binding .................................................................................................................. 299
Data Binding Basics..................................................................................................... 299
Data Binding in WinJS ................................................................................................. 301
Under the Covers: Binding mixins ................................................................................ 311
Programmatic Binding and WinJS.Binding.bind............................................................. 313
6
Binding Initializers ...................................................................................................... 315
Binding Templates.......................................................................................................... 319
Template Options, Properties, and Compilation ........................................................... 322
Collection Data Types ..................................................................................................... 324
Windows.Foundation.Collection Types ........................................................................ 325
WinJS Binding Lists ..................................................................................................... 331
What We’ve Just Learned ............................................................................................... 342
Chapter 7 Collection Controls ........................................................................................... 344
Collection Control Basics................................................................................................. 345
Quickstart #1: The WinJS Repeater Control with HTML controls .................................... 345
Quickstart #2: The FlipView Control Sample ................................................................. 349
Quickstart #3: The ListView Essentials Sample .............................................................. 351
Quickstart #4: The ListView Grouping Sample .............................................................. 353
ListView in the Grid App Project Template ................................................................... 357
The Semantic Zoom Control ............................................................................................ 361
How Templates Work with Collection Controls................................................................. 364
Referring to Templates ............................................................................................... 364
Template Functions (Part 1): The Basics ....................................................................... 365
Creating Templates from Data Sources in Blend ........................................................... 368
Repeater Features and Styling......................................................................................... 372
FlipView Features and Styling.......................................................................................... 377
Collection Control Data Sources ...................................................................................... 380
The Structure of Data Sources (Interfaces Aplenty!)...................................................... 381
A FlipView Using the Pictures Library ........................................................................... 384
Custom Data Sources and WinJS.UI.VirtualizedDataSource ........................................... 386
ListView Features and Styling .......................................................................................... 393
When Is ListView the Right Choice? ............................................................................. 393
Options, Selections, and Item Methods........................................................................ 395
7
Styling ....................................................................................................................... 399
Loading State Transitions ............................................................................................ 401
Drag and Drop ............................................................................................................ 402
Layouts ...................................................................................................................... 405
Template Functions (Part 2): Optimizing Item Rendering .................................................. 414
What We’ve Just Learned ............................................................................................... 419
Chapter 8 Layout and Views ............................................................................................. 421
Principles of Page Layout ................................................................................................ 423
Sizing, Scaling, and Views: The Many Faces of Your App.................................................... 426
Variable View Sizing and Orientations .......................................................................... 426
Screen Resolution, Pixel Density, and Scaling ............................................................... 437
Multiple Views ........................................................................................................... 442
Pannable Sections and Styles .......................................................................................... 446
Laying Out the Hub ..................................................................................................... 447
Laying Out the Sections .............................................................................................. 448
Panning Styles and Railing ........................................................................................... 449
Panning Snap Points and Limits ................................................................................... 451
Zooming Snap Points and Limits .................................................................................. 452
The Hub Control and Hub App Template.......................................................................... 453
Hub Control Styling..................................................................................................... 460
Using the CSS Grid .......................................................................................................... 461
Overflowing a Grid Cell ............................................................................................... 463
Centering Content Vertically ....................................................................................... 463
Scaling Font Size ......................................................................................................... 464
Item Layout ................................................................................................................... 465
CSS 2D and 3D Transforms .......................................................................................... 466
Flexbox ...................................................................................................................... 466
Nested and Inline Grids............................................................................................... 467
8
Fonts and Text Overflow ............................................................................................. 468
Multicolumn Elements and Regions ............................................................................. 470
What We’ve Just Learned ............................................................................................... 472
Chapter 9 Commanding UI ................................................................................................ 474
Where to Place Commands ............................................................................................. 475
The App Bar and Nav Bar ................................................................................................ 480
App Bar Basics and Standard Commands ..................................................................... 481
App Bar Styling ........................................................................................................... 490
Command Menus ....................................................................................................... 494
Custom App Bars ........................................................................................................ 495
Nav Bar Features ........................................................................................................ 497
Nav Bar Styling ........................................................................................................... 505
Flyouts and Menus ......................................................................................................... 507
WinJS.UI.Flyout Properties, Methods, and Events......................................................... 509
Flyout Examples ......................................................................................................... 510
Menus and Menu Commands ..................................................................................... 513
Message Dialogs ............................................................................................................ 518
Improving Error Handling in Here My Am! ....................................................................... 519
What We’ve Just Learned ............................................................................................... 525
Chapter 10 The Story of State, Part 1: App Data and Settings ............................................. 527
The Story of State........................................................................................................... 529
App Data Locations..................................................................................................... 532
App Data APIs (WinRT and WinJS) ................................................................................... 533
Settings Containers..................................................................................................... 534
State Versioning ......................................................................................................... 536
Folders, Files, and Streams.............................................................................................. 537
FileIO, PathIO, and WinJS Helpers (plus FileReader) ...................................................... 543
Encryption and Compression....................................................................................... 544
9
Q&A on Files, Streams, Buffers, and Blobs.................................................................... 544
Using App Data APIs for State Management..................................................................... 552
Transient Session State ............................................................................................... 552
Local and Temporary State.......................................................................................... 553
IndexedDB, SQLite, and Other Database Options .......................................................... 555
Roaming State ............................................................................................................ 556
Settings Pane and UI....................................................................................................... 559
Design Guidelines for Settings ..................................................................................... 561
Populating Commands ................................................................................................ 563
Implementing Commands: Links and Settings Flyouts ................................................... 566
Programmatically Invoking Settings Flyouts.................................................................. 568
Here My Am! Update ..................................................................................................... 570
What We’ve Just Learned ............................................................................................... 571
Chapter 11 The Story of State, Part 2: User Data, Files, and OneDrive ................................ 573
The Big Picture of User Data ........................................................................................... 574
Using the File Picker and Access Cache ............................................................................ 579
The File Picker UI ........................................................................................................ 580
The File Picker API ...................................................................................................... 585
Access Cache.............................................................................................................. 589
StorageFile Properties and Metadata .............................................................................. 592
Availability ................................................................................................................. 593
Thumbnails ................................................................................................................ 594
File Properties ............................................................................................................ 598
Media-Specific Properties ........................................................................................... 601
Folders and Folder Queries ............................................................................................. 607
KnownFolders and the StorageLibrary Object ............................................................... 609
Removable Storage .................................................................................................... 612
Simple Enumeration and Common Queries .................................................................. 613
10
Custom Queries.......................................................................................................... 618
Metadata Prefetching with Queries ............................................................................. 623
Creating Gallery Experiences........................................................................................... 625
File Activation and Association ........................................................................................ 627
What We’ve Just Learned ............................................................................................... 632
Chapter 12 Input and Sensors ........................................................................................... 634
Touch, Mouse, and Stylus Input ...................................................................................... 635
The Touch Language and Mouse/Keyboard Equivalents ................................................ 636
What Input Capabilities Are Present? .......................................................................... 643
Unified Pointer Events ................................................................................................ 645
Gesture Events ........................................................................................................... 649
The Gesture Recognizer .............................................................................................. 658
Keyboard Input and the Soft Keyboard ............................................................................ 659
Soft Keyboard Appearance and Configuration .............................................................. 660
Adjusting Layout for the Soft Keyboard ........................................................................ 663
Standard Keystrokes ................................................................................................... 666
Inking ............................................................................................................................ 667
Geolocation ................................................................................................................... 669
Geofencing ................................................................................................................ 673
Sensors.......................................................................................................................... 676
What We’ve Just Learned ............................................................................................... 680
Chapter 13 Media............................................................................................................. 681
Creating Media Elements ................................................................................................ 682
Graphics Elements: Img, Svg, and Canvas (and a Little CSS) ............................................... 684
Additional Characteristics of Graphics Elements ........................................................... 688
Some Tips and Tricks .................................................................................................. 689
Rendering PDFs .......................................................................................................... 694
Video Playback and Deferred Loading.............................................................................. 699
11
Disabling Screen Savers and the Lock Screen During Playback ....................................... 703
Video Element Extension APIs ..................................................................................... 703
Applying a Video Effect ............................................................................................... 705
Browsing Media Servers.............................................................................................. 706
Audio Playback and Mixing ............................................................................................. 706
Audio Element Extension APIs ..................................................................................... 708
Playback Manager and Background Audio .................................................................... 708
The Media Transport Control UI .................................................................................. 714
Playing Sequential Audio ............................................................................................. 717
Playlists ......................................................................................................................... 719
Text to Speech ............................................................................................................... 723
Loading and Manipulating Media .................................................................................... 725
Image Manipulation and Encoding............................................................................... 726
Manipulating Audio and Video .................................................................................... 732
Handling Custom Audio and Video Formats ................................................................. 735
Media Capture ............................................................................................................... 742
Flexible Capture with the MediaCapture Object ........................................................... 744
Selecting a Media Capture Device................................................................................ 748
Streaming Media and Play To .......................................................................................... 751
Streaming from a Server and Digital Rights Management.............................................. 751
Streaming from App to Network.................................................................................. 753
Play To ....................................................................................................................... 754
What We Have Learned .................................................................................................. 757
Chapter 14 Purposeful Animations.................................................................................... 759
Systemwide Enabling and Disabling of Animatio ns ........................................................... 761
The WinJS Animations Library ......................................................................................... 762
Animations in Action .................................................................................................. 765
CSS Animations and Transitions ...................................................................................... 769
12
Designing Animations in Blend for Visual Studio ........................................................... 775
The HTML Independent Animations Sample ................................................................. 777
Rolling Your Own: Tips and Tricks .................................................................................... 779
What We’ve Just Learned ............................................................................................... 785
Chapter 15 Contracts ........................................................................................................ 786
Share ............................................................................................................................. 788
Share Source Apps...................................................................................................... 793
Share Target Apps ...................................................................................................... 805
The Clipboard............................................................................................................. 816
Launching Apps with URI Scheme Associations ................................................................ 818
Search ........................................................................................................................... 823
The Search Charm UI .................................................................................................. 825
The WinJS.UI.SearchBox Control.................................................................................. 829
Providing Query Suggestions ....................................................................................... 831
Providing Result Suggestions ....................................................................................... 835
SearchBox Styling ....................................................................................................... 837
Indexing and Searching Content .................................................................................. 840
The Search Contract ................................................................................................... 849
Contacts ........................................................................................................................ 850
Contact Cards............................................................................................................. 850
Using the Contact Picker ............................................................................................. 856
Appointments ................................................................................................................ 860
What We’ve Just Learned ............................................................................................... 864
Chapter 16 Alive with Activity: Tiles, Notifications, the Lock Screen, and
Background Tasks.............................................................................................................. 865
Alive with Activity: A Visual Tour ..................................................................................... 866
The Four Sources of Updates and Notifications ................................................................ 875
Tiles, Secondary Tiles, and Badges ................................................................................... 878
13
Secondary Tiles .......................................................................................................... 880
Basic Tile Updates ...................................................................................................... 887
Cycling, Scheduled, and Expiring Updates .................................................................... 900
Badge Updates ........................................................................................................... 902
Periodic Updates ............................................................................................................ 904
Creating an Update Service ......................................................................................... 907
Debugging a Service Using the Localhost...................................................................... 911
Windows Azure and Azure Mobile Services .................................................................. 912
Toast Notifications ......................................................................................................... 917
Creating Basic Toasts .................................................................................................. 919
Butter and Jam: Options for Your Toast ....................................................................... 921
Tea Time: Scheduled Toasts and Alarms....................................................................... 923
Toast Events and Activation ........................................................................................ 926
Push Notifications and the Windows Push Notification Service ......................................... 927
Requesting and Caching a Channel URI (App) ............................................................... 929
Managing Channel URIs (Service) ................................................................................ 931
Sending Updates and Notifications (Service) ................................................................ 932
Raw Notifications (Service).......................................................................................... 933
Receiving Notifications (App) ...................................................................................... 934
Debugging Tips ........................................................................................................... 935
Tools and Providers for Push Notifications ................................................................... 935
Background Tasks and Lock Screen Apps.......................................................................... 937
Background Tasks in the Manifest ............................................................................... 938
Building and Registering Background Tasks .................................................................. 939
Conditions ................................................................................................................. 941
Tasks for Maintenance Triggers ................................................................................... 942
Tasks for System Triggers (Non-Lock Screen) ................................................................ 944
Lock Screen–Dependent Tasks and Triggers ................................................................. 945
14
Debugging Background Tasks ...................................................................................... 949
What We’ve Just Learned (Whew!) ................................................................................. 950
Chapter 17 Devices and Printing ....................................................................................... 952
Declaring Device Access.................................................................................................. 956
Enumerating and Watching Devices ................................................................................ 957
Scenario API Devices ...................................................................................................... 962
Image Scanners .......................................................................................................... 962
Barcode and Magnetic Stripe Readers (Point-of-Service Devices) .................................. 967
Smartcards................................................................................................................. 970
Fingerprint (Biometric) Readers................................................................................... 971
Bluetooth Call Control ................................................................................................ 972
Printing Made Easy......................................................................................................... 973
The Printing User Experience ...................................................................................... 974
Print Document Sources ............................................................................................. 977
Providing Print Content and Configuring Options.......................................................... 979
Protocol APIs: HID, USB, Bluetooth, and Wi-Fi Direct ........................................................ 981
Human Interface Devices (HID).................................................................................... 983
Custom USB Devices ................................................................................................... 990
Bluetooth (RFCOMM) ................................................................................................. 992
Bluetooth Smart (LE/GATT) ......................................................................................... 996
Wi-Fi Direct ................................................................................................................ 999
Near Field Communication and the Proximity API............................................................1000
Finding Your Peers (No Pressure!) ..............................................................................1002
Sending One-Shot Payloads: Tap to Share ...................................................................1007
What We’ve Just Learned ..............................................................................................1009
Chapter 18 WinRT Components: An Introduction .............................................................1010
Choosing a Mixed Language Approach (and Web Workers)..............................................1012
Quickstarts: Creating and Debugging Components ..........................................................1014
15
Quickstart #1: Creating a Component in C# .................................................................1015
Simultaneously Debugging Script and Managed/Native Code .......................................1020
Quickstart #2: Creating a Component in C++ ...............................................................1021
Comparing the Results ...............................................................................................1023
Key Concepts for WinRT Components.............................................................................1026
Implementing Asynchronous Methods .......................................................................1028
Projections into JavaScript .........................................................................................1042
Scenarios for WinRT Components ..................................................................................1044
Higher Performance (Perhaps) ...................................................................................1044
Access to Additional APIs ...........................................................................................1047
Obfuscating Code and Protecting Intellectual Property ................................................1051
Concurrency..............................................................................................................1052
Library Components ..................................................................................................1053
What We’ve Just Learned ..............................................................................................1056
Chapter 19 Apps for Everyone, Part 1: Accessibility and World-Readiness .........................1058
Accessibility ..................................................................................................................1059
Screen Readers and Aria Attributes ............................................................................1063
Handling Contrast Variations ......................................................................................1068
World Readiness and Localization ..................................................................................1075
Globalization .............................................................................................................1077
Preparing for Localization ..........................................................................................1087
Creating Localized Resources: The Multilingual App Toolkit ..........................................1101
Localization Wrap-Up ................................................................................................1108
What We’ve Just Learned ..............................................................................................1109
Chapter 20 Apps for Everyone, Part 2: The Windows Store .............................................1110
Your App, Your Business ................................................................................................1111
Planning: Can the App Be a Windows Store App? ........................................................1113
Planning for Monetization (or Not) .............................................................................1114
16
Growing Your Customer Base and Other Value Exchanges ...........................................1125
Measuring and Experimenting with Revenue Performance ..........................................1126
The Windows Store APIs ................................................................................................1127
The CurrentAppSimulator Object................................................................................1130
Trial Versions and App Purchase.................................................................................1133
Listing and Purchasing In-App Products.......................................................................1137
Handling Large Catalogs .............................................................................................1145
Receipts ....................................................................................................................1146
Instrumenting Your App for Telemetry and Analytics .......................................................1148
Releasing Your App to the World....................................................................................1155
Promotional Screenshots, Store Graphics, and Text Copy.............................................1156
Testing and Pre-Certification Tools .............................................................................1158
Creating the App Package ..........................................................................................1159
Onboarding and Working through Rejection ...............................................................1163
App Updates .................................................................................................................1166
Getting Known: Marketing, Discoverability, and the Web ................................................1168
Connecting Your Website and Web-Mapped Search Results ........................................1170
Face It: You’re Running a Business! ................................................................................1171
Look for Opportunities...............................................................................................1172
Invest in Your Business ..............................................................................................1172
Fear Not the Marketing .............................................................................................1172
Support Your Customers ............................................................................................1173
Plan for the Future ....................................................................................................1173
Selling Your App When It’s Not Running......................................................................1174
You’re Not Alone .......................................................................................................1175
Final Thoughts: Qualities of a Rock Star App ...................................................................1175
What We’ve Just Learned ..............................................................................................1176
Appendix A Demystifying Promises..................................................................................1178
17
What Is a Promise, Exactly? The Promise Relationships ...................................................1178
The Promise Construct (Core Relationship) .....................................................................1181
Example #1: An Empty Promise! .................................................................................1183
Example #2: An Empty Async Promise.........................................................................1185
Example #3: Retrieving Data from a URI ......................................................................1186
Benefits of Promises ......................................................................................................1187
The Full Promise Construct ............................................................................................1188
Nesting Promises.......................................................................................................1192
Chaining Promises .....................................................................................................1195
Promises in WinJS (Thank You, Microsoft!) .....................................................................1200
The WinJS.Promise Class ............................................................................................1201
Originating Errors with WinJS.Promise.WrapError .......................................................1203
Some Interesting Promise Code .....................................................................................1204
Delivering a Value in the Future: WinJS.Promise.timeout .............................................1204
Internals of WinJS.Promise.timeout ............................................................................1205
Parallel Requests to a List of URIs ...............................................................................1205
Parallel Promises with Sequential Results ...................................................................1206
Constructing a Sequential Promise Chain from an Array...............................................1208
PageControlNavigator._navigating (Page Control Rendering) .......................................1208
Bonus: Deconstructing the ListView Batching Renderer ...................................................1210
Appendix B WinJS Extras .................................................................................................1214
Exploring WinJS.Class Patterns .......................................................................................1214
WinJS.Class.define .....................................................................................................1214
WinJS.Class.derive .....................................................................................................1217
Mixins.......................................................................................................................1218
Obscure WinJS Features ................................................................................................1219
Wrappers for Common DOM Operations ....................................................................1219
WinJS.Utilities.data, convertToPixels, and Other Positional Methods ............................1221
18
WinJS.Utilities.empty, eventWithinElement, and getMember ......................................1222
WinJS.UI.scopedSelect and getItemsFromRanges ........................................................1222
Extended Splash Screens ...............................................................................................1223
Adjustments for View Sizes ........................................................................................1229
Custom Layouts for the ListView Control ........................................................................1231
Minimal Vertical Layout .............................................................................................1233
Minimal Horizontal Layout .........................................................................................1235
Two-Dimensional and Nonlinear Layouts ....................................................................1239
Virtualization ............................................................................................................1241
Grouping...................................................................................................................1243
The Other Stuff .........................................................................................................1244
Appendix C Additional Networking Topics........................................................................1249
XMLHttpRequest and WinJS.xhr .....................................................................................1249
Tips and Tricks for WinJS.xhr ......................................................................................1250
Breaking Up Large Files (Background Transfer API) ..........................................................1251
Multipart Uploads (Background Transfer API) .................................................................1252
Notes on Encryption, Decryption, Data Protection, and Certificates .................................1255
Syndication: RSS, AtomPub, and XML APIs in WinRT ........................................................1255
Reading RSS Feeds .....................................................................................................1256
Using AtomPub .........................................................................................................1259
Sockets .........................................................................................................................1260
Datagram Sockets......................................................................................................1261
Stream Sockets..........................................................................................................1265
Web Sockets: MessageWebSocket and StreamWebSocket...........................................1268
The ControlChannelTrigger Background Task ..............................................................1273
The Credential Picker UI ................................................................................................1273
Other Networking SDK Samples .....................................................................................1277
Appendix D Provider-Side Contracts ................................................................................1279
19
File Picker Providers ......................................................................................................1279
Manifest Declarations................................................................................................1280
Activation of a File Picker Provider..............................................................................1281
Cached File Updater ......................................................................................................1288
Updating a Local File: UI.............................................................................................1291
Updating a Remote File: UI ........................................................................................1292
Update Events ...........................................................................................................1294
Contact Cards Action Providers ......................................................................................1297
Contact Picker Providers ................................................................................................1300
Appointment Providers..................................................................................................1303
About the Author .............................................................................................................1309
20
Introduction
Welcome, my friends, to Windows 8.1! On behalf of the thousands of designers, program managers,
developers, test engineers, and writers who have brought the product to life, I'm del ighted to welcome
you into a world of Windows Reimagined.
This theme is no mere sentimental marketing ploy, intended to bestow an aura of newness to
something that is essentially unchanged, like those household products that make a big splash on the
idea of "New and Improved Packaging!" No, starting with version 8, Microsoft Windows truly has been
reborn—after more than a quarter-century, something genuinely new has emerged.
I suspect—indeed expect—that you're already somewhat familiar with the reimagined user
experience of Windows 8 and Windows 8.1. You're probably reading this book, in fact, because you
know that the ability of Windows to reach across desktop, laptop, and tablet devices, along with the
global reach of the Windows Store, will provide you with many business opportunities, whether you're
in business, as I like to say, for fame, fortune, fun, or philanthropy.
We'll certainly see many facets of this new user experience throughout the course of this book. Our
primary focus, however, will be on the reimagined developer experience.
I don't say this lightly. When I first began giving presentations within Microsoft about building
Windows Store apps, I liked to show a slide of what the world was like in the year 1985. It was the time
of Ronald Reagan, Margaret Thatcher, and Cold War tensions. It was the time of VCRs and the
discovery of AIDS. It was when Back to the Future was first released, Michael Jackson topped the charts
with Thriller, and Steve Jobs was kicked out of Apple. And it was when software developers got their
first taste of the original Windows API and the programming model for desktop applications.
The longevity of that programming model has been impressive. It's been in place for nearly three
decades now and has grown to become the heart of the largest business ecosystem on the planet. The
API itself, known today as Win32, has also grown to become the largest on the planet! What started
out on the order of about 300 callable methods has expanded three orders of magnitude, well beyond
the point that any one individual could even hope to understand a fraction of it. I'd certainly given up
such futile efforts myself.
So when I bumped into my old friend Kyle Marsh in the fall of 2009, just after Windows 7 had been
released, and heard from him that Microsoft was planning to reinvigorate native app development for
Windows 8, my ears were keen to listen. In the months that followed I learned that Microsoft was
introducing a completely new API called the Windows Runtime (or WinRT). This wasn't mea nt to
replace Win32, mind you; desktop applications would still be supported. No, this was a programming
model built from the ground up for a new breed of touch-centric, immersive apps that could compete
with those emerging on various mobile platforms. It would be designed from the app developer's point
of view, rather than the system's, so that key features would take only a few lines of code to implement
21
rather than hundreds or thousands. It would also enable direct native app development in multiple
programming languages. This meant that new operating system capabilities would surface to those
developers without having to wait for an update to some intermediate framework. It also meant that
developers who had experience in any one of those language choices would find a natural home when
writing apps for Windows 8 and Windows 8.1.
This was very exciting news to me because the last time that Microsoft did anything significant to
the Windows programming model was in the early 1990s with a technology called the Component
Object Model (COM), which is exactly what allowed the Win32 API to explode as it did. Ironically, it was
my role at that time to introduce COM to the developer community, which I did through two editions
of Inside OLE (Microsoft Press, 1993 and 1995) and seemingly endless travel to speak at conferences
and visit partner companies. History, indeed, does tend to repeat itself, for here I am again, with
another second edition!
In December 2010, I was part of the small team who set out to write the very first Windows Store
apps using what parts of the new WinRT API had become available. Notepad was the text editor of
choice, we built and ran apps on the command line by using abstruse Powershell scripts that required
us to manually type out ungodly hash strings, we had no documentation other than oft-incomplete
functional specifications, and we basically had no debugger to speak of other than the tried and true
window.alert and document.writeln. Indeed, we generally worked out as much HTML, CSS, and
JavaScript as we could inside a browser with F12 debugging tools, adding WinRT-specific code only at
the end because browsers couldn't resolve those APIs. You can imagine how we celebrated when we
got anything to work at all!
Fortunately, it wasn't long before tools like Visual Studio Express and Blend for Visual Studio became
available. By the spring of 2011, when I was giving many training sessions to people inside Microsoft on
building apps for Windows 8, the process was becoming far more enjoyable and exc eedingly more
productive. Indeed, while it took us four to six weeks in late 2010 to get even Hello World to show up
on the screen, by the fall of 2011 we were working with partner companies who pulled together
complete Store-ready apps in roughly the same amount of time.
As we've seen—thankfully fulfilling our expectations—it's possible to build a great app in a matter
of weeks. I'm hoping that this ebook, along with the extensive resources on http://dev.windows.com,
will help you to accomplish exactly that and to reimagine your own designs.
Work on this second edition began almost as soon as the first edition was released. (I’d make a quip
about the ink not being dry, but that analogy doesn’t work for an ebook!) When Windows 8 became
generally available in the fall of 2012, work on Windows 8.1 was already well underway: the
engineering team had a long list of improvements they wanted to make along with features that they
weren’t able to complete for Windows 8. And in the very short span of one year, Windows 8.1 was itself
ready to ship.
At first I thought writing this second edition would be primarily a matter of making small updates to
each chapter and perhaps adding some pages here and there on a handful of new features. But as I got
deeper into the updated platform, I was amazed at just how much the API surface area had expanded!
22
Windows 8.1 introduces a number of additional controls, an HTML webview element, a stronger HTTP
API, content indexing, deeper OneDrive support, better media capabilities, more tiles sizes (small and
large), more flexible secondary tile, access to many kinds of peripheral devices, and more options for
working with the Windows Store, like consumable in-app purchases. And clearly, this is a very short list
of distinct Windows 8.1 features that doesn’t include the many smaller changes to the API. (A fuller list
can be found on Windows 8.1: New APIs and features for developers).
Furthermore, even as I was wrapping up the first edition of this book, I already had a long list of
topics I wanted to explore in more depth. I wrote a number of those pieces for my blog, with the
intention of including them in this second edition. A prime example is Appendix A, “Demystifying
Promises.”
All in all, then, what was already a very comprehensive book in the first edition has become even
more so in the second! Fortunately, with this being an ebook, neither you nor I need feel guilty about
matters of deforestation. We can simply enjoy the process of learning about and writing Windows
Store Apps with HTML, CSS, and JavaScript.
And what about Windows Phone 8.1? I’m glad you asked, because much of this book is completely
applicable to that platform. Yes, that’s right: Windows Phone 8.1 supports writing apps in HTML, CSS,
and JavaScript, just like Windows 8.1, meaning that you have the same flexibility of implementation
languages on both. However, the decision to support JavaScript apps on Windows Phone 8.1 came very
late in the production of this book, so I’m only able to make a few notes here and there for Phone -
specific concerns. I encourage you to follow the Building Apps for Windows blog, where we’ll be
posting more about the increasingly unified experience of Windows and Windows Phone.
This book is about writing Windows Store apps using HTML, CSS, and JavaScript. Our primary focus will
be on applying these web technologies within the Windows platform, where there are unique
considerations, and not on exploring the details of those web technologies themselves. For the most
part, I'm assuming that you're already at least somewhat conversant with these standards. We will cover
some of the more salient areas like the CSS grid, which is central to app layout, but otherwise I trust
that you're capable of finding appropriate references for most everything else. For Java Script
specifically, I can recommend Rey Bango’s Required JavaScript Reading list, though I hope you’ll spend
more time reading this book than others!
I'm also assuming that your interest in Windows has at least two basic motivations. One, you
probably want to come up to speed as quickly as you can, perhaps to carve out a foothold in the
Windows Store sooner rather than later. Toward that end, Chapter 2, “Quickstart,” gives you an
immediate experience with the tools, APIs, and some core aspects of app development and the
platform. On the other hand, you probably also want to make the best app you can, one that performs
really well and that takes advantage of the full extent of the platform. Toward this end, I've also
23
endeavored to make this book comprehensive, helping you at least be aware of what's possible and
where optimizations can be made.
Let me make it clear, though, that my focus in this book is the Windows pla tform. I won’t talk much
about third-party libraries, architectural considerations for app design, and development strategies and
best practices. Some of these will come up from time to time, but mostly in passing.
Nevertheless, many insights have come from working directly with real-world developers on their
real-world apps. As part of the Windows Ecosystem team, myself and my teammates have been on the
front lines bringing those first apps to the Windows Store. This has involved writing bits of code for
those apps and investigating bugs, along with conducting design, code, and performance reviews with
members of the Windows engineering team. As such, one of my goals with this book is to make that
deep understanding available to many more developers, including you!
To work through this book, you should have Windows 8.1 (or a later update) installed on your
development machine, along with the Windows SDK and tools. All the tools, along with a number of
other resources, are listed on Developer Downloads for Windows Store Apps. You’ll specifically need
Microsoft Visual Studio Express 2013 for Windows. (Note that for all the screenshots in this book, I
switched Visual Studio from its default “dark” color theme to the “light” theme, as the latter works
better against a white page.)
We’ll also acquire other tools along the way as we need them in this ebook, specifically to run some
of the examples in the companion content. Here’s the short list:
Bing Maps SDK for Windows Store Apps (for Chapters 10 and beyond)
Also be sure to visit the Windows 8.1 Samples Pack page and download at least the JavaScript
samples. We'll be drawing from many—if not most—of these samples in the chapters ahead, pulling in
bits of their source code to illustrate how many different tasks are accomplished.
One of my secondary goals in this book, in fact, is to help you understand where and when to use
the tremendous resources in what is clearly the best set of samples I’ve ever seen for any release of
Windows. You’ll often be able to find a piece of code in one of the samples that does exactly what you
need in your app or that is easily modified to suit your purpose. For this reason I’ve made it a point to
personally look through every one of the JavaScript samples, understand what they demonstrate, and
then refer to them in their proper context. This, I hope, will save you the trouble of having to do that
level of research yourself and thus make you more productive in your development efforts.
24
In some cases I’ve taken one of the SDK samples and made certain modifications, typically to
demonstrate an additional feature but sometimes to fix certain bugs or demonstrate a better
understanding that came about after the sample had to be finalized. I’ve included these modifications
in the companion content for this book, which you can download at
http://aka.ms/BrockschmidtBook2/CompContent
The companion content also contains a few additional examples of my own, which I always refer to
as “examples” to make it clear that they aren’t official SDK content. (I’ve also rebranded the modified
samples to make it clear that they’re part of this book.) I’ve written these examples to fill gaps that the
SDK samples don’t address or to provide a simpler demonstration of a feature that a related sample
shows in a more complex manner. You’ll also find many revisions of an app called “Here My Am!” that
we’ll start building in Chapter 2 and we’ll refine throughout the course of this book. This includes
localizing it into a number of different languages by the time we reach the end.
There are also a number of videos that I’ve made for this book, which more readily show dynamic
effects like animations and user interaction. You can find all of them at
http://aka.ms/BrockschmidtBook2/Videos
Beyond all this, you’ll find that the Windows Store app samples gallery as well as the Visual Studio
sample gallery let you search and browse projects that have been contributed by other developers —
perhaps also you! (On the Visual Studio site, by the way, be sure to filter on Windows Store apps
because the gallery covers all Microsoft platforms.) And of course, there will be many more developers
who share projects on their own.
In this book I occasionally refer to posts on a number of blogs. First are a few older blogs, namely
the Windows 8 App Developer blog, the Windows Store for Developers blog, and—for the Windows 8
backstory of how Microsoft approached this whole process of reimagining the operating system —the
Building Windows 8 blog. As of the release of this book, the two developer blogs have merged into the
Building Apps for Windows blog that I mentioned earlier.
A Formatting Note
Throughout this book, identifiers that appear in code, such as variable names, property names, and API
functions and namespaces, are formatted with a color and a fixed-point font. Here’s an example:
Windows.Storage.ApplicationData.current . At times, certain fully qualified names—those that that
include the entire namespace—can become quite long, so it’s necessary to occasionally hyphenate
them across line breaks, as in Windows.Security.Cryptography.CryptographicBuffer.-
convertStringToBinary. Generally speaking, I’ve tried to hyphenate after a dot or between whole
words but not within a word. In any case, these hyphens are never part of the identifier except in CSS
where hyphens are allowed (as in -ms-high-contrast-adjust) and with HTML attributes like aria-
label or data-win-options.
25
Another Random Scribd Document
with Unrelated Content
he was elected to the office of sheriff of Floyd County, which position
he held at the outbreak of the war, when all civil law became of no
effect.- He entered the Fifth Kentucky Infantry, in which he served
one year, when, his term having expired, he entered the Tenth
Kentucky Cavalry. He served in West Virginia, East Tennessee and
East Ken
EVERETT TOWNSHIP. 705 tucky. When at Cynthiana,
Kentucky, while charging the Eleventh Michigan at the head of a
squad, he received a sabre stroke and was disabled and taken
prisoner. He was confined at Johnson's Island and retained until the
close of the war. He was the first lieutenant in his company when
captured, and had received several wounds of minor importance. At
the close of the war he engaged in the lumber business, and was
two years deputy sheriff in his native county. Coming to Missouri in
1868, he settled in Everett Township, Cass County, on section 19,
where he now lives, owning a farm of lOO acres. His parents
followed him to Missouri in 1869, and his father died here February
23, 1878. Mr. Cecil was married April 3, 1872, to Miss Mary J. Frost,
daughter of Richard Frost. She died in the spring of 1879. Four
children were born to them, only two of whom are now living: Frank
M. and Charles H. One, William R., died in 1879, only a month
before his mother, and the youngest, Mary Llewellyn, in the following
August. WILSON DAVENPORT is one' of the original members of the
Old Settlers' Society and is among the most enterprising farmers in
this part of Cass County. He was born in Washington County,
Virginia, July 14, 1824. His parents were Julius T and Mary (Dolan)
Davenport, both native Virginians. When he was about six years old
the family settled in Ray County, Tennessee, where they remained
until 1833, going to Indiana at that time. They came to Missouri in
1834 ^"d located in Johnson County near Rose Hill, where Wilson's
father died October 30, 1842. His wife had died just before, on
October 19, and one daughter October 14, making three deaths in
the family in a short time. Mr. Davenport was married March 11,
1847, to Miss Elizabeth Nolan, who died March 19, 1852. November
23, 1856, he married Miss Amanda M. Johnson, daughter of John S.
Johnson, of Freeman. There were two children in the first family,
Sarah Ann, wife of Thomas A. Bryant, living at Chatauqua Springs,
Kansas, and MarySusannah, wife of Marshall P. Clapp, living at the
same place. There are five children by the latter union : James B.,
who married Margaret J. Davidson ; Jeremiah, Martha Lee, John T.
and Jefiferson. In 1843 Mr. Davidson settled in Dolan Township and
in 1857 moved into Everett, and now has a farm of 520 acres, and
also one of 160 acres in Kansas. He enlisted in 1862 in General
Shelby's command, and while at Fort Smith was left by the company
on account of sickness, and when the Federals went down to that
part of the country he surrendered. They would not accept him as a
prisoner and he worked for the quartermaster at Fort Smith,
remaining there until the close of the war. He returned to Cass
tounty in 1866, but his house having been destroyed, he did not
begin his farming operations until 1868. Himself and wife are
members of the Baptist Church. 45
706 BIOGRAPHICAL. JOHN S. DAVIS is a native of Missouri,
and was born in Saline County, July ig, 1842. He is the second of
eight children, seven of whom are now living. His parents James R.
and Charlotte G. (Steele) Davis, were originally from Augusta
County, Virginia. They came to Missouri in 1836, but retured to
Virginia, where they remained a few years, and subsequently came
back to Missouri and settled in Marshall, Saline County. There Mr.
Davis is serving the people in the capacity of county judge, having
been repeatedly elected to that office. While young John S. received"
but a limited education, only such as the country schools of Missouri
of thirty years ago could offer. His life was spent on a farm until the
breaking out of the war, when, in 1861, he entered in Parson's
Division, under Captain Chariton. He was in the engagements at
Wilson Creek, Lexington, Dry Wood and Pea Ridge, at which place
he was captured and confined for three months in McDowell's
College, at St. Louis. Then he was taken to the old penitentiary at
Alton, where he was kept one month, soon making his escape from
that institution by digging under the wall. Two other men. Colonel
McGufifin and his son, escaped from the building at the same time,
but the young man managed to be retaken by allowing himself to be
seen by the guard. He and Colonel McGuffin kept company until near
Quincy, when they separated. He worked his way through Missouri,
and secured a situation with a freighting train from Nebraska City
and Atchison to Denver and Virginia City, where he continued until
1864. In 1864 he went to Illinois to purchase cattle for his
employers, and while returning through Missouri was taken prisoner
at Roanoke, Randolph County, under suspicion of being a spy, and
was detained two weeks there and at Huntsville, but on the strength
of letters received from General Batchelor, of Atchison, he was
released and received $150 damages for his detention. In the fall of
1864 he was given a situation as conductor on the Missouri Pacific
Railroad, and remained on the road for eighteen months, when he
embarked in the insurance business in Pettis and Henry Counties. In
1867 he settled down to farming in Saline County. Mr. Davis was
married August 3> 1867, in Saline County to Miss Laura Bewby, of
Polk County, daughter of Mrs. Melinda Bewby, now of Coldwater
Township. They have four children : Ora, Alonzo, Sarah and Lou. In
1869 he settled in Cherokee County, Kansas, but in two years came
to Cass County. In 1876 he purchased his present property,
consisting of 160 acres, and is engaged in handling hogs, cattle and
mules. Mr. Davis and wife are members or the M. E. Church, South.
In politics he is Democratic. DORSETT & PARISH, dealers in general
merchandise, groceries, drugs, etc., Everett, Missouri. The firm is
composed of L. T. Dorsett and L. T. Parish. The former
EVERETT TOWNSHIP. 707 was born in Putnam Count)',
Indiana, March 25, 1854. His parents were Tames and Lydia (Bray)
Dorsett, and he is the tenth child and the seventh son in the family.
Young Dorsett received quite a liberal education, having had the
advantage of good country schools. When sixteen years old he came
to Missouri with the family, and attended the state university at
Columbia, but owing to failing health abandoned his idea of
completing an education at that institution. On his return he began
to teach at Everett, and in 1877, attended Spalding's Commercial
College, at Kansas City. He then continued to teach until the spring
of 1880, having spent thirty-two months in the school room in the
capacity of instructor. Mr. Dorsett was married March 25, 1880, to
Jennie A. Liggett, daughter of Anderson D. Liggett, a resident of
Dolan Township. In August, 1879, in partnership with C. C. Cable, he
engaged in the mercantile business at Everett, but he did not enter
the store himself until the following spring, having been occupied in
teaching the Everett School. At the end of one year the firm was
changed by Mr. Cable withdrawing and Mr. Parish taking his place.
Mr. L. T. Parish was born in Morgan County, Indiana, February 7,
1857, and is the son of Larkin and Hannah (Dorsett) Parish, the
latter a sister of James Dorsett, the father of L. T. He came to Cass
County in i860, when three years old, and has lived in the county
ever since. Mr. Parish had only such facilities for acquiring an
education as those afforded by the common schools. He was
married May 26, 1878, to Miss Almeda Dean, daughter of Lewis
Dean, of Rich Hill, Bates County. They have two children : Murat and
Ona. On the I2th of August, 1880, he entered into the present firm.
On the night of March, 22, 1882, they met with quite a loss, the
store building and the entire contents being burned, at a loss of
$3,500 ; but with a commendable energy, they opened out in
business again on the ist of May, and are enjoying a satisfactory
patronage. JAMES DORSETT was born on the i8th of May, 1824, on
Rocky River, in Chatham County, North Carolina, afid is the eldest of
the family of eleven children. His parents were Duty and Rachel
(Edwards) Dorsett, both of whom were natives of North Carolina.
This family are of English descent, and are from Dorsettshire,
England. The Dorsett and Edwards families were quite active in the
affairs of North Carolina during the Revolutionary War, and in the
war of 1812. Mr. Dorsett's father was drafted to serve under Col. R.
C. Cotton, but did not engage in active duty. When James was in his
twenty-second year, he moved to Indiana, locating near Marshall, in
Morgan County, where he commenced to work by the month. This
he continued for ten months, at $8.75 per month, after which he
began to teach school, although having received only a limited
7o8 BIOGRAPHICAL. -education up to this time. His first
session was taught in 1837, in a neighborhood where there had
been no school, his compensation being $10 per month. He followed
teaching until his marriage, which took place March 14, 1839, to
Miss Lydia Bray, also from North Carolina. He then leased a tract of
120 acres for three years, and subsequently purchased a part of the
same, where he lived until September 5, 1870. His land was
originally in Morgan County, but in 1856 it was attached to Putnam
County. In 1870 Mr. Dorsett came to Missouri and purchased a farm
of 280 acres in Everett Township, and has since added to the original
tract, until he now has 500 acres. His wife died while living in
Indiana, December 8, 1864, leaving a family of fourteen children, of
whom seven are now living: Susannah M., in Indiana; Jeremiah H.,
married Mary D. Duncan ; Henry B., married Lenna Dudley; LarkinT.,
married Jennie Liggett ; Nancy Ann, married William T. Stevens ;
Sarah Ruth, married William W. Morton, and Mary Catherine, married
0.0. Barrett. Mr. Dorsett was married the second time on the i6th of
August, 1865, to Mrs. Matilda Steen, a native of Kentucky. Mrs.
Dorsett's ^maiden name was Matilda Burton, and she is the sister of
the late Allen A. Burton, of Forest, Illinois, the minister to Bogota
under President Lincoln. Mrs. Dorsett was first married to Elijah M.
Steen, December 3, 1845, and soon after came to Missouri, and
settled in Everett. At the outbreak of the war Mr. Steen entered
Price's army, and while at home was captured by Col. Coleman's
men, and on the 7th of April, 1863, was shot. His widow continued
to live in Everett until she had been burned out three times, and
then went to Harrisonville, where she resided some time,
subsequently returning to Indiana and Kentucky. She had three
children by her first husband : William, Mary and Amanda. There are
three girls by her last marriage : Laura A., Alpha Belle, and Viola,
and one boy, Oliver H., who died October 6, 1870. In his political
opinions Mr. Dorsett has espoused the cause of the Greenback party,
although bis early training was in the ranks of the Whigs, and he
there embraced Knownothingism, but becoming disgusted with their
doctrines he became a Democrat, and finally a Greenbacker. He once
joined the Baptist denomination, but has since become disconnected
with the church, and is not now a member of any religious society.
Mr. D. possesses the good will and respect of his neighbors, and has
served as a justice of the peace for several years. REV. JOHN
WESLEY FOSTER was born in Henderson County, Indiana, March i,
1835. His parents were Joshua and Sallie (Smith) Foster, both
natives of Tennessee. They were among the first settlers of Indiana,
having located in that state in 18 18. John is the sixth child in the
family of eleven, of whom
EVERETT TOWNSHIP. 709nine are still living. His education
was acquired in the common school, and by close observation and
hard work. In 1857, February 28, he was married to a Miss Bromley,
a native of Indiana. Mr. Foster's parents settled at St. Joseph,
Missouri, about 1840, where they both have since died. In 1859, he
moved to St. Joseph, and soon after settled in Nebraska. He is a
minister in the Methodist Church and began his ministerial duties at
St. Joseph, Missouri, having been ordained there in i860. Since then
he has been engaged in preaching. He has filled several positions in
Nebraska, and in the fall of 1875, came to this part of Missouri,
locating in Austin Township. In 1878, he bought his present home of
J. S. Parish, where he has 160 acres in a fair state of cultivation,
with good improvements. Mr. and Mrs. F. have a family of five
children: Mary (wife of J, Parish), Eddie Lee, John Embrey, Harry C,
James Findley. WILLIAM F. GARRETT was born November 6, 1828, in
Harrison County, Kentucky. His father, Isaac Garrett, was a native of
Shelby County, Kentucky, and his mother,. Elizabeth (Bell) Garrett,
was a Virginian by birth. William F. was the eldest in a family of eight
children, three boys and five girls. The latter are all living in this
state ; the brothers are both in Keithburg, Mercer County, Illinois. At
the age of seven years young Garrett was taken from Kentucky to
Illinois, the family living for two years in Cole County, and going to
DesMoines County, Iowa, in 1837. Here Mr. Garrett grew to
manhood, having received such an education as could be afforded
by the country schools. At the age of twenty-six, April 19, 1854, he
was married to Miss Elizabeth A. Wilkerson, a native of Delaware. He
was engaged in farming and milling in Iowa untiE 1871, when he
came to Jackson County, Missouri, but remained only one year, going
thence to Ralls County, in East Missouri. This was his home until
1878. In that year he moved to Cass County, living one year at
Freeman and settling at his present home, on South Fork, in1879.
He is now engaged in running a saw mill in connection with his farm.
Mr. Garrett is taking a,n active interest in horse flesh and
isendeavoring to improve the standard of driving horses in his
township. He is quite a popular man in this part of the county, and is
now serving his term as a township justice, having been elected in
the spring of 188 [, In politics he is a 'Greenbacker and maintains
the principles of that party. He has had seven children, of whom six
are now living — three girls and three boys: Medora, married
January 20, 1877, to Albert Biggers and living in Ralls County; Ellen,
married March 17, 1878, to Henry Leak, now living with her father
and having one child, a boy — Willie— born February 23, 1879;
John, George, Clara and Thomas. Mr. Garrett lost one boy, Charlie,
who died December 20, 1880, from the eliects of injuries received
while working with a saw log.
7IO BIOGRAPHICAL. FRANCIS M. GEORGE is the only son
of Carroll and Sarah H. (McFarland) George, and was born in Cooper
County, Missouri, June 9, 1832. His father's family are from
Tennessee and his mother's from Haywood County, North Carolina.
James McFarland, his maternal grandfather, came to Missouri in an
early day and settled in St. Francis County and was the
representative from that county in the early state legislatures. When
Francis was about nine years old his parents moved to Morgan
County where the father died in 1844. He grew up on a farm,
receiving only a fair education. He was married in Morgan County,
September 4, 1855, to Miss Martha Williams, a native of Kentucky,
and a daughter of Josiah Williams who died in 1882, in Morgan
County. In March, 1864, he went to Otoe County, Nebraska, where
he lived two years, coming thence to Cass County in 1866, and, in
partnership with James Masters, a brotherin-law, purchased a tract
of 330 acres where he is now living. He has since added to his
original farm and at present owns 160 acres of fine land, five miles
south of Freeman. In connection with his farming operations he is
handling a number of cattle and hogs, having about one hundred
head of each. Mr. George has five children : Thomas H., Dora,
Josiah, William, John, and he is also raising a little girl, Mary
Browning. Mr. George is a member of the Cumberland Presbyterian
Church, while his wife is connected with the M. E. Church, South.
LORENZO D. HENRY, is the third in a family of eight children, four
boys and four girls, all of whom are living : Joel, Azer, Martha, (wife
of William Main), and Esther, (wife of Dr. Crisman), in Cass County ;
Enoch, in Ohio, and Catharine Pierce, in Kansas. His parents, Hartt F.
and Clarinda (Marsh) Henry, were natives of Kentucky, and of Irish
extraction. Lorenzo D. Henry was married September 13, 1857, in
Delaware County, Ohio, to Miss Mary Slawson, a native of New York.
They have six children : Nora, (wife of Joshua Greenbaugh), in Rush
County, Kansas ; Olive, (wife of Adolph Eldridge), in Norris County,
Kansas ; Nettie, Katie, Frankie, and Lafayette. In 1858, Mr. Henry
moved to Grundy County, Illinois, where he lived four years, going
thence to McDonough County, in 1862. In 1864 he enlisted in the
Fourteenth Illinois Cavalry, and served under General Thomas at
Nashville and Franklin, the only regular engagements in which he
took part. He was discharged in the fall of 1865, at Nashville,
Tennessee. In 1866 he came to Missouri, and lived a short time in
St. Clair County, locating in Cass County in the spring of 1867, when
he bought 120 acres, where he now lives. For this he payed ten
dollars per acre. He has since added to his original purchase until he
now has 315 acres. Mr. Henry is taking quite an interest
EVERETT TOWNSHIP. 711 ill horses, and is improving to a
good advantage the stock of his neighborliood. He has a fine male
animal from the Rexrode stock of imported Normans, and also owns
a promising three-year-old colt, Woodford Knox, Jr., whose mother
had a record of 2:40, from Old Denmark, the famous Kentucky pacer
; the sire of this colt is Woodford Knox, who has a record of 2:22,
made at Columbus, Ohio, in 188 1. His sire is General Knox, of
Kentucky, the sire of more fast horses that any other horse in
America. This colt promises to become one of the fastest animals of
the West. Mr. Henry also has a yearling, Young Cloud, his mother
being Arabian and Blackhawk, and whose time in June, 1882, 2:30
at Newton, Iowa His sire is Flying Cloud with a record of 2:19,
owned by John Potter, of Appleton City, Missouri. This colt will
probably make his mark on the Western turf. SAMUEL E. LICKLIDER
is a native Missourian, having been born in St. Louis County
February 15, 1835, and is of German, Irish and Scotch origin. His
father, Solomon L., was born in Virginia, and his father, Conrad, in
Pennsylvania, where his parents had settled, coming from Germany.
Samuel's mother, whose maiden name was Angeline Edmondson,
embraced the Scotch and Irish blood, but was born in Maryland.
They were married in 1830, in Missouri, having come to this state in
1828. Solomon Licklider was a harnessmaker by trade, and worked
for several years in St. Louis. In 1840 he moved to Gasconade
County, settling on what is termed "Jake's Prairie," and there he now
resides. He moved to Cooper County about 1850, where his wife
died in 1853. The following year he was married in Gasconade to
Miss Elizabeth Hawkins, who died in 1880, and in 1881 he was
married the third time to a Mrs. Hawkins. The subject of this sketch
is the fourth child of eight children in his father's first family. He
received a limited education in the common schools of the country,
and when of age entered an apprenticeship in St. Louis to learn the
blacksmith trade. There he continued for three years and then began
work for himself, following his trade until 1868, or until coming to
Cass County, when he began farming operations. This he has since
continued in connection with his trade. He secured a tract of 120
acres on the raw prairie, two miles west of Everett, and commenced
his improvements and has now a finely improved farm. He has just
completed a large barn, which stands on a prominent elevation and
is a landmark for all that section, being visible for many miles in
every direction. This is the largest and best barn in Cass County,
being sixty feet in length by forty in width, with a finely arranged
basement. It is specially arranged for the use of a stock feeder, of
which Mr. Licklider IS the inventor. This consists of an arrangement
by which cattle and
712 BIOGRAPHICAL. Stock of all kinds can be fed hay in
quantity without waste, and whereever used is proving its value by a
saving of feed. Its worth is bein? recognized by many of the best
stock feeders of Missouri and other states, and it is fast obtaining
the sale that its merits demand for it. It is proving of almost
incalculable value. It was patented August 31 1880. Mr. L. was
married July 30, 1857, to Miss Sarah E. Clymer, daughter of James
Clymer, of Bates County. They have nine chidren : Dora Z. (wife of B.
Bumgardner, of Kansas City), Christine Otto, George Edmon, James
Lewis, Mary Jane, Joseph (died October 28, 1871), Fannie E.,
Charles L. and Wesley W., who died September 20, 1881. He is
connected with the Masonic order, being W. M. in Everett Lodge, No.
219, and also D. D. G. M. for Cass County. In politics he is
Democratic and is chairman of the executive committee for the
county. During the war he worked for the government at RoUa in the
capacity of blacksmith. ELDRIDGE W. LONGWELL was born in
Delaware County, Ohio, January 21, 1853, ^"d 's the eldest son of
James and Sarah J. Longwell, nee Potter. The former was also born
in Delaware County, July 18, 1827, and is the eldest of three
brothers, sons of Ezekiel and Esther Longwell, who settled in
Delaware County in 1806. His early life was spent on a farm, and
when he was twenty-three years old, he married Miss Sarah J.
Potter, a native of Ohio. He resided in Delaware County until 1870,
when he came to Missouri, settling on section 33 of Everett
Township, where he has a tract of 400 acres. Here he is raising
cattle and sheep. Mrs. Longwell died in Ohio, August 3, 1868,
leaving two sons, Eldridge and Elmore. Eldridge was reared on his
father's farm in Ohio until coming to Missouri at the age of
seventeen years. He assisted in improving the farm, and managed to
acquire a fair education by attending the common schools for two
years, after which he began to teach school. He attended Spalding's
Commercial College, at Kansas City, for some time, but on account of
sickness did not complete the course of study. On his return he
again entered the school room, and has since been engaged in
working on the farm and teaching school. Mr. Longwell was married
on the 3d of September, 1874, to Miss E. Hamilton, a native of
Wheeling, West Virginia, but who was reared in Delaware County,.
Ohio. They have three children: Charles A., Carrie E. and Edith. Mr.
Longwell has a farm of no acres, two and a-half miles southwest of
Everett. At the township election held in April, i88i,he was chosen
justice of the peace, and has since held the position. He has been a
member of the Masonic order since 1874, and is held in high respect
by his brother Masons. Mr. and Mrs. Longwell were reared in
Presbyterian families, but they are both now members of the Baptist
Church.
EVERETT TOWNSHIP. 713 BRICE McCOY was born October
28, 1834, in Bedford County, Pennsylvania, and is the seventh of a
family of eleven children. His parents, George and Catherine (Edder)
McCoy, were natives of the same state. He has one brother, John A.
McCoy, living in Cass County. Brice's education is such as he has
acquired by a careful observation and the advantages of three or
four months of each year in attending the common schools, and a
few months at DesMoines, Iowa, in '56 and '57, and one session at
the Iowa Wesleyan University, Mt. Pleasant, Iowa. He had moved to
Iowa in 1856 when twenty-two years old, and until his marriage was
in Iowa, Nebraska and Pennsylvania teaching school, clerking in a
store and at work in a blacksmith shop. He was married in Bedford
County, Pennsylvania, to Miss Julia Boor on the 6th of February,
1859. Soon after he began to farm in Richardson County, Nebraska,
and continued there until the fall of 1868 when he came to Cass
County, and after making several trades secured his present home in
March, 1870. He owns 200 acres near Everett and is actively
engaged in tilling the soil. March 13, 1862, Mr. McCoy enlisted at
Rockport, Missouri, in Company C, Fifth Missouri Cavalry, for three
years' service, but owing to injuries received by the fall of a horse
and having his shoulder broken, he was discharged at Independence
after only three months' actual service. Mr. and Mrs. McCoy are the
parents of six children, of whom three are now living : Annie Bell,
(wife of R. H. Barnard, living near Everett), Oliver Carlyle, Don
Calvin, died February 19, 1877; Aldie P., Ralph Bird, died in Nebraska
in November, 1865, and Earl Willie, died May 16, 1875. He and his
wife are members of the M. E. Church, and in politics Mr. McCoy is
identified with the Greenback party. JOHN H. MILLER IS another of
the pioneer men of Cass County, having lived in the county since he
was two years old. He was born in Johnson County, Missouri, April
18, 1838. His parents were Robert B. and Susan (Beck) Miller ; the
former a native of Tennessee and the latter of North Carolina. In or
about the year 1833 the senior Miller settled in Johnson County,
three miles north of Holden, but in 1840 came to Cass County and
located fifteen miles southwest of Harrisonville. He resided there
about one year, afterward dying from the effects of injuries received
while throwing a mall or an ax with some of his neighbors. His was
the first death on South Fork in this county. He had been married
three times, the mother of our subject being the second wife. She
had but two children : John and a brother, Jacob B., who died May
10, 1862, shot by the militia. There were three children in the first
family only
714 BIOGRAPHICAL. one of whom is now living, William M.
Smith, of Oxford, Kansas, and two in the third family : Talbot S. and
Robert M. O'Brien, both in Oregon. Mr. Miller grew to manhood in
the wilds of Cass County, and attended the inferior schools of that
day. In 1855 he went to Fort Laramie hauling supplies to that post,
and in the following year to Fort Riley. At the outbreak of hostilities
he enlisted at Morristown on September, 1861, in the Tenth Missouri
Volunteer Cavalry, and was at the fight at Morristown. His service
continued in Missouri and Arkansas, he being with Price at Pea
Ridge. He served only seven months when he came home and
remained one year. In the fall of 1862 and until 1865 he was
occupied on the plains in hauling freight to various posts on the
border. Mr. Miller married Miss Francis L. Lyon March 29, 1868. She
was born in Kentucky, March 24, 1849. They have had six children,
four of whom are living: James B. (died September 14, 1871),
Serene, Susan, Thomas Henry, William Greenville and John Edgar
(died March 28, 1880). MOSES BROTHERS. This firm is composed of
Horace C, Myron J. and Franklin C, Moses, now engaged in the
mercantile business at Main City. The eldest brother, Horace, was
born in Canada, on the 30th of April, 1836; Myron, born May 10,
1849, ^n<^ Franklin, September 24, 185 1. Their parents were
Myron Moses, who was born in Simmsbury, Connecticut, and Ann
(Jacob) Moses, a native of Ireland. They were married in Vermont,
near Lake Champlain, and settled at Newcastle, Durham •County,
Canada, about the year 1833. In 1858 they came west and located
in Carroll County, Illinois, living there and in McHenry County until
1869, when they came to Missouri, the senior Moses having died in
Carroll County, Illinois, in 1863. The family settled in Everett
Township in 1869, and the boys were occupied in farming until 1871,
when the youngest brother, Franklin, began business at Everett, and
in 1873 was joined by his brother Horace. They continued in a
general merchandise trade until 1879, when they sold out and
shortly after ■established a merchandise business at Main City, then
just starting. By attention and industry they have built up a trade
above that of larger •firms in older and more populous towns. Myron
J. Moses, in addition to his mercantile interests, has spent some time
during the last three or four years in New Orleans, trading in stock,
more especially mules, and is now, in connection^with William Main,
doing quite an extensive stock trade. One only of the brothers has
thus far taken unto himself a helpmate. Franklin C. was married in
Linnville, Illinois, on April 28, 1878, to Miss Francis A. Dobson,
daughter of Robert M. Dobson, of Everett. Mrs. Moses, the mother of
these brothers, died in Everett Township,
EVERETT TOWNSHIP. /1 5 March 28, 1872. In politics they
are all classed with Republicans, and Ate in favor of every means
tending to further the good of the masses. WILLIAM SCEARCE is a
descendant of one of the old Kentucky families, his father, Laban
Scearce, having been born in Woodford County, and his mother, Jane
(Ashurst) Scearce, in Fayette County. The family long lived in
Woodford County, where William was born November 7, 1820, being
the third in a family of eight children, six of whom are now living,
four of them in Missouri. One, a sister, Mrs. Mary Todd, lives in
Peculiar Township, Cass County, and a brother, Robert Scearce, is in
Clinton County. Mr. . Scearce has always resided on a farm, and until
past thirty remained in his native state. Then he spent some time
through the west in search ■of a home, visiting Texas in 1855 and
prospecting in Kansas in 1857. Finally he settled, in 1857, on
Mormon Fork, in Bates County, where he lived until the outbreak of
the civil war. Not wishing to ■engage upon either side, he went to
Johnson and Pettis Counties and commenced handling stock. At the
close of the war he sold his farm on Mormon Fork and purchased his
present home of Dr. Richard Howerton, now living near Holden. He
has a large tract of land adjoining the village of Everett of 640 acres.
In addition he also has 130 acres lying further south and 290 acres
near East Lynne. Mr. Scearce is extensively interested in stock
feeding, generally feeding about 100 head of cattle and 150 of hogs.
He has ever lived a bachelor life, his household affairs being
presided over and attended to by the families of renters. During the
war he was visited at different periods by parties supposed to be
after plunder. At one time, thinking his life to be in danger, he went
out the back door while a number of men demanded admittance at
the front. As he ran several shots were fired at him, without effect,
for, as some of the party afterward expressed it, "he ran like a
quarter iiorse," and thus escaped the bullets. GEORGE N. STATES,
was born in Morrow County, Ohio, September 11, 185 1. His parents
were Horace and Jane (Ink) States, both natives of New York.
George is the only child of the family now living. When he was
fourteen years of age they removed to Delaware County, Ohio,
where his father died in 1862. In 1865 his mother married William
M. Overturf, and they lived there until his death, which occurred in
1876. George received a ■common school education, and had good
opportunities to attend college but did not care to do so, preferring
to attend to the duties of the farm. At one time he learned
photography, but owing to the close confine
7l6 BIOGRAPHICAL. ment was not able to work at the
business. In 1875 he went into the livery business at Edin, Delaware
County, and continued it for three years. In 1878 he came west on
account of failing''health, and chose his home in Cass County,
purchasing the " Blackburn " farm of 360 acres where he has one of
the finest country residences in the county. Mr. States was married in
1872, to Miss Charlotte Longwell, a neice of James Longwell. They
have two children : Herman Ellsworth, and Daisy Geraldine. Mr.
States is making an effort to improve the class of stock, especially
horses, having gone to some trouble and expense in order to secure
a fine driving horse of Mohawk breed. He is one of the men who' are
adding wealth to the county and to the state. OLIVER H. STEVENS
was born near Caledonia, Putnam County, Illinois, April 14, 1847,
and is the sixth child of a family of eleven, whose parents were
William P. and Acenith (Tyler) Stevens. Oliver H. received a fair
education in the common schools, and was in attendance for some
time at the Normal School, near Bloomington, Illinois. His life has
been spent in farming. In September, 1867, he came to Cass County,
but returned in the following May to La Salle County, Illinois, where
he lived for two years. He again came to Cass County in 1870, and
in 1874, April 22, was married to Miss Lizzie Hocker, daughter of
Benjamin Hocker, of Coldwater Township. They now have four
children: Cloyd B., Ivor Nora,. Walter Clarence and Maggie May. Mrs.
Stevens is a member of the Christian Church. Mr. S. has a good little
farm one and a-half miles west of Everett of eighty acres, and is
actively engaged in tilling the soil. WILLIAM H. STEEN was born in
Garland County, Kentucky, December 21, 1846; His father, Elijah
Steen, and his mother (formerly Matilda Burton, now the wife of
James Dorsett) were natives of Kentucky. William H. is the eldest of
four children: Mary E. is the wife of Hiram Stephens; Amanda is the
wife of M. M. Cable, and the fourth died while young. In 1849, the
family settled in Morgan County, Indiana, and lived there ten years,
coming to Missouri in 1859. I" the spring of 1861, they settled near
Ever.^tt, after having spent two years in Bates County and in
Kansas. In 1863^ they moved to Harrisonville. Before this Mr. Steen
was killed, on April 7, 1863, having been captured by Kansas
Jayhawkers and shot in the edge of Coldwater Township, in company
with John W. Todd and James Thruwitt. Before leaving for
Harrisonville the family suffered terribly at the hands of the Kansas
men, the houses in which they lived being burned three times. Mr.
W. H. Steen enlisted in October, 1863, at Kansas City, in the Ninth
Kansas Cavalry, Company E, and served until his
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com