Android Studio Arctic Fox Essentials Java Edition Developing Android Apps Using Android Studio 202031 And Java 1st Edition Neil Smyth pdf download
Android Studio Arctic Fox Essentials Java Edition Developing Android Apps Using Android Studio 202031 And Java 1st Edition Neil Smyth pdf download
Figure 2-1
To install the package, simply drag the Android Studio icon and drop it onto
the Applications folder. e Android Studio package will then be installed
into the Applications folder of the system, a process which will typically take
a few seconds to complete.
To launch Android Studio, locate the executable in the Applications folder
using a Finder window and double-click on it.
For future easier access to the tool, drag the Android Studio icon from the
Finder window and drop it onto the dock.
2.3.3 Installation on Linux
Having downloaded the Linux Android Studio package, open a terminal
window, change directory to the location where Android Studio is to be
installed and execute the following command:
unzip /<path to package>/android-studio-ide-<version>-
linux.zip
Note that the Android Studio bundle will be installed into a sub-directory
named android-studio. Assuming, therefore, that the above command was
executed in /home/demo, the so ware packages will be unpacked into
/home/demo/android-studio.
To launch Android Studio, open a terminal window, change directory to the
android-studio/bin sub-directory and execute the following command:
./studio.sh
When running on a 64-bit Linux system, it will be necessary to install some
32-bit support libraries before Android Studio will run. On Ubuntu these
libraries can be installed using the following command:
sudo apt-get install libc6:i386 libncurses5:i386
libstdc++6:i386 lib32z1 libbz2-1.0:i386
On Red Hat and Fedora based 64-bit systems, use the following command:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-
libs.i686
2.4 e Android Studio Setup Wizard
If you are installing Android Studio for the rst time the initial dialog that
appears once the setup process starts may resemble that shown in Figure 2-2
below:
Figure 2-2
If this dialog appears, click the Next button to display the SDK Components
Setup dialog (Figure 2-3). Within this dialog, make sure that the Android
SDK option is selected along with the latest API package before clicking on
the Next button:
Figure 2-3
A er clicking Next, Android Studio will download and install the Android
SDK and tools.
If you have previously installed an earlier version of Android Studio, the rst
time that this new version is launched, a dialog may appear providing the
option to import settings from a previous Android Studio version. If you
have settings from a previous version and would like to import them into
the latest installation, select the appropriate option and location.
Alternatively, indicate that you do not need to import any previous settings
and click on the OK button to proceed.
A er these initial setup steps have been taken, click the Finish button to
display the Welcome to Android Studio screen:
Figure 2-4
2.5 Installing Additional Android SDK Packages
e steps performed so far have installed the Android Studio IDE and the
current set of default Android SDK packages. Before proceeding, it is worth
taking some time to verify which packages are installed and to install any
missing or updated packages.
is task can be performed by clicking on the More Actions link in the
within the welcome dialog and selecting the SDK Manager option from the
drop down menu. Once invoked, the Android SDK screen of the Preferences
dialog will appear as shown in Figure 2-5:
Figure 2-5
Immediately a er installing Android Studio for the rst time it is likely that
only the latest released version of the Android SDK has been installed. To
install older versions of the Android SDK simply select the checkboxes
corresponding to the versions and click on the Apply button.
Most of the examples in this book will support older versions of Android as
far back as far as Android 8.0 (Oreo). is is to ensure that the apps run on a
wide range of Android devices. Within the list of SDK versions, enable the
checkbox next to Android 8.0 (Oreo) and click on the Apply button. In the
resulting con rmation dialog click on the OK button to install the SDK.
Subsequent dialogs will seek acceptance of licenses and terms before
performing the installation. Click Finish once the installation is complete.
It is also possible that updates will be listed as being available for the latest
SDK. To access detailed information about the packages that are available
for update, enable the Show Package Details option located in the lower
right-hand corner of the screen. is will display information similar to that
shown in Figure 2-6:
Figure 2-6
e above gure highlights the availability of an update. To install the
updates, enable the checkbox to the le of the item name and click on the
Apply button.
In addition to the Android SDK packages, a number of tools are also
installed for building Android applications. To view the currently installed
packages and check for updates, remain within the SDK settings screen and
select the SDK Tools tab as shown in Figure 2-7:
Figure 2-7
Within the Android SDK Tools screen, make sure that the following
packages are listed as Installed in the Status column:
•Android SDK Build-tools
•Android Emulator
•Android SDK Platform-tools
•Google Play Services
•Intel x86 Emulator Accelerator (HAXM installer)
•Google USB Driver (Windows only)
•Layout Inspector image server
Note the Intel x86 Emulator Accelerator (HAXM installer) cannot be
installed on Apple silicon-based Macs.
In the event that any of the above packages are listed as Not Installed or
requiring an update, simply select the checkboxes next to those packages
and click on the Apply button to initiate the installation process. If the
HAXM emulator settings dialog appears, select the recommended memory
allocation:
Figure 2-8
Once the installation is complete, review the package list and make sure that
the selected packages are now listed as Installed in the Status column. If any
are listed as Not installed, make sure they are selected and click on the Apply
button again.
2.6 Making the Android SDK Tools Command-line
Accessible
Most of the time, the underlying tools of the Android SDK will be accessed
from within the Android Studio environment. at being said, however,
there will also be instances where it will be useful to be able to invoke those
tools from a command prompt or terminal window. In order for the
operating system on which you are developing to be able to nd these tools,
it will be necessary to add them to the system’s PATH environment variable.
Regardless of operating system, the PATH variable needs to be con gured to
include the following paths (where <path_to_android_sdk_installation>
represents the le system location into which the Android SDK was
installed):
<path_to_android_sdk_installation>/sdk/tools
<path_to_android_sdk_installation>/sdk/tools/bin
<path_to_android_sdk_installation>/sdk/platform-tools
e location of the SDK on your system can be identi ed by launching the
SDK Manager and referring to the Android SDK Location: eld located at the
top of the settings panel as highlighted in Figure 2-9:
Figure 2-9
Once the location of the SDK has been identi ed, the steps to add this to the
PATH variable are operating system dependent:
2.6.1 Windows 8.1
1. On the start screen, move the mouse to the bottom right-hand corner of
the screen and select Search from the resulting menu. In the search box,
enter Control Panel. When the Control Panel icon appears in the results
area, click on it to launch the tool on the desktop.
2. Within the Control Panel, use the Category menu to change the display to
Large Icons. From the list of icons select the one labeled System.
3. In the Environment Variables dialog, locate the Path variable in the
System variables list, select it and click on the Edit… button. Using the
New button in the edit dialog, add three new entries to the path. For
example, assuming the Android SDK was installed into
C:\Users\demo\AppData\Local\Android\Sdk, the following entries would
need to be added:
C:\Users\demo\AppData\Local\Android\Sdk\platform-tools
C:\Users\demo\AppData\Local\Android\Sdk\tools
C:\Users\demo\AppData\Local\Android\Sdk\tools\bin
4. Click on OK in each dialog box and close the system properties control
panel.
Open the command prompt window (move the mouse to the bottom right-
hand corner of the screen, select the Search option and enter cmd into the
search box). Select Command Prompt from the search results.
Within the Command Prompt window, enter:
echo %Path%
e returned path variable value should include the paths to the Android
SDK platform tools folders. Verify that the platform-tools value is correct by
attempting to run the adb tool as follows:
adb
e tool should output a list of command line options when executed.
Similarly, check the tools path setting by attempting to run the AVD
Manager command line tool (don’t worry if the avdmanager tool reports a
problem with Java - this will be addressed later):
avdmanager
In the event that a message similar to the following message appears for one
or both of the commands, it is most likely that an incorrect path was
appended to the Path environment variable:
'adb' is not recognized as an internal or external
command,
operable program or batch file.
2.6.2 Windows 10
Right-click on the Start menu, select Settings from the resulting menu and
enter “Edit the system environment variables” into the Find a setting text
eld. In the System Properties dialog, click the Environment Variables...
button. Follow the steps outlined for Windows 8.1 starting from step 3.
2.6.3 Linux
On Linux, this con guration can typically be achieved by adding a
command to the .bashrc le in your home directory (speci cs may di er
depending on the particular Linux distribution in use). Assuming that the
Android SDK bundle package was installed into /home/demo/Android/sdk,
the export line in the .bashrc le would read as follows:
export PATH=/home/demo/Android/sdk/platform-
tools:/home/demo/Android/sdk/tools:/home/demo/Android/sdk/
tools/bin:/home/demo/android-studio/bin:$PATH
Note also that the above command adds the android-studio/bin directory to
the PATH variable. is will enable the studio.sh script to be executed
regardless of the current directory within a terminal window.
2.6.4 macOS
A number of techniques may be employed to modify the $PATH
environment variable on macOS. Arguably the cleanest method is to add a
new le in the /etc/paths.d directory containing the paths to be added to
$PATH. Assuming an Android SDK installation location of
/Users/demo/Library/Android/sdk, the path may be con gured by creating a
new le named android-sdk in the /etc/paths.d directory containing the
following lines:
/Users/demo/Library/Android/sdk/tools
/Users/demo/Library/Android/sdk/tools/bin
/Users/demo/Library/Android/sdk/platform-tools
Note that since this is a system directory it will be necessary to use the sudo
command when creating the le. For example:
sudo vi /etc/paths.d/android-sdk
2.7 Android Studio Memory Management
Android Studio is a large and complex so ware application that consists of
many background processes. Although Android Studio has been criticized
in the past for providing less than optimal performance, Google has made
signi cant performance improvements in recent releases and continues to
do so with each new version. Part of these improvements include allowing
the user to con gure the amount of memory used by both the Android
Studio IDE and the background processes used to build and run apps. is
allows the so ware to take advantage of systems with larger amounts of
RAM.
If you are running Android Studio on a system with su cient unused RAM
to increase these values (this feature is only available on 64-bit systems with
5GB or more of RAM) and nd that Android Studio performance appears to
be degraded it may be worth experimenting with these memory settings.
Android Studio may also notify you that performance can be increased via a
dialog similar to the one shown below:
Figure 2-10
To view and modify the current memory con guration, select the File ->
Settings... (Android Studio -> Preferences... on macOS) menu option and, in
the resulting dialog, select the Memory Settings option listed under System
Settings in the le -hand navigation panel as illustrated in Figure 2-11 below.
When changing the memory allocation, be sure not to allocate more
memory than necessary or than your system can spare without slowing
down other processes.
Figure 2-11
2.8 Updating Android Studio and the SDK
From time to time new versions of Android Studio and the Android SDK
are released. New versions of the SDK are installed using the Android SDK
Manager. Android Studio will typically notify you when an update is ready
to be installed.
To manually check for Android Studio updates, use the Help -> Check for
Updates... menu option from the Android Studio main window (Android
Studio -> Check for Updates... on macOS).
2.9 Summary
Prior to beginning the development of Android based applications, the rst
step is to set up a suitable development environment. is consists of the
Android SDKs and Android Studio IDE (which also includes the OpenJDK
development environment). In this chapter, we have covered the steps
necessary to install these packages on Windows, macOS and Linux.
3. Creating an Example Android App in Android
Studio
e preceding chapters of this book have covered the steps necessary to
con gure an environment suitable for the development of Android
applications using the Android Studio IDE. Before moving on to slightly
more advanced topics, now is a good time to validate that all of the required
development packages are installed and functioning correctly. e best way
to achieve this goal is to create an Android application and compile and run
it. is chapter will cover the creation of an Android application project
using Android Studio. Once the project has been created, a later chapter will
explore the use of the Android emulator environment to perform a test run
of the application.
3.1 About the Project
e project created in this chapter takes the form of a rudimentary currency
conversion calculator (so simple, in fact, that it only converts from dollars to
euros and does so using an estimated conversion rate). e project will also
make use of one of the most basic of Android Studio project templates. is
simplicity allows us to introduce some of the key aspects of Android app
development without overwhelming the beginner by trying to introduce too
many concepts, such as the recommended app architecture and Android
architecture components, at once. When following the tutorial in this
chapter, rest assured that all of the techniques and code used in this initial
example project will be covered in much greater detail in later chapters.
3.2 Creating a New Android Project
e rst step in the application development process is to create a new
project within the Android Studio environment. Begin, therefore, by
launching Android Studio so that the “Welcome to Android Studio” screen
appears as illustrated in Figure 3-1:
Figure 3-1
Once this window appears, Android Studio is ready for a new project to be
created. To create the new project, simply click on the New Project option to
display the rst screen of the New Project wizard.
3.3 Creating an Activity
e rst step is to de ne the type of initial activity that is to be created for
the application. Options are available to create projects for Phone and
Tablet, Wear OS, TV, Android Audio or Android ings. A range of
di erent activity types is available when developing Android applications,
many of which will be covered extensively in later chapters. For the purposes
of this example, however, simply select the Phone and Tablet option from the
Templates panel followed by the option to create an Empty Activity. e
Empty Activity option creates a template user interface consisting of a single
TextView object.
Figure 3-2
With the Empty Activity option selected, click Next to continue with the
project con guration.
3.4 De ning the Project and SDK Settings
In the project con guration window (Figure 3-3), set the Name eld to
AndroidSample. e application name is the name by which the application
will be referenced and identi ed within Android Studio and is also the name
that would be used if the completed application were to go on sale in the
Google Play store.
e Package name is used to uniquely identify the application within the
Android application ecosystem. Although this can be set to any string that
uniquely identi es your app, it is traditionally based on the reversed URL of
your domain name followed by the name of the application. For example, if
your domain is www.mycompany.com, and the application has been named
AndroidSample, then the package name might be speci ed as follows:
com.mycompany.androidsample
If you do not have a domain name you can enter any other string into the
Company Domain eld, or you may use example.com for the purposes of
testing, though this will need to be changed before an application can be
published:
com.example.androidsample
e Save location setting will default to a location in the folder named
AndroidStudioProjects located in your home directory and may be changed
by clicking on the folder icon to the right of the text eld containing the
current path setting.
Set the minimum SDK setting to API 26: Android 8.0 (Oreo). is is the
minimum SDK that will be used in most of the projects created in this book
unless a necessary feature is only available in a more recent version. e
objective here is to build an app using the latest Android SDK, while also
retaining compatibility with devices running older versions of Android (in
this case as far back as Android 8.0). e text beneath the Minimum SDK
setting will outline the percentage of Android devices currently in use on
which the app will run. Click on the Help me choose button (highlighted in
Figure 3-3) to see a full breakdown of the various Android versions still in
use:
Figure 3-3
Finally, change the Language menu to Java and click on Finish to initiate the
project creation process.
3.5 Modifying the Example Application
At this point, Android Studio has created a minimal example application
project and opened the main window.
Figure 3-4
e newly created project and references to associated les are listed in the
Project tool window located on the le -hand side of the main project
window. e Project tool window has a number of modes in which
information can be displayed. By default, this panel should be in Android
mode. is setting is controlled by the menu at the top of the panel as
highlighted in Figure 3-5. If the panel is not currently in Android mode, use
the menu to switch mode:
Figure 3-5
3.6 Modifying the User Interface
e user interface design for our activity is stored in a le named
activity_main.xml which, in turn, is located under app -> res -> layout in the
project le hierarchy. Once located in the Project tool window, double-click
on the le to load it into the user interface Layout Editor tool which will
appear in the center panel of the Android Studio main window:
Figure 3-6
In the toolbar across the top of the Layout Editor window is a menu
(currently set to Pixel in the above gure) which is re ected in the visual
representation of the device within the Layout Editor panel. A wide range of
other device options are available for selection by clicking on this menu.
To change the orientation of the device representation between landscape
and portrait simply use the drop down menu immediately to the le of the
device selection menu showing the icon.
As can be seen in the device screen, the content layout already includes a
label that displays a “Hello World!” message. Running down the le -hand
side of the panel is a palette containing di erent categories of user interface
components that may be used to construct a user interface, such as buttons,
labels and text elds. It should be noted, however, that not all user interface
components are obviously visible to the user. One such category consists of
layouts. Android supports a variety of layouts that provide di erent levels of
control over how visual user interface components are positioned and
managed on the screen. ough it is di cult to tell from looking at the
visual representation of the user interface, the current design has been
created using a ConstraintLayout. is can be con rmed by reviewing the
information in the Component Tree panel which, by default, is located in the
lower le -hand corner of the Layout Editor panel and is shown in Figure 3-
7:
Figure 3-7
As we can see from the component tree hierarchy, the user interface layout
consists of a ConstraintLayout parent and a TextView child object.
Before proceeding, also check that the Layout Editor’s Autoconnect mode is
enabled. is means that as components are added to the layout, the Layout
Editor will automatically add constraints to make sure the components are
correctly positioned for di erent screen sizes and device orientations (a
topic that will be covered in much greater detail in future chapters). e
Autoconnect button appears in the Layout Editor toolbar and is represented
by a magnet icon. When disabled the magnet appears with a diagonal line
through it (Figure 3-8). If necessary, re-enable Autoconnect mode by
clicking on this button.
Another Random Scribd Document
with Unrelated Content
"I knew it," said Ravenel. "Now then, I am a country doctor. I can
take this young man to a plantation, and give him pure air."
"That's what you want," observed Jackson, turning to Colburne.
"Your arm don't need ice now. Water will do. Better go, I think. I'll
see that you have a month's leave of absence. Come, you can go to
Taylorsville, and still not miss a chance for fighting. Tried to send
him north," he added, addressing Ravenel. "But he's foolish about it.
Wants to see Port Hudson out—what you call a knight-errant."
Colburne was in a tremble, body and soul, at the thought of meeting
Mrs. Carter; he had never been so profoundly shaken by even the
actuality of encountering Miss Ravenel. Most of us have been in love
enough to understand all about it without explanation, and to feel no
wonder at him because, after reeling mentally this way and that, he
finally said, "I will go." Now and then there is a woman who cannot
bear to look upon the man whom she has loved and lost, and who
will turn quick corners and run down side streets to escape him,
haunting him spiritually perhaps, but bodily keeping afar from him all
her life. But stronger natures, who can endure the trial, frequently
go to meet it, and seem to find some dolorous comfort in it. As
regards Colburne, it may be that he would not have gone to
Taylorsville had he not been weak and feverish, and felt a craving for
that petting kindness which seems to be a necessity of invalids.
I doubt whether the life in Ravenel's house contributed much to
advance his convalescence. His emotions were played upon too
constantly and powerfully for the highest good of the temporarily
shattered instrument. He had supposed that he would undergo one
great shock on meeting Mrs. Carter, and that then his trouble would
be over. The first thrill was not so potent as he expected; but it was
succeeded by a constant unrest, like the burning of a slow fever; he
was uneasy all day and slept badly at night. In the house he could
not talk freely and gaily, because of Lillie's presence; and out of it he
could not feel with calmness, because he was perpetually thinking of
her. After all, it may have been the splinters of bone in the arm,
quite as much as the arrow in the heart, which worried him. Of Mrs.
Carter I must admit that she was not merciful; she made the doubly-
wounded Captain talk a great deal of his Colonel. He might recite
Carter's martial deeds and qualities as lengthily as he pleased, and
recommence da capo to recite them over again, not only without
fatiguing her, but without exciting in her mind a thought that he was
doing any thing remarkable. She was very much pleased, but she
was not a bit grateful. Why should she be! It was perfectly natural to
her mind that people should admire the Colonel, and talk much of
his glory. Colburne performed this ill-paid task with infinite patience,
sympathy, and self-sacrificing love; and no warrior was ever better
sung in conversational epics than was Carter the successful by
Colburne the disappointed. Under the rude oppression of this subject
the bruised shrub exhaled daily sweetness. It is almost painful to
contemplate these two loving hearts: the one sending its anxious
sympathies a hundred miles away into the deadly trenches of Port
Hudson; the other pouring out its sympathies for a present object,
but covertly and without a thought of reward. If the passionate
affection of the woman is charming, the unrequited, unhoping love
of the man is sublime.
The Doctor perhaps saw what Lillie could not or would not see.
"My dear," he observed, "you must remember that Colonel Carter is
not the husband of Captain Colburne."
"Oh papa!" she answered. "Do you suppose that he doesn't like to
talk about Colonel Carter? Of course he does. He admires him, and
likes him immensely."
"I dare say—I dare say. But nevertheless you give him very large
doses of your husband."
"No, papa; not too large. He is such a good friend that I am sure he
doesn't object. Just think how unkind it would be not to want to talk
about my husband. You don't understand him if you think he is so
shabby."
Nevertheless the Doctor was partially right, and shabby as it may
have been, Colburne was no better for the conversation which so
much gratified Mrs. Carter. His arm discharged its slivers of bone and
healed steadily, but he was thin and pale, slept badly, and had a
slow fever. It must not be supposed that he wilfully brooded over his
disappointment; much less that he was angry about it or felt any
desire to avenge it. He was too sensible not to struggle against
useless pinings; too gentle-hearted and honorable to be even
tempted of base or cruel spirits. Not that he was a moral miracle;
not that he was even a marvellously bright exception to the general
run of humanity; on the contrary he was like many of us, especially
when we are under the influence of elevating emotion. Some by me
forgotten author has remarked that no earthly being is purer, more
like the souls in paradise, than a young man during his first earnest
love.
At one time Colburne entirely forgot himself in his sympathy for Mrs.
Carter. When the news came of the unsuccessful and murderous
assault of the fourteenth of June, she was nearly crazy for three
days because of her uncertainty concerning the fate of her husband.
She must hear constantly from her comforters the assurance that all
was undoubtedly well; that, if the Colonel had been engaged in the
fighting, he would certainly have been named in the official report;
that, if he had received any harm, he would have been all the more
sure of being mentioned, etc., etc. Clinging as if for life to these two
men, she demanded all their strength to keep her out of the depths
of despair. Every day they went two or three times to the fort, one
or other of them, to gather information from passing boats
concerning the new tragedy. Very honestly and earnestly gratified
was Colburne when he was able to bring to Mrs. Carter a letter from
her husband, written the day after the struggle, and saying that no
harm had befallen him. How that letter was wept over, prayed over,
held to a beating heart, and then to loving lips! The house was
solemn all day with that immense and unspeakable joy.
Circumstances soon occurred which caused this lonely and anxious
family to be troubled about its own safety. To carry on the siege of
Port Hudson, Banks had been obliged to reduce the garrison of New
Orleans and of its vast exterior line of defences (a hundred miles
from the city on every side) to the lowest point consistent with
safety. Meantime Taylor reorganized the remnant of his beaten army,
raised new levies by conscription, procured reinforcements from
Texas, and resumed the offensive. Brashear City on the Atchafalaya,
with its immense mass of commissary stores, and garrison of raw
Nine Months' men, was captured by surprise. A smart little battle
was fought at Lafourche Crossing, near Thibodeaux, in which
Greene's Texans charged with their usual brilliant impetuosity, but
were repulsed by our men with fearful slaughter after a hand-to-
hand struggle over the contested cannon. Nevertheless the Union
troops soon retired before superior numbers, and Greene's wild
mounted rangers were at liberty to patrol the Lafourche Interior.
"We can't stay here long," said Colburne, in the council of war in
which the family talked these matters over. "Greene will come this
way sooner or later. If he can take Fort Winthrop, he will thereby
blockade the Mississippi, cut off Banks' supplies, and force him to
raise the siege of Port Hudson. He is sure to try it sooner or later."
"Must we leave our plantation, then?" asked Ravenel in real anguish.
To lose his home, his invested capital, pigs, chickens, prospective
crop of vegetables, and, worse yet, of enlightened and ennobled
negroes, was indeed a torturing calamity. Had he known on the
afternoon of that day, that before morning the shaggy ponies and
long, lank, dirty mosstroopers of Greene's brigade would be upon
him, he would not have paused to examine the situation from so
many different points of view. Colburne knew by experience the
celerity of Texan rangers; he had chased them in forced marches
from Brashear City to Alexandria without ever seeing a tail of their
horses; and yet even he indulged in a false security.
"I think we have twelve hours before us," he observed. "To-morrow
morning we shall have to get up and get, as the natives say. Still it's
my opinion—I don't believe Mrs. Carter had better stay here; she
ought to go to the fort to-night."
"Are you going, papa?" asked Mrs. Carter, who somehow was not
much alarmed.
"My dear, I must stay here till the last moment. We have so much
property here! You will have to go without me."
"Then I won't go," she answered; and so that was settled.
"You ought to be off," said the Doctor to Colburne. "As a United
States officer you are sure to be kept a prisoner, if taken. I certainly
think that you ought to go."
Colburne thought so too, but would not desert his friends; he
shrugged his shoulders in spirit and resolved to endure what might
come. The negroes were in a state of exquisite alarm. The entire
black population of the Lafourche Interior was making for the
swamps or other places of shelter; and only the love of the Ravenel
gang for their good massa and beautiful missus kept them from
being swept away by the contagious current. The horror with which
they regarded the possibility of being returned into slavery delighted
the Doctor, who, even in those circumstances, dilated
enthusiastically upon it as a proof that the race was capable of high
aspirations.
"They have already acquired the love of individual liberty," said this
amiable optimist. "The cognate love of liberty in the abstract, the
liberty of all men, is not far ahead of them. How superior they
already are to the white wretches who are fighting to send them
back to slavery!—Shedding blood, their own and their brothers', for
slavery! Is it not utterly amazing? Risking life and taking life to
restore slavery! It is the foolishest, wickedest, most demoniacal
infatuation that ever possessed humanity. The Inquisition, the
Massacre of St. Bartholomew, were common sense and evangelical
mercy compared to this pro-slavery rebellion. And yet these imps of
atrocity pretend to be Christians. They are the most orthodox
creatures that ever served the devil. They rant and roar in the
Methodist camp-meetings; they dogmatize on the doctrines in the
Presbyterian church; they make the responses in the Episcopal
liturgy. There is only one pinnacle of hypocrisy that they never have
had the audacity to mount. They have not yet brought themselves to
make the continuance and spread of slavery an object of prayer. It
would be logical, you know; it would be just like their impudence. I
have expected that they would come to it. I have looked forward to
the time when their hypocritical priesthood would put up bloody
hands in the face of an indignant Heaven, and say, 'O God of Justice!
O Jesus, lover of the oppressed! bless, extend and perpetuate
slavery; prosper us in selling the wife away from the husband, and
the child away from the parent; enable us to convert the blood and
tears of our fellow creatures into filthy lucre; help us to degrade
man, who was made in Thine image; and to Father, Son and Spirit
be all the Glory!'—Can you imagine anything more astoundingly
wicked than such a petition? And yet I am positively astonished that
they have not got up monthly concerts of prayer, and fabricated a
liturgy, all pregnant with just such or similar blasphemies. But God
would not wait for them to reach this acme of iniquity. His patience
is exhausted, and He is even now bringing them to punishment."
"They have some power left yet, as we feel to-night," said Colburne.
"Yes. I have seen an adder's head flatten and snap ten minutes after
the creature was cut in two. I dare say it might have inflicted a
poisonous wound."
"I think you had better send the hands to the fort."
"Do you anticipate such immediate danger?" inquired the Doctor, his
very spectacles expressing surprise.
"I feel uneasy every time I think of those Texans. They are fast
boys. They outmarch their own shadows sometimes, and have to
wait for them to come in after nightfall."
"I really ought to send the hands off," admitted the Doctor after a
minute of reflection. "I never could forgive myself if through my
means they should be returned to bondage."
"It would be a poor result of a freedman's labor experiment."
The Doctor went to the back door and shouted for Major Scott.
"Major," said he, "you must take all the people down to the fort as
soon as they can get ready."
"They's all ready, Marsr. They's only a waitin' for the word."
"Very well, bring them along. I'll write a note to the commandant,
asking him to take you in for the night. You can come back in the
morning if all is quiet."
"What's a gwine to come of you an' Miss Lillie?"
"Never mind that now. I will see to that presently. Bring the people
along."
In five minutes fifteen men, six women and four pickaninnies, the
whole laboring force of the plantation, were in the road before the
house, each loaded with a portion of his or her property, such as
blankets, food, and cooking utensils. The men looked anxious; the
women cried loudly with fright and grief; the pickaninnies cried
because their mothers did.
"Oh, Mars Ravenel! you'll be cotched suah," sobbed the old mamma
who did the family cooking. "Miss Lillie, do come 'long with us."
"We'se gwine to tote some o' your fixin's 'long," observed Major
Scott.
"Better let him do it," said Colburne. "It may be your only chance to
save necessaries."
So the negroes added to their loads whatever seemed most valuable
and essential of the Ravenel baggage. Then Scott received the note
to the commandant of the fort, handed it to Julius, the second boss,
and remarked with dignity, "I stays with Marsr." The Major was
undisguisedly alarmed, but he had a character to sustain, and a
military title to justify. He was immediately joined in his forlorn hope
by Jim the "no 'count nigger," who, being a sly and limber darkey,
fleet of foot, and familiar with swamp life, had a faith that he could
wriggle out of any danger or captivity.
"Keep them," said Colburne to Ravenel. "We shall want them as
look-outs during the night."
There was an evident hesitation in the whole gang as to whether
they should go or stay; but Colburne settled the question by
pronouncing in a tone of military command, "Forward, march!"
"Ah! they knows how to mind that sort o' talk," said Major Scott,
highly gratified with the spectacular nature of the scene. "I'se a
been eddycatin' 'em to millingtary ways. They knows a heap a'ready,
they doos."
He smiled with a simple and transitory joy, although he could hear
the voice of his wife (commonly called Mamma Major) rising in loud
lament amid the chorus of sorrow with which the women and
children moved away. The poor creature kept no grudge against her
husband for his infidelity of a month previous.
In the lonely and imperilled little household Colburne now took
command.
"Since you will fight," he said smiling, "you must fight under my
orders. I am the military power, and I proclaim martial law."
He forbade the Ravenels to undress; they must be prepared to run
at a moment's notice. He laughed at the Doctor's proposition to
barricade the doors and windows, and, instead thereof, opened two
or three trunks and scattered articles of little value about the rooms.
The property would be a bait, he said, which might amuse the
raiders while the family escaped. To gratify Major Scott's tremulous
enthusiasm he loaded his own revolver and the Doctor's doubled-
barreled fowling-piece, smiling sadly to himself to think how absurd
was the idea of fighting off a band of Texans with such a feeble
artillery. He posted the two negroes as a vidette a quarter of a mile
down the road, with strict orders not to build a fire, not to sleep, not
to make a noise, but in case of the approach of a party to hasten to
the house and give information. The Major begged hard for the
fowling-piece, but Colburne would not let him have it.
"He would be worse than a Nine Months' man," he said to the
Doctor. "He would be banging away at stumps and shadows all
night. There wouldn't be a living field mouse on the plantation by
morning."
The Doctor's imagination was seriously affected by these business-
like preparations, and he silently regretted that he had not gone to
the fort, or at least sent his daughter thither. Lillie, though quiet, was
very pale, and wished herself in the trenches of Port Hudson, safe
under the protection of her invincible husband. Colburne urged and
finally ordered them to lie down and try to sleep. Two mules were
standing in the yard, saddled and ready to do their part in the hegira
when it should be necessary. He examined their harness, then
returned into the house, buckled on his sword and revolver,
extinguished every light, took his seat at an open window looking
towards the danger, waited and listened. The youthful veteran was
perfectly calm; notwithstanding that he had taken more precautions
than a greenhorn, however timorous, would have thought of. Once
in each hour he visited the negroes to see if they were awake; then
mounted the levee to listen for tramp of men or horses across the
bayou; then went to the sugar-house and listened towards the
woods which backed the plantation; then resumed his silent watch
at the open window. At two o'clock the moon still poured a pale light
over the flat landscape. Colburne, feverish with fatigue, want of
sleep, and the small remainder of irritation in his wound, was just
saying to himself, "We must go to-morrow," when he saw two dark
forms glide rapidly towards the house under cover of a fence, and
rush crouching across the door-yard. Without waiting to hear what
the negroes had to say, he stepped into the parlor and awoke the
two sleepers on the sofas.
"What is the matter?" gasped the Doctor, with the wild air common
to people startled out of an anxious slumber.
"Perhaps nothing," answered Colburne. "Only be ready."
By this time the two videttes were in the house, breathless with
running and alarm.
"Oh, Cap'm! they's a comin'," whispered Scott. "They's a comin' right
smart. We heerd the hosses. They's a quarter mile off, mebbe; but
they's a comin' right smart. Oh Cap'm, please give me the double-
barril gun. I wants to fight for my liberty an' for Mars Ravenel an' for
Miss Lillie."
"Take it," said Colburne. "Now then, Doctor, you and Jim will hurry
Mrs. Carter directly down the road to the fort. Jim can keep up on
foot. The Major and I will go to the woods, fire from there, and draw
the enemy in that direction."
Every one obeyed him without a word. The approaching tramp of
horses was distinctly audible at the house when the Ravenels
mounted the mules and set off at a lumbering trot, the animals
being urged forward by resounding whacks from Jim's bludgeon.
Colburne scowled and grated his teeth with impatience and vexation.
"I ought to have sent them away last evening," he muttered with a
throb of self-reproach.
"Scott, you and I will have to fight," he said aloud. "They never can
escape unless we keep the rascals here. We must fire once from the
house; then run to the woods and fire again there. We must show
ourselves men now."
"Yes, Mars Cap'm," replied the Major. His voice was tremulous, and
his whole frame shook, but he was nevertheless ready to die, if need
be, for his liberty and his benefactors. Of physical courage the poor
fellow had little; but in moral courage he was at this moment
sublime.
Colburne posted himself and his comrade at a back corner of the
house, where they could obtain a view of the road which led toward
Thibodeaux.
"Now, Scott," he said, "you must not fire until I have fired. You must
not fire until you have taken aim at somebody. You must fire only
one barrel. Then you must make for the woods along the line of this
fence. If they follow us on horseback we can bother them by
dodging over the fence now and then. If they catch us, we must
fight as long as we can. Cheer up, old fellow. It's all right. It's not
bad business as soon as you're used to it."
"Cap'm, I'se ready," answered Scott solemnly. "I'se not gwine for ter
be cotched alive."
Then he prayed for some minutes in a low whisper, while Colburne
stood at the corner and watched. "Watch and pray," the latter
repeated to himself, smiling inwardly at the odd compliance with the
double injunction, so strangely does the mind work on such
occasions. It was not a deliberate process of intellection with him; it
was an instinctive flash of ideas, not traceable to any feeling which
was in him at the time; on the contrary, his prevailing emotion was
one of extreme anxiety. The tramp which fled toward the fort gently
diminished in the distance, while the tramp which approached from
the opposite side grew nearer and louder. When the advancing
horsemen got within a hundred yards of the house, they slackened
their pace to a walk, and finally halted, probably to listen. Some of
them must have dismounted at this time, for Colburne suddenly
beheld four footmen at the front gate. He scowled at this sign of
experienced caution, and gave a hasty glance toward the garden in
his rear, to see if others were not cutting off his retreat. He could not
discover the features of any of the four, but he could see that they
were of the tall and lank Texan type, dressed in brownish clothing,
and provided with short guns, no doubt double-barreled fowling-
pieces. Inside of the gate they halted and seemed to hearken, while
one of them pointed up the road toward the fort, and whispered to
his comrades. Colburne had hoped that they would get into the
house, and fall to plundering; but they had evidently overheard the
fugitives, for there was a simultaneous backward movement in the
group—they were going to remount and pursue. Now was his time,
if ever, to effect the proposed diversion. Aiming his six-inch revolver
at the tallest, he fired a single barrel. The man yelled a curse,
staggered, dropped his gun, and leaned against the fence. Two of
his comrades sprang across the road, and threw themselves behind
the levee as a breast-work, while the fourth, all grit, turned short
and brought his fowling-piece to a level as Colburne drew behind his
cover. In that same moment, Major Scott, wild with a sudden
madness of conflict, shouted like a lion, bounded beyond the angle
of the house, planting himself on two feet set wide apart, his mad
black face set toward the enemy, and his gun aimed. Both fired at
the same instant, and both fell together, probably alike lifeless. The
last prayer of the negro was, "My God!" and the last curse of the
rebel was "Damnation!"
By the light of the moon Colburne looked at his comrade, and saw
the brains following the blood from a hole in the centre of his
forehead. He cast a glance at the levee, fired one more barrel at a
broad-brimmed hat which rose above it, listened for a second to an
advancing rush of hoofs in order to decide whether it came by the
road or by the fields, turned, crossed the garden on a noiseless run,
placed himself on the further side of a high and close plantation-
fence, and followed its cover rapidly toward the forest. The distance
was less than a quarter of a mile, but he was quite breathless and
faint before he had traversed it, so weak was he still, and so little
accustomed to exercise. In the edge of the wood he sat down on a
fallen and mouldering trunk to listen. If the cavalry were pursuing
their course up the road, they were doing it very prudently and
slowly, for he could hear no more trampling of horses. Tolerably
satisfied as to the safety of the Ravenels, he reloaded his two empty
barrels, settled his course in his mind, and pushed as straight as he
could for Taylorsville without quitting the cover of the forest.
Although the fort was not four miles away in a direct line, it was
daybreak when he came in sight of a low flattened outline, as of a
truncated mound, which showed dimly through the yellowish
morning mist. He had still to cross a dead level of four or five
hundred yards, with no points of shelter but three small wooden
houses. At this moment, when safety seemed so near and sure, he
saw on the bayou road, two hundred yards to his right, half a dozen
black and indistinct bunches moving in a direction parallel to his
own. They were unquestionably horsemen going toward the fort,
and nearer to it than he. Changing his direction, he made straight
for the river, struck it above the fortification, and got behind the
levee, thus securing both a covered way to hide his course, and an
earthwork from behind which he could fight. He lost no time in
peeping over the top of the mound, but pushed ahead at his best
speed, supposing that no cavalry scouts would dare approach very
near to a garrison supplied with artillery. He could see a sentry
pacing the ramparts, the dark uniform showing clear against the
grey sky beyond. He even thought that the man perceived him, and
supposed that his dangers were over for the present. He was full of
exhilaration, and glanced back at the events of the night with a
sense of satisfaction, taking it all for granted with a resolute faith of
satisfaction, that the Ravenels had escaped. Major Scott was dead;
he was really quite sorry for that; but then two Texans had been
killed, or at least disabled; the war was so much nearer its close. In
a small way he felt much as a general does who has effected a
masterly retreat, and inflicted severe loss upon the pursuing enemy.
Presently a break in the bank forced him to mount the levee. As he
reached the top he stared in astonishment and some dismay at a
man in butternut-colored clothing, mounted on a rough pony, with
the double-barreled gun of Greene's mosstroopers across his saddle-
bow, who was posted on the road not forty feet distant. The
Butternut immediately said, in the pleasant way current in armies,
"Halt, you son of a bitch!"
He fired, but missed, as Colburne skirted the break on a run, and
sprang again behind the levee. The Captain then fired in return, with
no other effect than to make the Butternut gallop beyond revolver
range. From this distance he called out, ironically, "I say, Yank, have
you heard from Brashear City?"
Colburne made no reply, but continued his retreat unmolested.
When the sentinel challenged, "Halt! who comes there?" he thought
he had never heard a pleasanter welcome.
"Friend," he answered.
"Halt, friend! Corporal of the guard, number five," shouted the
sentry.
The corporal appeared, recognized Colburne, and let him in through
the gate in a palisade which connected one angle of the fort with the
river. The garrison was already under arms, and the men were lying
down behind the low works, with their equipments on and their
muskets by their sides. The first person from the plantation whom
Colburne saw was Mauma Major.
"Where is Mrs. Carter, aunty?" he asked.
"They's all here, bress the Lord! And now you's come!" shouted the
good fat creature, clapping her hands with delight. "Whar my ole
man?"
"In heaven," said Colburne, with a solemn tenderness which carried
instant conviction. The woman screamed, and went down upon her
knees with an air and face of such anguish as might cast shame
upon those philosophers as have asserted that the negro is not a
man.
"Oh! the Lord gave! The Lord gave!" she repeated, wildly.
Perhaps she had forgotten, perhaps she never knew, the remainder
of the text; but its piteous sense of bereavement, and of more than
human consolation, was evidently clear in some manner to her soul.
CHAPTER XXIII.
CAPTAIN COLBURNE COVERS THE RETREAT OF
THE SOUTHERN LABOR ORGANIZATION.
While it was still darkness Lillie was awakened from her sleep by an
all-pervading, startling, savage uproar. Through the hot night came
tramplings and yellings of a rebel brigade; roaring of twenty-four-
pounders and whirring of grape from the bastions of the fort; roaring
of hundred-pounders and flight of shrieking, cracking, flashing shells
from the gunboats; incessant spattering and fiery spitting of
musketry, with whistling and humming of bullets; and, constant
through all, the demoniac yell advancing like the howl of an infernal
tide. Bedlam, pandemonium, all the maniacs of earth and all the
fiends of hell, seemed to have combined in riot amidst the crashings
of storm and volcano. The clamor came with the suddenness and
continued with more than the rage of a tornado. Lillie had never
imagined anything so unearthly and horrible. She called loudly for
her father, and was positively astonished to hear his voice close at
her side, so strangely did the familiar tones sound in that brutal
uproar.
"What is it?" she asked.
"It must be the assault," he replied, astonished into telling the
alarming truth. "I will step out and take a look."
"You shall not," she exclaimed, clutching him. "What if you should be
hit!"
"My dear, don't be childish," remonstrated the Doctor. "It is my duty
to attend to the wounded. I am the only surgeon in the fort. Just
consider the ingratitude of neglecting these brave fellows who are
fighting for our safety."
"Will you promise not to get hurt?"
"Certainly, my dear."
"Will you come back every five minutes and let me see you?"
"Yes, my dear. I'll keep you informed of everything that happens."
She thought a few moments, and gradually loosened her hold on
him. Her curiosity, her anxiety to know how this terrible drama went
on, helped her to be brave and to spare him. As soon as her fingers
had unclosed from his sleeve he crept to where his rifle stood and
softly, seized it; and in so doing he stepped on the recumbent
Gazaway, who groaned, whereupon the Doctor politely apologized.
As he stepped out of the building he distinguished Colburne's voice
on the river front, shouting, "This way, men!" In that direction ran
the Doctor, holding his rifle in both hands, at something like the
position of a charge bayonet, with his thumb on the trigger so as to
be ready for immediate conflict. Suddenly bang! went the piece at
an angle of forty-five degrees, sending its ball clean across the
Mississippi, and causing a veteran sergeant near him to inquire
"what the hell he was about."
"Really, that explosion was quite extraordinary," said the surprised
Doctor. "I had not the least intention of firing. Would you, sir, have
the goodness to load it for me?"
But the sergeant was in a hurry, and ran on without answering. The
Doctor began to finger his cartridge-box in a wild way, intending to
get out a cartridge if he could, when a faint voice near him said, "I'll
load your gun for you, sir."
"Would you be so kind?" replied the Doctor, delighted. "I am so
dreadfully inexperienced in these operations! I am quite sorry to
trouble you."
The sick man—one of the invalids whom Gazaway had brought from
New Orleans—loaded the piece, capped it, and added some brief
instructions in the mysteries of half-cock and full-cock.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com