100% found this document useful (2 votes)
30 views

Instant ebooks textbook Introducing .NET MAUI: Build and Deploy Cross-platform Applications Using C# and .NET Multi-platform App UI 1st Edition Shaun Lawrence download all chapters

UI

Uploaded by

toubirupy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
30 views

Instant ebooks textbook Introducing .NET MAUI: Build and Deploy Cross-platform Applications Using C# and .NET Multi-platform App UI 1st Edition Shaun Lawrence download all chapters

UI

Uploaded by

toubirupy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Experience Seamless Full Ebook Downloads for Every Genre at ebookmeta.

com

Introducing .NET MAUI: Build and Deploy Cross-


platform Applications Using C# and .NET Multi-
platform App UI 1st Edition Shaun Lawrence

https://ebookmeta.com/product/introducing-net-maui-build-
and-deploy-cross-platform-applications-using-c-and-net-
multi-platform-app-ui-1st-edition-shaun-lawrence/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

C# 12 and .NET 8 Modern Cross-Platform Development


Fundamentals 8th Edition Mark J. Price

https://ebookmeta.com/product/c-12-and-net-8-modern-cross-platform-
development-fundamentals-8th-edition-mark-j-price/

ebookmeta.com

C 9 and NET 5 Modern Cross Platform Development Build


Intelligent Apps Websites and Services with Blazor ASP NET
Core and Entity Framework Core Using Visual Studio Code
Fifth Edition Mark J. Price
https://ebookmeta.com/product/c-9-and-net-5-modern-cross-platform-
development-build-intelligent-apps-websites-and-services-with-blazor-
asp-net-core-and-entity-framework-core-using-visual-studio-code-fifth-
edition-mark-j-price/
ebookmeta.com

Introducing .NET 6 - Getting Started with Blazor, MAUI,


Windows App SDK, Desktop Development, and Containers Nico
Vermeir
https://ebookmeta.com/product/introducing-net-6-getting-started-with-
blazor-maui-windows-app-sdk-desktop-development-and-containers-nico-
vermeir/
ebookmeta.com

Nonprofit management 101 a complete and practical guide


for leaders and professionals essential resources tools
and hard earned wisdom from 55 leading experts Second
Edition Laila Brenner (Editor)
https://ebookmeta.com/product/nonprofit-management-101-a-complete-and-
practical-guide-for-leaders-and-professionals-essential-resources-
tools-and-hard-earned-wisdom-from-55-leading-experts-second-edition-
laila-brenner-editor/
ebookmeta.com
BioChemistry By Reginald H Garrett Charles M Grisham

https://ebookmeta.com/product/biochemistry-by-reginald-h-garrett-
charles-m-grisham/

ebookmeta.com

1001 Running Tips The essential runners guide 1st Edition


Robbie Britton

https://ebookmeta.com/product/1001-running-tips-the-essential-runners-
guide-1st-edition-robbie-britton/

ebookmeta.com

Surviving Curves Scarlet Springs Police Fire Rescue 1st


Edition Elsie James Brynn Hale

https://ebookmeta.com/product/surviving-curves-scarlet-springs-police-
fire-rescue-1st-edition-elsie-james-brynn-hale/

ebookmeta.com

Close to Midnight Reed Twins 1 1st Edition Carin Hart

https://ebookmeta.com/product/close-to-midnight-reed-twins-1-1st-
edition-carin-hart/

ebookmeta.com

Anti-Money Laundering in a Nutshell (2nd Edition):


Awareness and Compliance for Financial Personnel and
Business Managers Kevin Sullivan
https://ebookmeta.com/product/anti-money-laundering-in-a-nutshell-2nd-
edition-awareness-and-compliance-for-financial-personnel-and-business-
managers-kevin-sullivan/
ebookmeta.com
Go Out From Us A Zombie Apocalypse Colin Kerr

https://ebookmeta.com/product/go-out-from-us-a-zombie-apocalypse-
colin-kerr/

ebookmeta.com
Introducing
.NET MAUI
Build and Deploy Cross-platform
Applications Using C# and .NET
Multi-platform App UI

Shaun Lawrence
Introducing
.NET MAUI
Build and Deploy
Cross-­platform Applications
Using C# and .NET
Multi-platform App UI

Shaun Lawrence
Introducing .NET MAUI: Build and Deploy Cross-platform Applications
Using C# and .NET Multi-platform App UI
Shaun Lawrence
St Ives, UK

ISBN-13 (pbk): 978-1-4842-9233-4 ISBN-13 (electronic): 978-1-4842-9234-1


https://doi.org/10.1007/978-1-4842-9234-1

Copyright © 2023 by Shaun Lawrence


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Joan Murray
Development Editor: Laura Berendson
Editorial Assistant: Gryffin Winkler
Copy Editor: Mary Behr
Cover image designed by mrsiraphol through Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media LLC, 1 New York
Plaza, Suite 4600, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
[email protected], or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our
Print and eBook Bulk Sales web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub using this link: https://github.com/Apress/Introducing-MAUI.
Printed on acid-free paper
Table of Contents
About the Author��������������������������������������������������������������������������������xv

About the Technical Reviewer����������������������������������������������������������xvii

Acknowledgments�����������������������������������������������������������������������������xix

Introduction���������������������������������������������������������������������������������������xxi

Part I: Getting to Know .NET MAUI�����������������������������������������������1


Chapter 1: Introduction to .NET MAUI���������������������������������������������������3
What is .NET MAUI?����������������������������������������������������������������������������������������������3
Digging a Bit Deeper����������������������������������������������������������������������������������������5
Where Did It Come From?��������������������������������������������������������������������������������6
How It Differs From the Competition���������������������������������������������������������������7
Why Use .NET MAUI?���������������������������������������������������������������������������������������������8
Supported Platforms����������������������������������������������������������������������������������������8
Code Sharing���������������������������������������������������������������������������������������������������9
Developer Freedom���������������������������������������������������������������������������������������10
Community����������������������������������������������������������������������������������������������������10
Fast Development Cycle��������������������������������������������������������������������������������10
Performance��������������������������������������������������������������������������������������������������11
Strong Commercial Offerings������������������������������������������������������������������������12

iii
Table of Contents

Limitations of .NET MAUI������������������������������������������������������������������������������������13


No Web Assembly (WASM) Support���������������������������������������������������������������13
No Camera API�����������������������������������������������������������������������������������������������13
Apps Won’t Look Identical on Each Platform�������������������������������������������������14
Lack of Media Playback Out of the Box���������������������������������������������������������14
The Glass Is Half Full, Though�����������������������������������������������������������������������������14
How to Build .NET MAUI Applications������������������������������������������������������������������15
Visual Studio��������������������������������������������������������������������������������������������������15
Summary������������������������������������������������������������������������������������������������������������17

Chapter 2: Building Our First application�������������������������������������������19


Setting Up Your Environment������������������������������������������������������������������������������19
macOS�����������������������������������������������������������������������������������������������������������19
Windows��������������������������������������������������������������������������������������������������������27
Visual Studio to macOS���������������������������������������������������������������������������������28
Troubleshooting Installation Issues���������������������������������������������������������������������32
.NET MAUI Workload Is Missing���������������������������������������������������������������������32
Creating Your First Application����������������������������������������������������������������������������33
Creating in Visual Studio�������������������������������������������������������������������������������33
Creating in the Command Line����������������������������������������������������������������������37
Building and Running Your First Application�������������������������������������������������������38
Getting to Know Your Application������������������������������������������������������������������������41
WidgetBoard��������������������������������������������������������������������������������������������������41
Summary������������������������������������������������������������������������������������������������������������42
Source Code��������������������������������������������������������������������������������������������������43

iv
Table of Contents

Chapter 3: The Fundamentals of .NET MAUI���������������������������������������45


Project Structure�������������������������������������������������������������������������������������������������45
/Platforms/ Folder������������������������������������������������������������������������������������������48
/Resources/ Folder����������������������������������������������������������������������������������������51
Where To Begin?�������������������������������������������������������������������������������������������������56
Generic Host Builder�������������������������������������������������������������������������������������������56
What Is Dependency Injection?���������������������������������������������������������������������57
Registering Dependencies�����������������������������������������������������������������������������60
Application Lifecycle�������������������������������������������������������������������������������������������62
Application States�����������������������������������������������������������������������������������������62
Lifecycle Events���������������������������������������������������������������������������������������������64
Handling Lifecycle Events������������������������������������������������������������������������������65
Cross-Platform Mappings to Platform Lifecycle Events��������������������������������66
Platform-Specific Lifecycle Events����������������������������������������������������������������67
Summary������������������������������������������������������������������������������������������������������������72

Chapter 4: An Architecture to Suit You�����������������������������������������������75


A Measuring Stick�����������������������������������������������������������������������������������������������75
Prerequisites�������������������������������������������������������������������������������������������������������76
Model View ViewModel (MVVM)��������������������������������������������������������������������������77
Model�������������������������������������������������������������������������������������������������������������78
View���������������������������������������������������������������������������������������������������������������79
ViewModel�����������������������������������������������������������������������������������������������������80
Model View Update (MVU)�����������������������������������������������������������������������������������83
Getting Started with Comet���������������������������������������������������������������������������84
Adding Your MVU Implementation�����������������������������������������������������������������84

v
Table of Contents

XAML vs. C# Markup�������������������������������������������������������������������������������������������86


Plain C#���������������������������������������������������������������������������������������������������������87
C# Markup�����������������������������������������������������������������������������������������������������88
Chosen Architecture for This Book����������������������������������������������������������������������89
Adding the ViewModels���������������������������������������������������������������������������������90
Adding Views�������������������������������������������������������������������������������������������������96
Viewing Your Widget��������������������������������������������������������������������������������������99
MVVM Enhancements����������������������������������������������������������������������������������101
Summary����������������������������������������������������������������������������������������������������������105
Source Code������������������������������������������������������������������������������������������������107

Part II: User Interface��������������������������������������������������������������109


Chapter 5: User Interface Essentials������������������������������������������������111
Prerequisites�����������������������������������������������������������������������������������������������������111
Models���������������������������������������������������������������������������������������������������������111
Pages�����������������������������������������������������������������������������������������������������������113
ViewModels�������������������������������������������������������������������������������������������������114
App Icons����������������������������������������������������������������������������������������������������������116
Adding Your Own Icon����������������������������������������������������������������������������������116
Platform Differences������������������������������������������������������������������������������������117
Splash Screen���������������������������������������������������������������������������������������������������118
XAML�����������������������������������������������������������������������������������������������������������������119
Dissecting a XAML File��������������������������������������������������������������������������������120
Building Your First XAML Page��������������������������������������������������������������������122
Layouts�������������������������������������������������������������������������������������������������������������124
AbsoluteLayout��������������������������������������������������������������������������������������������124
FlexLayout���������������������������������������������������������������������������������������������������126
Grid��������������������������������������������������������������������������������������������������������������128
HorizontalStackLayout���������������������������������������������������������������������������������131
vi
Table of Contents

VerticalStackLayout�������������������������������������������������������������������������������������132
Data Binding�����������������������������������������������������������������������������������������������������135
Binding��������������������������������������������������������������������������������������������������������136
Applying the Remaining Bindings����������������������������������������������������������������140
MultiBinding������������������������������������������������������������������������������������������������141
Command����������������������������������������������������������������������������������������������������144
Compiled Bindings���������������������������������������������������������������������������������������147
Shell������������������������������������������������������������������������������������������������������������������148
ShellContent������������������������������������������������������������������������������������������������149
Navigation���������������������������������������������������������������������������������������������������150
Flyout�����������������������������������������������������������������������������������������������������������154
Tabs�������������������������������������������������������������������������������������������������������������160
Search���������������������������������������������������������������������������������������������������������160
Taking Your Application for a Spin���������������������������������������������������������������������161
Summary����������������������������������������������������������������������������������������������������������163
Source Code������������������������������������������������������������������������������������������������164
Extra Assignment����������������������������������������������������������������������������������������������164

Chapter 6: Creating Our Own Layout������������������������������������������������165


Placeholder�������������������������������������������������������������������������������������������������������166
ILayoutManager������������������������������������������������������������������������������������������������168
BoardLayout������������������������������������������������������������������������������������������������������169
BoardLayout.xaml����������������������������������������������������������������������������������������169
BoardLayout.xaml.cs�����������������������������������������������������������������������������������172
FixedLayoutManager�����������������������������������������������������������������������������������������177
Accepting the Number of Rows and Columns for a Board��������������������������179
Providing Tap/Click Support Through a Command��������������������������������������181
Building the Board Layout���������������������������������������������������������������������������182
Setting the Correct Row/Column Position for Each Widget�������������������������185

vii
Table of Contents

Using Your Layout���������������������������������������������������������������������������������������������187


Adding a Factory That Will Create Instances of Your Widgets���������������������187
WidgetTemplateSelector������������������������������������������������������������������������������193
Updating FixedBoardPageViewModel����������������������������������������������������������194
Finally Using the Layout������������������������������������������������������������������������������196
Summary����������������������������������������������������������������������������������������������������������197
Source Code������������������������������������������������������������������������������������������������198
Extra Assignment����������������������������������������������������������������������������������������������198

Chapter 7: Accessibility��������������������������������������������������������������������199
What Is Accessibility?���������������������������������������������������������������������������������������199
Why Make Your Applications Accessible?���������������������������������������������������������200
What to Consider When Making Your Applications Accessible��������������������������200
How to Make Your Application Accessible��������������������������������������������������������201
Screen Reader Support�������������������������������������������������������������������������������201
Suitable Contrast�����������������������������������������������������������������������������������������208
Dynamic Text Sizing�������������������������������������������������������������������������������������210
Testing Your Application’s Accessibility�������������������������������������������������������������215
Android��������������������������������������������������������������������������������������������������������215
iOS���������������������������������������������������������������������������������������������������������������215
macOS���������������������������������������������������������������������������������������������������������216
Windows������������������������������������������������������������������������������������������������������216
Accessibility Checklist��������������������������������������������������������������������������������������216
Summary����������������������������������������������������������������������������������������������������������218
Source Code������������������������������������������������������������������������������������������������219
Extra Assignment����������������������������������������������������������������������������������������������219

viii
Table of Contents

Chapter 8: Advanced UI Concepts�����������������������������������������������������221


Adding the Ability to Add a Widget to a Board���������������������������������������������������221
Possible Ways of Achieving Your Goal���������������������������������������������������������222
The Chosen Approach����������������������������������������������������������������������������������224
Styling���������������������������������������������������������������������������������������������������������������230
Examining the Default Styles�����������������������������������������������������������������������232
Creating a Style�������������������������������������������������������������������������������������������234
AppThemeBinding���������������������������������������������������������������������������������������236
Further Reading�������������������������������������������������������������������������������������������236
Triggers�������������������������������������������������������������������������������������������������������������237
Creating a DataTrigger���������������������������������������������������������������������������������238
EnterActions and ExitActions�����������������������������������������������������������������������239
Creating a TriggerAction������������������������������������������������������������������������������240
Further Reading�������������������������������������������������������������������������������������������242
Animations���������������������������������������������������������������������������������������������������242
Basic Animations�����������������������������������������������������������������������������������������243
Combining Basic Animations�����������������������������������������������������������������������245
Cancelling Animations���������������������������������������������������������������������������������246
Easings��������������������������������������������������������������������������������������������������������246
Complex Animations������������������������������������������������������������������������������������247
Combining Triggers and Animations�����������������������������������������������������������������252
Summary����������������������������������������������������������������������������������������������������������254
Source Code������������������������������������������������������������������������������������������������255
Extra Assignment����������������������������������������������������������������������������������������������255
Animate the BoxView Overlay����������������������������������������������������������������������255
Animate the New Widget�����������������������������������������������������������������������������255

ix
Table of Contents

Part III: Behind the Scenes������������������������������������������������������257


Chapter 9: Local Data�����������������������������������������������������������������������259
What Is Local Data?������������������������������������������������������������������������������������������259
File System�������������������������������������������������������������������������������������������������������260
Cache Directory�������������������������������������������������������������������������������������������260
App Data Directory��������������������������������������������������������������������������������������261
Database�����������������������������������������������������������������������������������������������������������261
Repository Pattern���������������������������������������������������������������������������������������262
SQLite����������������������������������������������������������������������������������������������������������270
LiteDB����������������������������������������������������������������������������������������������������������278
Database Summary�������������������������������������������������������������������������������������285
Application Settings (Preferences)��������������������������������������������������������������������285
What Can Be Stored in Preferences?����������������������������������������������������������286
Setting a Value in Preferences��������������������������������������������������������������������286
Getting a Value in Preferences��������������������������������������������������������������������288
Checking if a Key Exists in Preferences������������������������������������������������������290
Removing a Preference�������������������������������������������������������������������������������291
Secure Storage�������������������������������������������������������������������������������������������������291
Storing a Value Securely������������������������������������������������������������������������������291
Reading a Secure Value�������������������������������������������������������������������������������292
Removing a Secure Value����������������������������������������������������������������������������292
Platform specifics����������������������������������������������������������������������������������������293
Viewing the Result��������������������������������������������������������������������������������������������295
Summary����������������������������������������������������������������������������������������������������������296
Source Code������������������������������������������������������������������������������������������������297
Extra Assignment����������������������������������������������������������������������������������������������297

x
Table of Contents

Chapter 10: Remote Data������������������������������������������������������������������299


What Is Remote Data?��������������������������������������������������������������������������������������299
Considerations When Handling Remote Data����������������������������������������������300
Webservices������������������������������������������������������������������������������������������������������302
The Open Weather API���������������������������������������������������������������������������������302
Adding Some State��������������������������������������������������������������������������������������319
Simplifying Webservice Access������������������������������������������������������������������������326
Prebuilt Libraries�����������������������������������������������������������������������������������������327
Code Generation Libraries���������������������������������������������������������������������������327
Further Reading������������������������������������������������������������������������������������������������329
Polly�������������������������������������������������������������������������������������������������������������329
StateContainer from CommunityToolkit.Maui����������������������������������������������330
Summary����������������������������������������������������������������������������������������������������������330
Source Code������������������������������������������������������������������������������������������������331
Extra Assignment����������������������������������������������������������������������������������������������331
TODO Widget������������������������������������������������������������������������������������������������331
Quote of the Day Widget������������������������������������������������������������������������������332
NASA Space Image of the Day Widget���������������������������������������������������������332

Part IV: Utilizing the platforms������������������������������������������������333


Chapter 11: Getting Specific�������������������������������������������������������������335
.NET MAUI Essentials����������������������������������������������������������������������������������������335
Permissions�������������������������������������������������������������������������������������������������336
Using the Geolocation API����������������������������������������������������������������������������341
Configuring Platform-Specific Components������������������������������������������������346
Platform-Specific API Access����������������������������������������������������������������������������352
Platform-Specific Code with Compiler Directives���������������������������������������352
Platform-Specific Code in Platform Folders������������������������������������������������354

xi
Table of Contents

Overriding the Platform-Specific UI������������������������������������������������������������������355


OnPlatform��������������������������������������������������������������������������������������������������355
Handlers������������������������������������������������������������������������������������������������������358
Summary����������������������������������������������������������������������������������������������������������361
Source Code������������������������������������������������������������������������������������������������362
Extra Assignment����������������������������������������������������������������������������������������������362
Barometer Widget����������������������������������������������������������������������������������������362
Geocoding Lookup���������������������������������������������������������������������������������������363

Chapter 12: Testing���������������������������������������������������������������������������365


Unit Testing�������������������������������������������������������������������������������������������������������365
Unit Testing in .NET MAUI����������������������������������������������������������������������������366
Adding Your Own Unit Tests�������������������������������������������������������������������������368
Testing Your View Models����������������������������������������������������������������������������372
Testing Asynchronous Operations���������������������������������������������������������������374
Testing Your Views���������������������������������������������������������������������������������������380
Device Testing���������������������������������������������������������������������������������������������������382
Creating a Device Test Project���������������������������������������������������������������������383
Adding a Device-Specific Test���������������������������������������������������������������������383
Running Device-Specific Tests��������������������������������������������������������������������384
Snapshot Testing�����������������������������������������������������������������������������������������������386
Snapshot Testing Your Application���������������������������������������������������������������387
Passing Thoughts����������������������������������������������������������������������������������������390
Looking to the Future����������������������������������������������������������������������������������������390
Summary����������������������������������������������������������������������������������������������������������391
Source Code������������������������������������������������������������������������������������������������391

xii
Table of Contents

Chapter 13: Lets Get Graphical���������������������������������������������������������393


.NET MAUI Graphics������������������������������������������������������������������������������������������393
Drawing on the Screen��������������������������������������������������������������������������������394
Further Reading�������������������������������������������������������������������������������������������397
Building a Sketch Widget����������������������������������������������������������������������������������397
Creating the SketchWidgetViewModel��������������������������������������������������������397
Representing a User Interaction������������������������������������������������������������������398
Creating the SketchWidgetView������������������������������������������������������������������399
Registering Your Widget������������������������������������������������������������������������������404
Taking Your Widget for a Test Draw�������������������������������������������������������������404
Summary����������������������������������������������������������������������������������������������������������405
Source Code������������������������������������������������������������������������������������������������405
Extra Assignment����������������������������������������������������������������������������������������������406

Part V: Finishing Our Application���������������������������������������������407


Chapter 14: Releasing Our Application���������������������������������������������409
Distributing Your Application�����������������������������������������������������������������������������409
Android��������������������������������������������������������������������������������������������������������410
iOS���������������������������������������������������������������������������������������������������������������412
macOS���������������������������������������������������������������������������������������������������������415
Windows������������������������������������������������������������������������������������������������������416
Things to Consider��������������������������������������������������������������������������������������������416
Following Good Practices����������������������������������������������������������������������������416
Performance������������������������������������������������������������������������������������������������418
Linking���������������������������������������������������������������������������������������������������������421
Crashes/Analytics����������������������������������������������������������������������������������������422
Obfuscation�������������������������������������������������������������������������������������������������424
Distributing Test Versions����������������������������������������������������������������������������������426
Summary����������������������������������������������������������������������������������������������������������427
xiii
Table of Contents

Chapter 15: Conclusion���������������������������������������������������������������������429


Looking at the Final Product�����������������������������������������������������������������������������429
Taking the Project Further���������������������������������������������������������������������������431
Useful Resources����������������������������������������������������������������������������������������������432
StackOverflow���������������������������������������������������������������������������������������������433
GitHub����������������������������������������������������������������������������������������������������������433
YouTube�������������������������������������������������������������������������������������������������������433
Social Media������������������������������������������������������������������������������������������������434
Yet More Goodness��������������������������������������������������������������������������������������434
Looking Forward�����������������������������������������������������������������������������������������������434
Upgrading from Xamarin.Forms������������������������������������������������������������������435
Comet����������������������������������������������������������������������������������������������������������435
Testing���������������������������������������������������������������������������������������������������������436

Index�������������������������������������������������������������������������������������������������437

xiv
Random documents with unrelated
content Scribd suggests to you:
Then gang wi’ me to Scotland, dear,
We ne’er again will roam,
And with thy smile sae bonny, cheer
My native Highland home.

For blithsome is the breath of day,


And sweet’s the bonny broom,
And pure the dimpling rills that play
Around my Highland home.

Such, during several months, was their almost unvaried mode of


life. On the 12th of March 1826, Clapperton was seized with
dysentery; and the intense heat of the weather as well as the
feverish state of the patient rendered it necessary that he should be
almost constantly fanned; a female slave was employed to perform
this office, but she found it too irksome, and soon abandoned her
post and ran away. He grew daily worse, while Lander was
oppressed with anxiety on account of the calamities which had
befallen him, and exhausted with the exertion required in the
performance of the various duties which devolved upon him. As he
had a great regard for his master, we see no reason to doubt the
accuracy of his account, that he was unremitting in his attentions to
him during his last illness, which Clapperton himself attributed to the
following instance of imprudence. “Early in February,” said he one
day to Lander, “after walking a whole day exposed to the scorching
rays of the sun, I was fatigued, and lay down under the branch of a
tree. The soil on that occasion was soft and wet, and from that hour
to the present I have not been free from cold. This has brought on
my present disorder, from which I believe I shall never recover.” A
couch was made for him on the outside of his hut, and during the
space of twenty days he gradually declined, till at last all hope of
recovery was extinguished. In these dismal moments, says his
faithful attendant, he derived consolation and support from the
exercises of religion. Lander read the scriptures to him daily. No
stranger visited him during his illness, except an Arab of Fezzan,
who intruded himself one day into the hut, and wished to be allowed
to read some of the Mahometan prayers, but he was ordered to quit
his presence. Pasko who had left his service, and had married and
settled in the city, was taken back, and relieved Lander of a portion
of his heavy tasks. During his illness Clapperton talked much of his
country and his friends. By the advice of Maddie, a native of Bornou,
he swallowed a decoction of green bark from the butter tree, and
speedily afterwards became worse, so that he could get no repose.
On the next day he said to Lander, “I feel myself dying. Take care of
my journal and papers after my decease; and when you arrive in
London, go immediately to my agents and send for my uncle who will
accompany you to the colonial office, and see you deposit them with
the secretary. Borrow money, and go home by Fezzan in the train of
the Arab merchants. From Mourzuk send to Mr. Warrington, our
consul at Tripoli, for money, and wait till it comes. Do not lumber
yourself with my books. Leave also the barometer and every
cumbersome article. You may give them to Mallem Mudey. Remark
what towns and villages you pass through, and put on paper
whatever remarkable thing the chiefs of the different places may say
to you.”
On the 11th of April, he was shaved, and rallied a little, but soon
became worse, and died on the 13th. By order of Bello he was
buried in an open place about five miles from the city of Soccatoo,
and Lander read over him the service of the church of England for
the “burial of the dead,” as Clapperton had himself formerly done for
Dr. Oudney and some other of his companions. Next day Lander
returned to the spot, and with the assistance of some of the natives a
shed was erected over the grave.
MEMOIR
OF

MAJOR ALEXANDER LAING,


THE

AFRICAN TRAVELLER.
MEMOIR
OF

MAJOR ALEX. GORDON LAING,


THE

AFRICAN TRAVELLER.

Major Alexander Gordon Laing, another of those adventurous


spirits who met with their common fate, in the attempt to explore the
interior of Africa, was born at Edinburgh on the 27th December 1794,
and was the eldest son of Mr. William Laing, A.M., one of the most
popular classical teachers of his day. In his academy, in the New
Town of Edinburgh, young Laing received nearly the whole of his
education, at least all that was necessary to prepare him for the
university. Possessing a quick intuitive perception, and an ardent
thirst for classical knowledge, his progress was in proportion; and at
the early age of thirteen, he entered the university of Edinburgh.
Here his attainments became still more marked, and Professor
Christison, who then occupied the humanity chair, observing his
literary taste, used to point him out in the public class as worthy the
imitation of his fellow-students, though few might hope to surpass
him.
When about fifteen, Laing went to Newcastle, where for six
months he filled the situation of assistant to Mr. Bruce, a teacher in
that city; he then returned to Edinburgh, and entered upon a similar
duty under his father, a situation for which he was singularly
qualified.
It appears strange that a young man, quietly, and, at the same
time, eagerly, pursuing the laborious profession of a schoolmaster,
should have afterwards adopted another line of life forming a perfect
contrast to that in which he had been previously employed. The
change of his tastes is wholly to be attributed to his connexion with
the volunteers. At a time when volunteering was very general,
Alexander Laing entered one of the corps then forming; and in 1810
was made an ensign in the Prince of Wales’s Edinburgh Volunteers,
then being in his seventeenth year. Captivated with the specimen he
there had of a military life, he desired earnestly to be a soldier. He
could no longer submit to the restraints and routine of school
discipline; and at the end of the second year, he finally gave up the
now to him irksome duties of teaching, to the disappointment of his
parents and relatives, who were very desirous that he should not
change his profession. Being, however, bent upon the military
service, he, in the year 1811, went out to Barbadoes, where his
maternal uncle, Colonel, afterwards General Gabriel Gordon, then
was, with whom he remained a short time till he obtained an
ensigncy in the York Light Infantry, which regiment he immediately
joined at Antigua, and in two years thereafter he was promoted to a
lieutenancy in the same corps—a situation which he held till the
regiment was reduced, when he was then placed upon half pay.
But anxious for occupation, he exchanged, as speedily as the
affair could be negotiated, into the second West India regiment,
which he joined at Jamaica. While there, he had to discharge the
duties of deputy quartermaster-general, the exertions of which
department brought on a liver complaint, for which his medical
advisers recommended a sea voyage. He accordingly sailed to
Honduras, by which his complaint was considerably relieved, and the
governor, Colonel Arthur, finding him an active, useful, and intelligent
officer, appointed him to the office of fort-major, and would not suffer
him to return to Jamaica, but had him attached to another division of
his regiment then in Honduras, where he remained till a return of his
complaint forced him to come home, his frame being so much
debilitated, that he was unable to walk, so that it became necessary
to carry him on shipboard.
His constitution was very seriously injured by this illness, and in
consequence he remained nearly eighteen months with his friends in
Scotland. During this time, however, that half of the second West
India regiment to which he was attached was reduced, and he was
again placed upon half-pay. In the autumn of 1819, he returned to
London, and having been sent for by the late Sir Henry Torrens, then
Colonel of his regiment, was familiarly complimented by him on his
former services, immediately appointed lieutenant and adjutant, and
proceeded to Sierra Leone.
Early in January 1822, Lieutenant Laing was sent by the late
governor, Sir Charles M‘Carthy, on an embassy to Kambia and the
Mandingo country, to ascertain the political state of those districts,
the disposition of the inhabitants to trade, and their sentiments in
regard to the abolition of the slave trade. Sir Charles was perfectly
satisfied with the manner in which his instructions were executed,
and with the information he received on the different heads.
Having fulfilled the purposes of the mission at Kambia, he crossed
the river Scarcies, and proceeded on foot to Malacouri, a strongly
fortified Mandingo town, situated on the banks of the river Malageea,
about twenty miles N. by W. from Kambia, where he learned that
Amara had applied to the king of the Soolimas, who had sent a
numerous army to his assistance, by whose means he had taken
Malageea, the principal town belonging to Sannassee, and had
made that chief a prisoner. Here he was also informed, that Amara
meant to put Sannassee to death after the performance of several
ceremonies. The Soolima force was stated to exceed ten thousand
in number, and commanded by Yaradee, a brother of the king, who
had acquired some renown as a warrior. Of the Soolimas, little more
than the name was known at Sierra Leone: they were reported,
however, to be a very powerful nation, residing in the interior, at a
distance of three or four hundred miles to the eastward of Sierra
Leone.
Sannassee having always been upon the most friendly terms with
our government, and the unforgiving disposition of Amara being well
known, great alarm was excited for the unfortunate chieftain whom
he had in his power; Laing therefore, though suffering under a
severe attack of fever and ague, proceeded to the Soolima camp to
mediate between Amara and the captive Sannassee. His account of
this expedition is as follows:
“About two miles beyond the river Malageea, which I crossed near
its source, I fell in with an outlying picket of the Soolimas, consisting
of about fifty men, with sentries regularly posted, to whom I was
obliged to explain my purpose before the chief of the guard would
permit me to pass: another mile west brought me to a stronger guard
of about one hundred and fifty men; and a mile and a-half farther to a
large savannah or plain where the whole army was encamped. It
was now nearly nine o’clock, and being very faint and feverish, I was
glad to take refuge from the rays of the morning sun, which, in this
part of Africa is the most oppressive time of the day, under a few
bundles of dried grass thrown loosely upon three sticks fixed apart in
the ground at equal distances, the tops being drawn together and
fastened after the manner of military triangles. These temporary
dwellings, when well constructed, form no bad imitation of, or
substitute for, bell-tents, possessing this advantage, that they can be
erected with little trouble, and no expense, in a short time, whenever
an army takes up a position. From this covering I had a view of the
whole encampment, which exhibited the appearance and bustle of a
well attended fair, rather than the regularity and discipline of military
quarters. Tents constructed as above described, were to be seen
covering the savannah as far as the trees, windings, and other
obstacles, would permit the eye to reach; and the distinguishing flags
of the various and numerous tribes were everywhere to be observed
waving over the habitations of their respective chiefs. Music, a horrid
din of a variety of barbarous instruments broke on the ear from every
direction; while parties of men, grotesquely habited in war dresses,
were here and there descried, brandishing their cutlasses, and
capering with the most extravagant gestures, to the time of the
various sounds produced. The novelty of the scene attracted my
attention for a while,—but fatigue, arising from the ague of the
preceding night, at length overcame my curiosity. About noon I was
awoke by one of my followers, who acquainted me that Amara was
ready to hold a palaver with me, and desired my immediate
attendance. In my way to his tent I visited Satin Lai, a designing
Mandingo chief, possessing much power; he had been mainly
instrumental in putting Amara on the throne, and was at this time the
only staunch adherent to the king, who, by following too implicitly his
advice, had lowered himself considerably in the opinion of his head
men, who form the principal strength of an African king. I found Satin
Lai, a good-looking man, apparently between sixty and seventy
years of age, about five feet ten inches in height, affable in his
deportment, with a mild and amiable countenance which is said to be
rather at variance with his actions. He was performing the office of a
commissary, surrounded by several hundred baskets of white rice,
which he was distributing to the different tribes in quantities
proportionate to their strength. In one corner of the tent some of his
slaves were employed in cooking, in another his horse was feeding,
encircled with Moorish trapping, spears, muskets, bows and quivers.
On appearing before the tent of Amara, I was directed to seat myself
under the shade of a large booth covered with cocoa-nut branches
and plantain leaves, capable of containing and sheltering from the
rays of the sun upwards of two thousand people; here the king soon
joined me, and the war drum being beat, the booth was shortly filled
with a motley assemblage of armed men. Booths of corresponding
size, erected at right angles, and parallel to the one in which I sat, so
as to form a large square, were also soon crowded with hordes of
Soolimas, Bennas, Tambaccas, and Sangaras, in all, amounting to
about ten thousand men, while the inclosed space was free to such
as were desirous of exhibiting in feats of warlike exercises, in
dancing, and in music. As the exibitions on this occasion were of the
same kind with those which I afterwards saw in the Soolima country
on similar occasions, and which will be described hereafter, I shall
merely observe that Yaradee, the general of the Soolima army, was
particularly conspicuous in exhibiting on horseback the various
evolutions of African attack and defence. When their performances
were concluded, I had an interview with Yaradee, and obtaining from
him an assurance that Sannassee’s life should be preserved, I took
my leave, receiving many protestations of friendship. A subsequent
conversation with Amara, in which I explained his Excellency’s
wishes, terminated my visit to the camp, which I quitted at sunset,
and proceeded direct on my return to Sierra Leone, where I did not
arrive till the sixth day, having suffered much inconvenience on the
journey, from the effects of increasing illness.”
We have given this account entire, that the reader may
understand the kind of natives that he had to deal with in his after
intercourse with them. His interference seemed here to have
terminated happily for Sannassee, but he was scarcely recovered
from his illness, when it was reported that all his efforts had been of
no avail; and the governor, still anxious to save the life of his ally,
asked Laing again to undertake another embassy for the same
object; he complied, again visited the Soolima camp, where he found
that Amara had set Sannassee at liberty, after first burning his town,
and then plundering his property. Lieutenant Laing did not waste
time in a longer palaver than was just sufficient to mark the
displeasure of the governor regarding their conduct to Sannassee.
He was accompanied on this mission by Mr. Mackie, assistant
surgeon, who, together with Lieutenant Laing, were the objects of
undisguised astonishment to Yarradee, who scrutinized every article
of their dress with great minuteness; and on observing Laing pull off
his gloves, “he stared with surprise, covered his widely opened
mouth with his hands, and at length he exclaimed, ‘Alla ackbar,’ he
has pulled the skin off his hands.” Lieutenant Laing and Mr. Mackie
reached Sierra Leone after an absence of six days and a-half during
the whole of which time they had not been under shelter for a single
hour. While upon this second mission he had observed that many
men who accompanied the Soolima army possessed considerable
quantities of gold, and having learned that ivory abounded in
Soolima, he suggested to the governor the advantage to the colony
of opening up an intercourse with these people.
The governor was pleased with the suggestion, and submitted it
without delay to a meeting of the council, when it was resolved, that
Lieutenant Laing should be permitted to penetrate to the country of
the Soolimas, choosing his own road, and the one by which he could
most easily communicate his discoveries. He was now in the
character of a volunteer traveller, a character which he admirably
supported.
This party consisted of Musah Kanta, a native of Foutah Jallon;
two soldiers of the second West India regiment, eleven carriers,
natives of the Jolof country, and a boy, Mahomed, a native of Sego.
They quitted Sierra Leone in boats on the 16th of April, 1822, and
ascending the Rokelle, slept the first night at Mr. M‘Cormick’s factory,
who, from his name, seems to have been a countryman of our
traveller’s. They took the route through the Timannee country, calling
upon the various chieftains and governors who were in their way,
from whom they received passes, but often with difficulty, and only
on the payment of money, and the presentation of articles,
sometimes of considerable value.
While they were upon the point of leaving Rokon, which is in the
Timannee country, the king of the place made his appearance in a
violent rage, and the cause of his grievance, was a Jolofman, who
attended Lieutenant Laing, having had the audacity to dress himself
in a new red slop shirt, which the king considering a more splendid
habiliment than his own, insisted upon having; this the Jolof
obstinately refused; while the king declared it to be the law in his
country, (a law made by himself at the moment) “That any man
dressed better than himself, especially in red, should forfeit his
clothes.” Lieutenant Laing settled this difference by desiring the Jolof
to change his shirt, and giving the king a bar of tobacco and a dram
of rum. After leaving Rokon, the country for a short time was
beautiful and cultivated, and on reaching Nunkaba, they found the
female inhabitants busy with their cotton, preparing it for spinning.
On their arrival at Toma, though only sixty miles from Sierra
Leone, Lieutenant Laing learned, to his surprise, that “no white man
had ever before been seen there.” He says, in his journal, “the first
appearance of surprise, that came under my observation was in a
woman, who stood fixed like a statue, gazing at the party as they
entered the town, and did not stir a muscle till the whole had passed,
when she gave a loud halloo of astonishment, and covered her
mouth with both her hands.”
This astonishment at their appearance, was sometimes
productive of annoyance during the progress of their journey. At
Balanduco they found the women busily employed in separating the
juicy saffron-coloured fruit from the palm nut; in squeezing it into
wooden mortars, and in beating it into one common mash, in order
that the oil might be extracted more easily and more commodiously
in boiling. Lieutenant Laing estimated that during the season of the
fruit, they manufactured, on an average, from thirty to forty gallons a-
day.
They now began to feel the fatigues of a long continued journey;
they reached Rokanka on the 25th of April, much fatigued, and
deprived of water, the inhabitants of the village either being unable or
unwilling to supply them with any; and being afraid to enter the
woods in search of it, from the whistle of the Purrah being heard in
the neighbourhood. The Purrah are a sort of “Robin Hood gang,”
who infest the woods, occasionally making an inroad upon some
peaceful village, which they invariably plunder; the inhabitants
keeping hidden, and never attempting any resistance. They are
tatooed in a manner peculiar to themselves, and have gradations of
rank in their community. At stated times they hold assemblies, on
which occasions, the country is in the greatest alarm, for notices are
dispersed abroad concerning them, and the people are obliged to
attend; they settle all differences, and inflict capital punishments,
according to their pleasure, so that in fact, they are the governors of
the country, and Lieutenant Laing says, “that from the nature of their
power, and the purposes to which it is applied, they will probably be
found a most serious obstacle to its civilization.”
On leaving Rokanka the next day, they came in sight of a stream,
after walking about an hour and a quarter, and having suffered so
much from thirst, for thirty hours preceding, they were so eager to
enjoy it, and indulged so freely in it, that on reaching a town four
miles farther, the whole party were attacked with the most violent
spasms, Lieutenant Laing suffering particularly, it being six days
before he was at all restored to his usual health.
He found some difficulty in procuring permission to depart from
Ma-Bung, which was the name of his present residence, being
obliged to hold a palaver, as they termed it, with the head men of the
place; and it was only after a very long palaver with his interpreter
and them, that he was suffered to depart, upon making presents of
tobacco, powder, white baft, and rum.
This custom of presenting gifts at every place, was a serious evil,
but it was one without which it was impossible to proceed, and
occasionally, his attendants and the inhabitants engaged in a scuffle,
sometimes difficult to suppress. It is unnecessary to follow his
motions minutely; the reader may find them interestingly and
particularly recorded in his travels published in 1825, and edited by
his friend Captain Sabine.
It is sufficient to mention that on the 7th of May he reached the
last town of the Timmannee country; called Ma-Boom, part of which
was inhabited by Koorankos, in which part he took up his residence,
as through that country it was now his intention to proceed.
He found very great difficulty in getting away from Ma-Boom,
owing to the greediness and treachery of Smeilla, the head man of
the place, who laid a plan of assault and robbery upon him and his
party, but from which he was preserved by the sagacity of his
servant, Musah, and his own decision. With the other inhabitants of
Ma-Boom he seemed pleased, particularly the Mandingo families,
and the country around, he says, is thickly wooded, and abounds
with rich pasturages, well stocked with cattle, sheep, and goats.
The next station was Kooloofa, where they received a kind but
noisy welcome, being prevented from sleeping during the night by
barbarous music in honour of their visit. “They, one and all,” says
Lieutenant Laing, “thanked God for my appearance among them:
they said they could not live without trade, and on that account, if for
no other, they were glad to see a white man come into the country to
open a good road.” He easily received permission to depart from
Kooloofa, and left it with the best wishes of a numerous crowd,
assembled to witness his departure. After passing through several
places, they reached Seemera, where he was as kindly received as
at Kooloofa, the king “thanking God that he had seen a white man,
and would do any thing to help him, as he was sure he could have
no other object in coming to this country than to do good.” While
there the place was visited by a tremendous tornado. The house
where Laing slept being badly thatched, the lightning kept it in almost
perpetual illumination, and, as he himself expresses it, the holes in
the roof gave him the full benefit of a shower bath. He was detained
here a short time, partly by the rain, during which time the king sent
a company of dancers to dance before him for his diversion. His
route, after leaving Seemera, was difficult and dangerous, he and his
party having to endure several heavy tornadoes, rough roads, and
plots laid to rob him of his baggage. His remarks upon what he
observed during this journey must be extremely interesting to a
geologist, and, indeed, to any man of science, for which, however,
we again refer to his travels.
While at Worrowyah, he was entertained by some female singers,
the tenor of whose song, he said, did not please him. They sung “of
the white man who had come to their town; the houseful of money
which he had; such cloth, such beads, such fine things had never
been seen in Kooranko before; if their husbands were men, and
wished to see their wives well dressed, they ought to take some of
the money from the white man.” He was saved from the effects of
this advice by one of his suite called Tamba, who answered them by
a counter song. He sung of “Sierra Leone, of houses a mile in length
filled with money; that the white man who was here had nothing
compared to those in Sierra Leone; if, therefore, they wished to see
some of the rich men from that country come into Kooranko, they
must not trouble this one; whoever wanted to see a snake’s tail must
not strike it on the head.” This song was applauded, and Lieutenant
Laing was allowed to keep his money.
While at Kamato, which he reached on the 29th of May, Laing had
a severe attack of fever, which lasted for several days. As he was
recovering from the attack, a messenger arrived from the king of the
Soolimas, with a party, and two horses, to convey him to their
country, his majesty being very desirous to see him within his
territories. Laing was very glad to accept of the invitation, so on the
morning of the 5th of June, he mounted one of the horses, and left
the Kooranko country for a time. It was not till the 11th that he
reached the royal city, having in his way thither received much
kindness and hospitality from the native head men of the villages
through which they passed; one head man, says our traveller, “took
off his cap, and lifting his aged eyes to heaven, fervently thanked his
Creator for having blessed him with the sight of a white man before
he died.”
When Lieutenant Laing reached Falaba, which was the residence
of the king of the Soolimas, he was saluted with a heavy and
irregular discharge of musketry, which he ordered to be returned with
three rounds from his party, and then alighting, shook hands with the
king, who presented him with two massive gold rings, and made him
sit down beside him. The king and the Lieutenant were scarcely
seated, when his old friend Yaradee, better dressed than when he
last met him, mounted on a fiery charger, crossed the parade at full
gallop, followed by about thirty warriors on horseback, and two
thousand on foot,—the equestrians returning and performing many
evolutions, to the amazement and admiration of the spectators. After
which many other spectacles were exhibited for the diversion of his
guest by the king of the Soolimas. Yaradee was particularly kind to
Lieutenant Laing, saying, “he was a proud man that day, the first day
in which a white man had ever been in the Soolima country.”
The different chieftains paid homage to our traveller, when they
saw how highly he was thought of by their sovereign, and he was
teazed with speeches and remarks addressed to him by a crowd for
the pleasure of hearing him speak, and whenever he did so, they
would shout, “He speaks, the white man speaks.” He said these
marks of attention would have delighted him any other time, but his
horse having fallen with him, he had been precipitated into the water
of a marsh he was crossing at the time of the accident, which
brought on an attack of fever, from which, however, he recovered in
about three days. Those who wish to see an account of the fetes and
the excursions, designed principally in honour of Lieutenant Laing,
must read his travels, in which they will find an interesting account.
Feeling again the intimations of approaching illness, he shortened
his interviews, and came to the great business of the mission, free
intercourse and trade, and the desire of Sir Charles M‘Carthy to
cultivate a good understanding with them; and then producing his
presents, which were considerable, every thing was adjusted in the
most amicable manner: but he had scarcely returned to his hut,
when the fever was renewed with redoubled violence, and,
stretching himself on his mat, he resigned himself to the disease
which for nine or ten days prevented him from rising; three days of
which he was in a state of delirium. On his consciousness returning
he found he had been cupped by one of the country doctors, which
had been of great service to him. During this illness his
meteorological observations ceased, and it was, as he expresses it,
“with a grief bordering on distraction that he thought upon his
chronometer, which, as nobody could wind up but himself, had
unavoidably gone down.”
It was on the 1st of July that he found himself able to write a few
lines to acquaint his friends at Sierra Leone with his arrival at Falaba,
and that he hoped soon to be able to go even farther eastward; two
natives of Soolima volunteering to be the bearers of his despatches.
On the 11th, he was so well as to mount on horseback and take a
survey of the adjacent country, but from the delay occasioned by the
unwillingness of the king to allow him to depart, it was not till the 17th
of September that he finally quitted Falaba in order to return to Sierra
Leone; having resided in the Soolima country more than three
months. He was on the 9th of September gratified by the return of
the messengers he had sent to Sierra Leone; he received the packet
they conveyed to him with exquisite delight; but besides the kind
letters of his friends, they sent “tobacco, sugar, a little brandy, which
soon disappeared among the Soolimas, and, though last not least,
two pairs of good shoes, a luxury to which his feet had for some time
been unaccustomed. He was also furnished, through the kindness of
Dr. Barry, staff-surgeon at Sierra Leone, with a lancet and two glass
plates of preserved vaccine virus, with which, on the 13th, he was
permitted to inoculate a number of children, commencing with those
of the king himself,” who had so much confidence in him, that Laing
says “he believed he would have permitted him to have attempted
the most extravagant experiment upon any of his own family.” If he
had possessed sufficient virus, he continues, “I might have
inoculated all the children in Falaba: the yard was absolutely
crowded with old men and women, holding young children in their
arms, and forming a group worthy of the pencil of a West or a
Rubens.” He very naturally remarks upon it as an interesting fact,
“that a nation so far in the interior of Africa, should have so readily
submitted, at the instigation of a white man, who was almost a
stranger to them, to an operation against which so much prejudice
existed for so many years in the most enlightened and civilized
countries in Europe. When the general prevalence of superstitious
fear from greegrees and fetishes is duly considered, this fact
presents a strong proof of the confidence which the natives of
Western Africa repose in the measures of white people to benefit
them; and affords a no less strong presumption, that their other
superstitious notions might soon be found to give way, in like
manner, to the labours of the missionary: and their present
barbarous habits of obtaining slaves for trade by force of arms, to the
more rational proceeding of cultivating the soil for articles of
commercial exchange.”
The day that he quitted Falaba, which, as has been already
stated, was on the 17th of September, the natives in great numbers
accompanied him for a considerable distance, the females making
most extravagant demonstrations of grief; the king accompanied him
a little farther, when a parting took place, which we shall insert in
Captain Laing’s own words, (for while at Falaba, he had received
intelligence of his promotion to the rank of captain). “At length the old
man stopped and said, he was now to see me for the last time. The
tears were in his eyes, and the power of utterance seemed to have
forsaken him for a while. Holding my hand still fast, he said ‘white
man, think of Falaba, for Falaba will always think of you: the men
laughed when you came among us, the women and children feared
and hid themselves: they all sit now with their heads in their hands,
and with tears in their eyes because you leave us. I shall remember
all you have said to me; you have told me what is good, and I know
that it will make my country great; I shall make no more slaves.’
Then squeezing me affectionately by the hand, and turning away his
head, he gently loosened his grasp, and saying, ‘Go, and return to
see us,’ he covered his face with his hands. I felt as if I had parted
from a father. Such remembrances impress themselves too deeply in
the heart to be effaced by time or distance, and establish a
permanent interest in the welfare of a country, which may have a
material influence on the after life of the individual who entertains
them.”
The route of Captain Laing and his party back to Sierra Leone
was much the same with that which they had gone when they set
out; most of the head men expressing surprise at seeing him again,
they in general supposing that he had been killed in the interior, and
on the 28th of October, he had the pleasure of being welcomed by
his friends at Sierra Leone, “so many of whom, so much esteemed,
and so highly valued, are now, alas, no more!”
On Captain Laing’s arrival at Sierra Leone, he received an order
to join his regiment on the Gold Coast, without delay, in
consequence of the hostilities which had commenced between the
British government and the king of the Ashantees.
On his arrival on the Gold Coast, he was employed in the
organization and command of a very considerable native force,
designed to be auxiliary to a small British detachment, which was
then expected from England. During the greater part of the year
1823, this native force was stationed on the frontier of the Fantee
and Ashantee countries, and was frequently engaged, and always
successfully, with detachments of the Ashantee army.
On the fall of Sir Charles M‘Carthy, which took place early in
1824, Captain Sabine, who edits the Travels, and writes the preface
from which we quote, says, “that Lieutenant-Colonel Chisholm, on
whom the command of the Gold Coast devolved, deemed it
expedient to send Captain Laing to England, for the purpose of
acquainting government, more fully than could be done by despatch,
with the existing circumstances of the command. Soon after his
arrival in England, which took place in August, he obtained a short
leave of absence to visit Scotland for the recovery of his health,
which had been seriously affected by so many months of such
constant and extreme exposure in Africa, as it is probable few
constitutions would have supported.”
He returned to London in October of the same year, where an
opportunity now presented itself which he had long anxiously
desired, of proceeding under the auspices of government, on an
expedition to discover the course and termination of the Niger. He
was now promoted to the rank of major, and departed from London
on that enterprise early in February 1825, with the intention of
leaving Tripoli, for Timbuctoo, in the course of the summer of that
year. He touched at Malta on his way to Tripoli, where he was shown
every attention by the late Marquis of Hastings, at whose table he
repeatedly dined.
While at Tripoli, he became acquainted with the British Consul,
Mr. Warrington, his business with him producing an intimacy of the
closest nature, which was farther cemented by Major Laing’s
marrying his daughter, Emma Maria Warrington, an event which took
place on the 14th of July 1825. But he had no time to spend in
domestic life: two days after marriage he set out for those vallies of
death where every preceding traveller had found a grave.
It was on the 17th of July that Major Laing left Tripoli in company
of the Sheik Babani, a highly respectable man who had resided in
Timbuctoo twenty-two years, and whose wife and children were
there still. This Sheik engaged to conduct our traveller thither in two
months and a half; and there, or at his neighbouring residence, to
deliver him over to the great Marabout Mooktar, by whose influence
he would be able to proceed farther in any direction that might be
required, according to information received as to the course of the
river. This Babani is stated by the Consul of Tripoli, to be “one of the
finest fellows, with the best tempered and most prepossessing
countenance that he ever beheld; Laing, in all his letters, speaks of
him in the highest terms of respect and approbation. As the Gharan
mountains were rendered impassable by the defection of a rebellious
chief of the Bashaw, who had taken possession of all the passes, the
small koffila of Babani took the route of Beneoleed. On the 21st of
August they reached Shaté, and, on the 13th of September, arrived
safely at Ghadamis, after a “tedious and circuitous journey of nearly
a thousand miles.” In the course of this journey, Laing reports the
destruction of all his instruments from the heat of the weather, and
the jolting of the camels; his barometers broken; his hygrometers
rendered useless from the evaporation of the ether; the tubes of
most of his thermometers snapt by the warping of the ivory; the glass
of the artificial horizon so dimmed by the friction of sand which
insinuated itself everywhere, as to render an observation difficult and
troublesome; his chronometer stopt, owing, he says, to the extremes
of heat and cold, but more probably to the jolting, or the insinuation
of sandy particles; and to wind up the catalogue of his misfortunes,
the stock of his rifle broken by the great gouty foot of a camel
treading upon it. The range of the thermometer in the desert, was
from 120° about the middle of the day, to 75°-68°, and once or twice
to 62° an hour or two before sunrise, at which time was observable a
great incrustation of nitre on the ground, which is the common
appearance on the surface of all the known deserts of Africa, from
Tripoli to the Cape of Good Hope.
When Major Laing reached Ghadamis, he discovered that his
companion, the Sheik Babani, was governor of the town. He
considered him a person of sterling worth, with a quiet, inoffensive,
unobtrusive character, though at the same time not deficient in
decision, but never once suspected him to be a person of so much
importance and influence as he all at once discovered him to be. The
Sheik immediately lodged him in one of his own houses, with a large
garden, and yard for his camels, which were fed at the expense of
the governor. Ghadamis is a place of considerable trade; all the
koffilas to and from Soudan passing through it. The citizens pay
tribute to the Tuaric who inhabit the great Sahara or desert on the
western side of Africa for permission to their koffilas to pass without
being subjected to plunder. The town contains six or seven thousand
inhabitants.
Major Laing left Ghadamis on the 27th of October, and arrived at
Ensala on the 3d of December. Ensala is the most eastern town in
the province of Tuat, and belongs to the Tuaric: it is considered to be
thirty-five days journey distant from Timbuctoo. As he approached
this city, some thousands of people, of all ages, came out to meet
this Christian traveller. Nothing could exceed the kindness and
hospitality with which they received him, and Major Laing returned it,
by patiently listening to their complaints, and administering medicine
to their diseases to the best of his ability.
The koffila left Ensala on the 10th of January 1826, and on the
26th of the same month entered upon the desert of Tenezarof, about
twenty journies from Timbuctoo, a mere desert of sand, perfectly flat,
and quite destitute of all verdure. Major Laing, at this time was still
an enthusiast in his expedition, and, possessed of good health and
spirits, experiencing everywhere, from every person, nothing but
good will, kindness, and hospitality. He particularly mentions the
services of Hatteta, the Tuaric who had accompanied him thither; he
also speaks of the sheik Babani, who, he says, continued “to watch
over him with the solicitude of a father.” Shortly after the arrival of a
letter with these accounts from Tenezarof, reports reached Tripoli,
that the koffila had been attacked by robbers; that the Major’s
servant, as well as some others, had been killed, and he himself
wounded; at the same time adding, that he had effected his escape
to the Marabout Mooktar, who usually resided at a spot only five
days journey distant from Timbuctoo. These reports, though they
created some uneasiness, were not believed, till a letter was
received at Tripoli by Mrs. Laing, indirectly tending to confirm them.
She received it on the 20th of September 1826: it was written from
the desert of Tenezarof. The following extract is what appears to
refer to the circumstances which raised the reports.
“I take the advantage of a Tuaric going to Tuat, to acquaint you,
that I am safe and in perfect health, and completely recovered from
the trifling indisposition which annoyed me on leaving that place. If it
pleases God I shall be in Timbuctoo in less than twenty days, and in
two months afterwards I hope to find my way to some part of the
coast. I have met with much annoyance from the Tuaric; few, very
few of whom are like Hatteta, and are not, as the consul anticipated,
our friends. You shall know all particulars from me on my arrival at
Timbuctoo, from whence I shall lose no time in addressing you. I
have stopped in the sun to write; pray excuse it, for I am in great
haste, and I write with only a thumb and a finger, having a very
severe cut on my fore finger.”
This cut probably refers to the wounds he had received, but which
he did not wish to mention in a more serious manner.

You might also like