Learn Kotlin for Android Development: The Next Generation Language for Modern Android Apps Programming 1st Edition Peter Späthpdf download
Learn Kotlin for Android Development: The Next Generation Language for Modern Android Apps Programming 1st Edition Peter Späthpdf download
https://ebookmeta.com/product/learn-kotlin-for-android-
development-the-next-generation-language-for-modern-android-apps-
programming-1st-edition-peter-spath/
https://ebookmeta.com/product/learn-android-studio-3-with-kotlin-
efficient-android-app-development-1st-edition-ted-hagos/
https://ebookmeta.com/product/pro-android-with-kotlin-developing-
modern-mobile-apps-with-kotlin-and-jetpack-2nd-edition-peter-
spath/
https://ebookmeta.com/product/android-studio-electric-eel-
essentials-kotlin-edition-developing-android-apps-using-android-
studio-2022-1-1-and-kotlin-neil-smyth/
https://ebookmeta.com/product/positive-aspects-of-animal-welfare-
silvana-mattiello-editor/
Seizure and Epilepsy Care: The Pocket Epileptologist
1st Edition Patrick Landazuri
https://ebookmeta.com/product/seizure-and-epilepsy-care-the-
pocket-epileptologist-1st-edition-patrick-landazuri/
https://ebookmeta.com/product/the-pucking-wrong-number-the-
pucking-wrong-1-1st-edition-c-r-jane/
https://ebookmeta.com/product/the-gift-of-death-literature-in-
secret-second-edition-jacques-derrida/
https://ebookmeta.com/product/speak-up-an-illustrated-guide-to-
public-speaking-douglas-m-fraleigh/
https://ebookmeta.com/product/psycho-nationalism-global-thought-
iranian-imaginations-1st-edition-arshin-adib-moghaddam/
Lark Kasim Start a Revolution 1st Edition Kacen
Callender
https://ebookmeta.com/product/lark-kasim-start-a-revolution-1st-
edition-kacen-callender/
Peter Spä th
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.
Note Making your code expressive from the very beginning will
not only help you to write good code, it will also help you to develop
your programming skills beyond average. Expressive code is easier
to maintain and extend, easier to reuse, easier to understand for
others, and easier to debug if the program shows some deficiencies.
If you run this, it will print the text Green Gray on two lines of the
console. With the notion of parameters being placed inside round
brackets, you should be able to understand this snippet without
knowing a single Kotlin idiom.
Note Don’t worry if you don’t know how to write and run this, we’ll
be getting our feet wet very soon in the first chapter of the book.
Once you reach the end of the book, you should be an advanced
developer able to address problems in the Kotlin language, with
particular attention on Android matters. Of course, you will not know
all possible libraries that are out there in the wild for solving specific
problems, as only experience will help you there. Knowing most of the
language constructs and having good ideas concerning programming
techniques, however, will set you on the way to become an expert
programmer for Android.
The Kotlin version referred to in this book is 1.3. Most of the
examples and most of what gets explained here is likely valid for later
versions as well.
Source Code
All source code shown or referred to in this book can be found at
https://github.com/Apress/learn-kotlin-for-
android-development
It was scarcely light when the rector of Saint David's rose from a
couch where visions of a most voluptuous nature had filled his sleep.
Having hastily dressed himself, he descended from his room with
the intention of seeking the fine frosty air of the garden to cool his
heated brain.
But as he proceeded along a passage leading to the landing of the
first flight of stairs, he heard a light step slowly descending the
upper flight; and the next moment, the voice of Ellen speaking
fondly to her child, fell upon his ear.
For nurses and mothers will talk to babes of even a few months
old—although the innocents comprehend them not!
Reginald stepped into the recess formed by the door of one of the
bed-chambers in that spacious mansion; and scarcely had he
concealed himself there when he saw Ellen, with the child in her
arms, pass across the landing at the end of the passage, and enter a
room on the other side.
She wore a loose dressing-gown of snowy whiteness, which was
confined by a band round her delicate waist, and was fastened up to
the throat: her little feet had been hastily thrust into a pair of buff
morocco slippers; and her long shining hair flowed over her
shoulders and down her back.
The licentious eyes of the clergyman followed her from the foot of
the stairs to the room which she entered; and even plunged with
eager curiosity into that chamber during the moment that the door
was open as she went in.
That glance enabled him to perceive that there was a bath in the
apartment to which Ellen had proceeded with her child.
Indeed, the young lady, ever since her residence at Markham
Place, had availed herself of the luxury of the bathing-room which
that mansion possessed: and every morning she immersed her
beautiful person in the refreshing element, which she enjoyed in its
natural state in summer, but which was rendered slightly tepid for
her in winter.
When the rector beheld her descend in that bewitching negligee,
—her hair unconfined, and floating at will—her small, round,
polished ankles glancing between the white drapery and the little
slippers,—and the child, with merely a thick shawl thrown about it,
in her arms,—and when he observed the bath in that chamber which
she entered, he immediately comprehended her intention.
Without a moment's hesitation he stole softly from the recess
where he had concealed himself, and approached the door of the
bath-room.
His greedy eyes were applied to the key-hole; and his licentious
glance plunged into the depths of that sacred privacy.
The unsuspecting Ellen was warbling cheerfully to her child.
She dipped her hand into the water, which Marian had prepared
for her, and found the degree of heat agreeable to her wishes.
Then she placed the towels near the fire to warm.
Reginald watched her proceedings with the most ardent curiosity:
the very luxury of the unhallowed enjoyment which he experienced
caused an oppression at his chest; his heart beat quickly; his brain
seemed to throb with violence.
The fires of gross sensuality raged madly in his breast.
Ellen's preparations were now completed.
With her charming white hand she put back her hair from her
forehead.
Then, as she still retained the child on her left arm, with her right
hand she loosened the strings which closed her dressing-gown
round the neck and the band which confined it at the waist.
While thus occupied, she was partly turned towards the door; and
all the treasures of her bosom were revealed to the ardent gaze of
the rector.
His desires were now inflamed to that pitch when they almost
become ungovernable. He felt that could he possess that charming
creature, he would care not for the result—even though he forced
her to compliance with his wishes, and murder and suicide followed,
—the murder of her, and the suicide of himself!
He was about to grasp the handle of the door, when he
remembered that he had heard the key turn in the lock immediately
after she had entered the room.
He gnashed his teeth with rage.
And now the drapery had fallen from her shoulders, and the whole
of her voluptuous form, naked to the waist, was exposed to his view.
He could have broken down the door, had he not feared to alarm
the other inmates of the house.
He literally trembled under the influence of his fierce desires.
How he envied—Oh! how he envied the innocent babe which the
fond mother pressed to that bosom—swelling, warm, and glowing!
And now she prepared to step into the bath: but, while he was
waiting with fervent avidity for the moment when the whole of the
drapery should fall from her form, a step suddenly resounded upon
the stairs.
He started like a guilty wretch away from the door: and,
perceiving that the footsteps descended the upper flight, he
precipitated himself down the stairs.
Rushing across the hall, he sought the garden, where he
wandered up and down, a thousand wild feelings agitating his
breast.
He determined that Ellen should be his; but he was not collected
enough to deliberate upon the means of accomplishing his
resolution,—so busy was his imagination in conjuring up the most
voluptuous idealities, which were all prompted by the real scene the
contemplation whereof had been interrupted.
He fancied that he beheld the lovely young mother immersed in
the bath—the water agitated by her polished limbs—each ripple
kissing some charm, even as she herself kissed her babe!
Then he imagined he saw her step forth like a Venus from the
ocean—her cheeks flushed with animation—her long glossy hair
floating in rich undulations over her ivory shoulders.
"My God!" he exclaimed, at length, "I shall grow mad under the
influence of this fascination! One kiss from her lips were worth ten
thousand of the meretricious embraces which Cecilia yields so
willingly. Oh! Ellen would not surrender herself without many prayers
—much entreaty—and, perhaps, force;—but Cecilia falls into my
arms without a struggle! Enjoyment with her is not increased by
previous bashfulness;—she does not fire the soul by one moment of
resistance. But Ellen—so coy, so difficult to win,—so full of
confidence in herself, in spite of that one fault which accident
betrayed to me,—Ellen, so young and inexperienced in the ways of
passion,—Oh! she were a conquest worth every sacrifice that man
could make!"
The rector's reverie was suddenly interrupted by the voice of
Whittingham summoning him to the breakfast-room.
Thither he proceeded; and there Ellen, now attired in a simple but
captivating morning-dress, presided.
Little did she imagine that the privacy of her bath had been
invaded—violated by the glance of that man who now seated himself
next to her, and whose sanctity was deemed to be above all
question.
Little, either, did her father and friend suppose that there was one
present who had vowed that she should be his, and who, in
connection with that determination, had entertained no thought of
marriage.
The ramble in the garden had so far cooled the rector's brain, that
nothing in his behaviour towards Ellen was calculated to excite
observation; but, from time to time, when unperceived, he cast upon
her a glance of fervent admiration—a long, fixed, devouring glance,
which denoted profound passion.
At length the hour for departure arrived; and his carriage drove
round to the front door.
The rain of the preceding evening had changed to frost during the
night;—the morning was fine, fresh, and healthy, though intensely
cold; there was hence no shadow of an excuse for a longer stay.
The rector expressed his thanks for the hospitality which he had
experienced, with that politeness which so eminently characterised
his manners; and when he shook hands with Ellen, he pressed hers
gently.
She thought that he intended to convey a sort of assurance that
the secret which he had detected on the previous day, was sacred
with him; and she cast upon him a rapid glance, expressive of
gratitude.
Reginald then stepped into the carriage, which immediately rolled
rapidly away towards London.
Upon his arrival at home, he proceeded straight to his study,
whither he was immediately followed by the old housekeeper.
"Leave me—leave me, Mrs. Kenrick," said the rector; "I wish to be
alone."
"I thought something had happened, sir," observed the old
woman, fidgetting about the room, for with senile pertinacity she
was resolved to say what she had upon her mind: "I thought so,"
she continued, "because this is the first time you ever stayed out all
night without sending me word what kept you."
"I am not aware that I owe you an account of my actions, Mrs.
Kenrick," said the rector, who, like all guilty persons, was half afraid
that his conduct was suspected by the old woman.
"Certainly not, sir; and I never asked it. But after all the years I
have been with you, and the confidence you have always reposed in
me—until within the last week or two," added the old housekeeper,
"I was afraid lest I had done something to offend you."
"No such thing," said the rector, somewhat softened. "But as the
cares of my ministry multiply upon me——"
"Ah! sir, they must have multiplied of late," interrupted the old
woman; "for you're not the same man you were."
"How do you mean?" demanded Reginald, now once more
irritated.
"You have seemed restless, unsettled, and unhappy, for some two
or three weeks past, sir," answered the housekeeper, wiping away a
tear from her eye. "And then you are not so regular in your habits as
you were: you go out and come in oftener;—sometimes you stay out
till very late; at others you come home, send me up to bed, and say
that you yourself are going to rest;—nevertheless, I hear you about
the house——"
"Nonsense!" ejaculated Reginald, struck by the imprudence of
which he had been guilty in admitting Lady Cecilia into his abode.
"Do not make yourself unhappy, Mrs. Kenrick: nothing ails me, I can
assure you. But—tell me," he added, half afraid to ask the question;
"have you heard any one else remark—I mean, make any
observation—that is, speak as you do about me——"
"Well, sir, if you wish for the truth," returned the housekeeper, "I
must say that the clerk questioned me yesterday morning about
you."
"The clerk!" ejaculated Reginald; "and what did he say?"
"Oh? he merely thought that you had something on your mind—
some annoyance which worried you——"
"He is an impertinent fellow!" cried the rector, thrown off his guard
by the alarming announcement that a change in his behaviour had
been observed.
"He only speaks out of kindness, sir—as I do," observed the
housekeeper, with a deep sigh.
"Well, well, Mrs. Kenrick," said the rector, vexed at his own
impatience: "I was wrong to mistrust the excellence of his motives.
To tell the truth, I have had some little cause of vexation—the loss
of a large sum—through the perfidy of a pretended friend—and——"
The rector floundered in the midst of his falsehood; but the old
housekeeper readily believed him, and was rejoiced to think that he
had at length honoured her with his confidence in respect to the
cause of that restlessness which she had mistaken for a secret grief.
"But no one else has made any remark, my dear Mrs. Kenrick?"
said the rector, in a tone of conciliation "I mean—no one has
questioned you—or——"
"Only Lady Cecilia Harborough sent yesterday afternoon to
request you to call upon her, sir."
"Ah!—well?"
"And of course I said to her servant-maid that you were not at
home. She came back in the evening, and seemed much
disappointed that you were still absent. Then she returned again,
saying that her mistress was ill and wished to consult you upon
business."
"And what did you tell her, Mrs. Kenrick?"
"That you had not returned, sir," answered the housekeeper,
surprised at the question, as if there were any thing else to tell save
the truth. "The servant-maid seemed more and more disappointed,
and called again as early as eight o'clock this morning."
"This morning!" echoed Reginald, seriously annoyed at this
repetition of visits from Lady Cecilia's confidential servant.
"Yes, sir; and when I said that you had not been home all night,
she appeared quite surprised," continued the housekeeper.
"And you told her that I had not been home all night?" mused
Reginald. "What must Lady Cecilia think?"
"Think, sir?" cried the housekeeper, more surprised still at her
master's observations. "You can owe no account of your actions, sir,
to Lady Cecilia Harborough."
"Oh! no—certainly not," stammered the rector, cruelly
embarrassed: "I only thought that evil tongues——"
"The Reverend Reginald Tracy is above calumny," said the
housekeeper, who was as proud of her master as she was attached
to him.
"True—true, Mrs. Kenrick," exclaimed the rector. "And yet—but,
after all no matter. I will go and call in Tavistock Square at once; and
then I can explain——"
Up to this moment the housekeeper had spoken in the full
conviction that annoyance alone was the cause of her master's
recent change of behaviour and present singularity of manners; but
his increasing embarrassment—the strangeness of his observations
relative to Lady Cecilia—his anxiety lest she should entertain an evil
idea concerning his absence from home,—added to a certain vague
rumour which had reached her ears relative to the lightness of that
lady's character,—all these circumstances, united with the fact of
Cecilia having sent so often to request Mr. Tracy to call upon her,
suddenly engendered a suspicion of the truth in the housekeeper's
mind.
"Before you go out again, sir," said the housekeeper, wishing to
discard that suspicion, and therefore hastening to change the
conversation to another topic, "I should mention to you that
yesterday afternoon—between one and two o'clock—Katherine
Wilmot arrived here——"
"Indeed! What, so soon?" exclaimed the rector.
"And as she assured me that you had only a few hours before
offered her a situation in your household," continued Mrs. Kenrick, "I
did not hesitate to take her in. Besides, she is a good girl, and I am
not sorry that she should leave her uncle's roof."
"Then you approve of my arrangement, Mrs. Kenrick?" said
Reginald.
"Certainly, sir—if I have the right to approve or disapprove,"
answered the old lady, who, in spite of the natural excellence of her
heart, was somewhat piqued at not having been previously
consulted upon the subject: then, ashamed of this littleness of
feeling, she hastily added, "But the poor girl has a sad story to tell,
sir, about the way in which she left her uncle; and, with your
permission, I will send her up to you."
"Do so," said the rector, not sorry to be relieved of the presence of
his housekeeper, in whose manner his guilty conscience made him
see a peculiarity which filled his mind with apprehension.
In a few minutes Katherine Wilmot entered the rector's study.
Her story was brief but painful.
"After you left, sir, I sate thinking upon your very great kindness
and that of Mr. Markham, and how happy I should be to have an
opportunity of convincing you both that I was anxious to deserve all
you proposed to do for me. The hours slipped away; and for the first
time I forgot to prepare my uncle's dinner punctually to the minute.
I know that I was wrong, sir—but I had so much to think about,
both past and future! Well, sir, one o'clock struck; and nothing was
ready. I started up, and did my best. But in a few minutes my uncle
and cousin came in. My uncle, sir, was rather cross—indeed, if I
must speak the truth, very cross; because his son had absolutely
refused to assist him in his morning's work. I need not say, sir,"
continued the girl, with a shudder, "what that work was. The first
thing my uncle did was to ask if his dinner was ready? I told him the
whole truth, but assured him that not many minutes would elapse
before it would be ready. You do not want to know, sir, all he said to
me; it is quite sufficient to say that he turned me out of doors. I
cried, and begged very hard to part from him in friendship—for, after
all, sir, he is my nearest relation on the face of the earth—and, then,
he brought me up! But he closed the door, and would not listen to
me."
Katherine ceased, and wiped her eyes.
The poor girl had said nothing of the terrific beating which the
executioner inflicted upon Gibbet the moment they returned home,
and then upon Katherine herself before he thrust her out of the
house.
"Have you brought away your mother's letter with you,
Katherine?" inquired the rector, who during the maiden's simple
narrative, had never taken his eyes off her.
"My uncle sent round all my things in the evening, by my
unfortunate cousin," replied Katherine; "and amongst the rest, my
work-box where I keep the letter. It is safe in my possession, sir."
"Take care of it, Kate," observed the rector; "who knows but that
it may some day be of service?"
"Oh! sir, and even if it should not," ejaculated the girl, "it is at all
events the only memento I possess of my poor mother."
"True—you told me so," said Reginald, prolonging the conversation
only because the presence of an interesting female had become his
sole enjoyment. "And now, my dear," continued the rector, rising
from his seat, and approaching her, "be steady—conduct yourself
well—and you will find me a good master."
"I will not be ungrateful, sir," returned Katherine.
"And you must endeavour to relieve Mrs. Kenrick of all onerous
duties as much as possible," said the rector. "Thus, you had better
always answer my bell yourself, when the footman is not in the
way."
"I will make a point of doing so, sir," was the artless reply.
The rector gave some more trivial directions, and dismissed his
new domestic to her duties.
He then hastened to Tavistock Square, to appease Lady
Harborough, whose jealousy, he suspected, had been aroused by his
absence from home.
CHAPTER CXLVII.
On the morning after she had received the visit from the Reverend
Reginald Tracy, the old hag rose early, muttering to herself, "I must
lose no time—I must lose no time."
She then proceeded to dress herself in her holiday attire, each
article of which was purchased with the wages of her infamous
trade.
Female frailty—female shame had clothed the hag: female
dishonour had produced her a warm gown, a fine shawl, and a new
bonnet.
When she was young she had lived by the sale of herself: now
that she was old she lived by the sale of others.
And she gloried in all the intrigues which she successfully worked
out for those who employed her, as much as a sharp diplomatist
triumphs in outwitting an astute antagonist.
It is said that when Perseus carried the hideous head of the
Gorgon Medusa through the air, the gore which dripped from it as he
passed over the desert of Libya turned into frightful serpents: so
does the moral filth which the corruption of great cities distils,
engender grovelling and venomous wretches like that old hag.
Well—she dressed herself in her best attire, and contemplated
herself with satisfaction in a little mirror cracked all across.
Then, having partaken of a hearty breakfast, she sallied forth.
By means of a public conveyance she soon reached the vicinity of
Markham Place.
She had never been in that neighbourhood before; and when she
beheld the spacious mansion, with its heavy but imposing
architecture, she muttered to herself, "She is well lodged—she is well
lodged!"
The hag then strolled leisurely round Richard's miniature domain,
debating within herself whether she should knock boldly at the front
door and inquire for Miss Monroe, or wait in the neighbourhood to
see if that young lady might chance to walk out alone.
The day was fine, though cold; and the hag accordingly resolved
to abide by the latter alternative.
Perceiving a seat upon the summit of the hill, whereon stood the
two trees, she opened the gate at the foot of the path which led to
the top.
Then she toiled up the hill, and seated herself between the two
ash trees—now denuded of their foliage.
Presently, as her eyes wandered hither and thither, they fell upon
the inscriptions engraved on the stem of one of the trees. Thus they
stood:—
Eugene.
Eugene.