Android Wearable Programming Expand on your Android development capabilities by building applications for Android Wear 1st Edition Steven F. Daniel instant download
Android Wearable Programming Expand on your Android development capabilities by building applications for Android Wear 1st Edition Steven F. Daniel instant download
https://ebookgate.com/product/wearable-android-android-wear-and-
google-fit-app-development-1st-edition-sanjay-m-mishra/
ebookgate.com
https://ebookgate.com/product/professional-android-programming-with-
mono-for-android-and-net-c-1st-edition-wallace-b-mcclure/
ebookgate.com
https://ebookgate.com/product/beginning-android-web-apps-development-
develop-for-android-using-html5-css3-and-javascript-1st-edition-jon-
westfall/
ebookgate.com
https://ebookgate.com/product/android-for-beginners-all-you-need-to-
get-started-with-your-android-device-fourth-revised-edition-white/
ebookgate.com
Android Application Development Programming with the
Google SDK 1st Edition Rick Rogers
https://ebookgate.com/product/android-application-development-
programming-with-the-google-sdk-1st-edition-rick-rogers/
ebookgate.com
https://ebookgate.com/product/programming-your-home-automate-with-
arduino-android-and-your-computer-1st-edition-mike-riley/
ebookgate.com
https://ebookgate.com/product/learn-java-for-android-development-2nd-
edition-jeff-friesen/
ebookgate.com
https://ebookgate.com/product/android-application-development-
cookbook-93-recipes-for-building-winning-apps-1st-edition-wei-meng-
lee/
ebookgate.com
https://ebookgate.com/product/android-high-performance-
programming-1st-edition-enrique-lopez-manas/
ebookgate.com
www.allitebooks.com
Android Wearable
Programming
Steven F. Daniel
BIRMINGHAM - MUMBAI
www.allitebooks.com
Android Wearable Programming
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78528-015-3
www.packtpub.com
www.allitebooks.com
Credits
Reviewers Proofreader
Marcus Gabilheri Safis Editing
Andreas Göransson
Dr. Jibo He Indexer
Tejal Soni
Qian He
Jason Salas
Graphics
Jason Monteiro
Commissioning Editor
Priya Singh
Production Coordinator
Aparna Bhagat
Acquisition Editor
Vivek Anantharaman
Cover Work
Aparna Bhagat
Content Development Editor
Amey Varangaonkar
Technical Editors
Utkarsha S. Kadam
Shiny Poojary
Copy Editor
Kausambhi Majumdar
www.allitebooks.com
About the Author
He was the cofounder and Chief Technology Officer (CTO) of SoftMpire Pty Ltd., a
company that focused primarily on developing business applications for the iOS and
Android platforms.
Steven is the author of various book titles, such as Xcode 4 iOS Development Beginner's
Guide, iOS 5 Essentials, iPad Enterprise Application Development Blueprints, and
Xcode 4 Cookbook, all by Packt Publishing. You can check out his blog at http://www.
geniesoftstudios.com/blog/ or follow him on Twitter at http://twitter.com/
GenieSoftStudio.
www.allitebooks.com
Acknowledgments
No book is the product of just the author — he just happens to be the one with his
name on the cover. A number of people contributed to the success of this book and
it would take more space than I have to thank each one individually.
I would personally like to thank two special people who have been an inspiration
and who have provided me with so much support during the writing of this book:
Vivek Anantharaman, my acquisition editor, who is the reason that this book
exists, for being a wonderful guide throughout this whole process, and Amey
Varangaonkar for his understanding and support, as well as his brilliant suggestive
approaches during the chapter rewrites. Thank you for everything, guys.
Lastly, to my reviewers: thank you so much for your valuable suggestions and
improvements, making this book what it is today. I am extremely grateful to each
and every one of you.
Also, thanks to the entire Packt Publishing team for working so diligently to help
bring out a high-quality product. Finally, a big thank you to the engineers at Google
for creating the Android platform and providing developers with the tools to create
fun and sophisticated applications.
Finally, I'd like to thank all of my friends for their support, understanding, and
encouragement during the writing process. It is a privilege to know each and
every one of you.
www.allitebooks.com
About the Reviewers
www.allitebooks.com
Dr. Jibo He is currently an assistant professor at Wichita State University. He
graduated from Peking University in 2007 and the University of Illinois in 2012
with a research specialty in engineering psychology. He won the Star of Tomorrow
Award from Microsoft and was voted the Most Valuable Graduate by the University
of Illinois. He directs the Human Automation Interaction Lab at Wichita State
University. His lab does research on user experience, mobile devices, driving safety,
aviation psychology, and human computer interaction. The goal of his research is
to understand the human cognitive processes and develop technologies to improve
performance, increase user experience, and mitigate human error. He has experience
in developing for Google Glass, Android, iPhone, and smartwatches.
He runs the R&D group for Guam's largest media company, where he also
co-anchors the nightly news.
www.allitebooks.com
www.PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
www.allitebooks.com
www.allitebooks.com
To my favorite uncle, Benjamin Jacob Daniel, for always making me smile and
inspiring me to work hard and achieve my dreams, I miss you a lot.
Chan Ban Guan, for the continued patience, encouragement, and support,
and most of all for believing in me during the writing of this book.
This book would not have been possible without everyone's love and understanding
and I would like to thank you all from the bottom of my heart.
Table of Contents
Preface v
Chapter 1: Understanding Android Wearables and Building
Your First Android Wear App 1
Introducing Android wearables 2
Understanding the Android Wear architecture 3
Setting up an Android development environment 6
Installing the Android Wear support library 7
Setting up and configuring the Android (AVD) Emulator 8
Building a simple Android wearable application 10
Creating the mobile activity component 12
Creating the Android Wear activity component 14
Summary 19
Chapter 2: Creating Notifications 21
Introducing Android notifications 22
Creating a basic notification for wearables 23
Specifying the form factors 24
Adding and customizing a blank activity 25
Adding dependencies to Gradle scripts 26
Creating a custom notification for wearables 33
Receiving voice input within a notification 39
Receiving multiple notifications through a process called
page stacking 43
Summary 49
Chapter 3: Creating, Debugging, and Packaging Wearable Apps 51
Creating an Android wearable watch face app 52
Presenting information inside the WatchFace class 55
Creating a custom watch face service class 60
[i]
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Preface
Android Wear is becoming extremely popular, and offers a great opportunity for
developers to learn how to build applications for the Android Wear platform, which
is a special version of the core Android OS, and has been tailored for wearable
computing devices such as smartwatches. These wearable devices come with a brand
new user interface, which is the result of Google working with their customers to
understand how they use their phones today and how they can be more in touch
with their environment.
In this book, I have tried my best to keep the code simple and easy to understand
by providing a step-by-step approach, with lots of screenshots at each step to make
it easier to follow. You will soon be mastering the different aspects of Android
Wear programming, as well as the technology and skills needed to create your
own applications for the Android Wear platform.
[v]
Preface
Chapter 3, Creating, Debugging, and Packaging Wearable Apps, focuses on designing and
creating custom watch faces to present information within the Android wearable
watch area. You will learn how to effectively debug your app over Bluetooth, before
finally learning how to package your wearable app so that it can be used within the
handheld mobile device.
Chapter 4, Sending and Syncing Data, introduces you to the Data Layer API and
the Message API frameworks, so that you can synchronize image data from the
handheld device with the wearable, as well as use the Message API to communicate
between the handheld and the wearable to send and receive messages.
Chapter 5, Working with Google Glass, explores how to build effective user interfaces
for the Google Glass platform by creating user interfaces that display content that
responds to voice input commands, before finally learning how we can access the
Glass camera to take a snapshot and save the image to local storage.
Chapter 6, Designing and Customizing Interfaces for Android TV, provides you with the
background and understanding of how to effectively present your app within the
main user interface and how you can design your app by following the Android
TV UI Patterns to help users get the content they want quickly. Also, you will learn
how to create and use fragments that allow information to be presented within the
Android TV interface to represent your content.
[ vi ]
Preface
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.
Code words in text are shown as follows: "We can include other contexts through
the use of the include directive."
When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:20.0.+'
}
[ vii ]
www.allitebooks.com
Preface
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: "Next, click
on the Install packages button as shown in the preceding screenshot."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it
helps us develop titles that you will really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things
to help you to get the most from your purchase.
[ viii ]
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or
added to any list of existing errata under the Errata section of that title.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you
valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at
[email protected], and we will do our best to address the problem.
[ ix ]
Understanding Android
Wearables and Building Your
First Android Wear App
When Google announced Android Wear at their Google I/O conference back in
March 2014, developers were excited and started embracing this technology to
see what types of applications they could create to communicate between the
Android handheld device and Android wearable, while making our day-to-day
lives a lot easier.
This chapter provides you with a theoretical background of Android, and how to
develop applications for the Android Wear platform from Google. This platform
allows your Android wearable device to communicate with your phone wirelessly
over Bluetooth, and many manufactures like Samsung and LG have embraced this
technology and created wearable devices, such as the Samsung Gear Live and
the LG G Watch R smartwatches.
[1]
Understanding Android Wearables and Building Your First Android Wear App
In later chapters, we will be working with some of these APIs and seeing how we can
incorporate these in our applications to communicate between our Android phone
and Android Wear devices.
Android Wear provides consumers with a more personal interaction with their
devices. These tiny supercomputers can show you information and suggestions
when you need them. Given the wide variety of Android applications currently
on the market, you'll receive the latest posts and updates from your favorite social
apps and notifications from shopping apps.
Android wearables are great for fitness fanatics too. They allow you to better monitor
your health and fitness by showing your fitness summary in terms of real-time speed,
distance, and time information right on your wrist for your run, cycle, or walk.
Android Wear also lets you access and control other devices from your wrist by
simply saying OK Google to fire up a music playlist on your phone or cast your
favorite movie directly onto your TV. You can also receive instant messages
from your favorite social networking app, for example, Facebook. With Android
wearables, there's a lot of possibilities, and developers are jumping right in and
creating some stunning apps already.
[2]
Chapter 1
When a connection has been established between the Android device and the
wearable, over Google Play service, notification messages can be then exchanged
between the handheld device and the wearable to trigger appropriate actions on
each device.
The architecture of any typical wearable application has been set out by Google in
their design guideline documents that focus primarily on the new Material design
theme for Android 5.0 applications. This design document provides the developer
with a comprehensive framework to create visual, motion, and interaction design
across each of the various Android platforms and devices.
[3]
Understanding Android Wearables and Building Your First Android Wear App
Since Android Wear runs as a Bluetooth Low Energy (BLE) device, developers
need to ensure that they design their applications to run efficiently so that they don't
impact the device's battery. This is very important when designing the custom watch
faces or apps that use location service functionality.
The following image describes the architecture between the handheld device and the
wearable device. In the next section, we will take a look into some of the wearable
APIs that come as part of Google Play services, and explain their purpose when it
comes to communicating between the mobile device and the wearable:
.apk
wearable.apk
Awesome App
Play Store
Data API Play Services
Node API
Message API Intents somehow Outer World
wearable .apk
Once the connection is established, you can then start looking at sending and
synching data between the two devices. When a connection between two devices has
been established, each node can handle any given number of different functions. For
example, one node can handle the camera part on the mobile, while another node
could keep track of a user's GPS coordinates on the wearable device.
In the following list, we will explain each of the APIs, which are presented in the
preceding screenshot. In later chapters, we will be using these in more depth,
so at this stage, I will just be providing a brief introduction:
• Node API: The NodeApi class is responsible for keeping track of all
connected or disconnected nodes that have been established within the
wearable network by using the NodeListener interface method. When
a node establishes a connection between the handheld and the wearable,
MessageApi quietly begins to send a message from the wearable device to
the handheld device that it is paired with, which the user is signed in to with
their Google account. This sends a notification to the NodeListener method
that then begins to get information about each node.
[4]
Chapter 1
• Message API: The MessageApi class is responsible for sending across short
messages to each of the connected network nodes between the wearable
and the handheld device. Once a message has been received, a background
listener service on the receiving side (MessageListener) will be called so
that it can get the message.
• Data API: The DataApi class is responsible for synching data between the
connected Android wearable and the handheld device, and takes care of
providing the synching mechanism on both sides. In addition to synching
data, the big appeal of the data API is that when a user's connection gets
disconnected from the paired smartphone, the data will be automatically
transferred when the connection is restored, without the user needing to
worry about handling data issues. When the data API receives messages
from MessageApi, a background listening service on the receiving side
(addListener) will be called as part of the DataListener interface method.
Once the addListener method determines that a change has occurred, a call
is made to the onDataChanged method.
In the following chapters of this book, we will be taking a look at how to implement
some of these APIs to communicate between our Android device and our wearable
device, so stay tuned.
[5]
Understanding Android Wearables and Building Your First Android Wear App
Before you begin, and as a prerequisite to starting to work with Android Studio,
you will need to ensure that your system has the latest version of the Java Runtime
Environment (JRE) installed for the version of the operating system that you are using.
To determine if your system has the JRE or the Java Development Kit
(JDK) installed, open a new terminal window and issue the following
command from the command line:
java –version
Once you have determined if you have Java installed, you can proceed to download
Android Studio for your version of the operating system. The Android Studio
package can be downloaded from the Android developer tools web page at
http://developer.android.com/sdk/installing/studio.html.
Now that you have downloaded and installed Android Studio, you can begin
installing the Android 4.4W (API 20) for your system:
[6]
Chapter 1
You will notice that we have chosen to install the Android Wear system images for
both ARM and Intel. Intel delivers greater performance while running your app
using the Android Emulator, but you can select the appropriate one for your chipset.
If you decide to install both, the Android Studio IDE at design time will inform you
which one is supported.
In the next section, we will need to install the Android Wear support libraries for
our Android Wear application that will allow your Android wearable app to target
a specific version of the Android SDK APIs.
[7]
www.allitebooks.com
Understanding Android Wearables and Building Your First Android Wear App
The benefit of using the latest Android Wear support libraries is that it allows your
applications to take advantage of the new and improved features for devices that are
running Android 5.0 and above. However, while your app can still run on devices
running Android 1.6 and above, some features will not be available:
Scroll down to the Extras folder, and select the Android Support Library, as shown
in the preceding screenshot. Next, click on the Install packages button as shown in
the preceding screenshot.
If you are using Android Studio for your Android Wear development, this can
provide you with a much easier and more convenient way of adding the Android
Wear support library to your existing applications. Android Studio uses a module
model, where the mobile and wear modules are part of a single project.
[8]
Chapter 1
Open your Android Virtual Device (AVD) manager and create a new virtual device
for your Android Wear, as shown in the following screenshot:
Before we end this section, it is worth mentioning that while Android Emulator is the
most powerful and convenient tool that you will use throughout your development
of Android apps, it is important for developers to understand the types of limitations
it comes with, which are explained in the following points:
• The Android Emulator simulates real handheld device behavior, but not
specific hardware implementations
• Sensor information, such as satellite location, battery, and power settings,
as well as network connectivity, is all simulated using your computer
• Access to the camera hardware is not fully functional
• There is no ability to place or receive phone calls, or send SMS messages,
as these are all simulated
• There is no support for USB available
[9]
Understanding Android Wearables and Building Your First Android Wear App
As you can see, using the Android emulator is not recommended as a substitute for
testing your apps on a true handset or device. Now that we have set up all of the
preliminary configurations, we can start to build our Android Wear application.
1. Launch Android Studio, and then navigate to the File | New Project option.
2. Next, enter in HelloAndroidWear for the Application name field.
3. Then provide a name for the Company Domain field.
4. Next, choose Project location where you would like to save your
application code:
[ 10 ]
Chapter 1
5. Finally, click on the Next button to proceed to the next step. On the second
wizard screen, we need to specify the form factors using which our
application will run. On this screen, we choose the Minimum SDK versions
for phone and tablet, Android TV, and Android Wear.
6. Click the Phone and Tablet option and choose the API 19: Android 4.4
(KitKat) option for Minimum SDK. Choosing this option allows your
application to target more devices that are active on the Google Play Store,
with the added cost of having fewer features available for these devices.
7. Next, click on the Wear option and choose the API 20: Android 4.4
(KitKat Wear) option for Minimum SDK:
8. Next, click on the Next button to proceed to the next step in the wizard.
[ 11 ]
Understanding Android Wearables and Building Your First Android Wear App
In our next step, we will be taking a look at how to add a blank activity to our
application for its mobile section.
1. From the Add an activity to Mobile screen, choose the Blank Activity option
from the list of activities:
[ 12 ]
Chapter 1
2. Now, click on the Next button to proceed to the next step in the wizard.
In our next step, we need to set up and customize our Blank Activity
properties that can be used by our application. Here, we specify the name
of the activity, layouts, and title, as well as its menu resource name that it
will be using (if it contains a menu bar).
3. From the Customize the Activity screen, accept the default properties that
have been created for you by the wizard:
4. Click on the Next button to proceed to the next step in the wizard.
[ 13 ]
Understanding Android Wearables and Building Your First Android Wear App
1. From the Add an activity to Wear screen, choose the Blank Wear Activity
option:
2. Click on the Next button to proceed to the final step in the wizard.
In our final step, we need to customize our Blank Wear Activity properties
that can be used by our Android wearable. Here, we specify the name of the
activity as well as the layouts for the watch faces for round and rectangle.
[ 14 ]
Chapter 1
3. From the Customize the Activity screen, accept the default properties that
have been created for you by the wizard:
4. Next, click on the Finish button to proceed, and your Android wearable
project will be generated for you. After a few moments, the Android Studio
window will be displayed with your project loaded.
When you take a look at the project that the wizard created for you, the first thing
you will notice is that it contains two modules: mobile and wear. The mobile portion
of our project is the application that will run on a phone device that will be used to
communicate with our wearable device. The wear portion is the application that will
be installed on the Android wearable device.
[ 15 ]
Understanding Android Wearables and Building Your First Android Wear App
As you can see in the following screenshot, the default project structure that our
wizard created for us doesn't seem to do anything special—it simply contains the
skeleton structure of any Android wearable app. In our next step, we will look at
how we can write our own code for the Wear module of our application:
In our next step, we will begin modifying our MainActivity class file to display
our custom Android wearable welcome message to the user within the wearable
watch face :
[ 16 ]
Chapter 1
2. From the Project Navigator window, expand the Wear section, select,
and expand the java section.
3. Modify the following code in the MainActivity.java file of the project:
private TextView watchTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final WatchViewStub theWatchView = (WatchViewStub)
theWatchView.setOnLayoutInflatedListener(new
WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub
theWatchView) {
watchTextView = (TextView)
theWatchView.findViewById(R.id.text);
watchTextView.setText("Android Wear Rocks!");
}
});
}
In the preceding code snippet, we start by creating a new activity, which is handled
by the onCreate method. This method is responsible for starting the activity when
the application is launched and the emulator sets up the content, prior to displaying
the watch layouts on the screen using the setContentView method.
[ 17 ]
www.allitebooks.com
Understanding Android Wearables and Building Your First Android Wear App
Now, we can finally compile, build, and run our application. Click on the green
button labeled B in the preceding screenshot or simply press
CMD + F9, and choose Android Virtual Device from the list of Android Emulators:
Once the emulator has launched and after a few moments, you should see your app
displayed, as shown in the preceding screenshot.
[ 18 ]
Chapter 1
Summary
In this chapter, we explored the features and key concepts of the Android Wear
platform; we discussed about the Android Wear architecture; and then we moved
on to look at how to configure our Android environment, setting up the Android
SDK and AVD, before finally taking a look at how to build our simple Android
wearable app.
In the next chapter, we will cover the features of Android notifications and explore
the different ways that we can send notifications between the handheld device and
the Android wearable to create basic and custom notifications. We will learn how
we can use the Android voice capabilities to allow the user to respond to notification
messages by using just their voice, and how we can use a method called page
stacking to receive multiple notifications.
[ 19 ]
Creating Notifications
This chapter provides you with a background of essential features of Android
notifications and how we can use these to send messages between a handheld device
and a wearable device.
We will be taking a look at how we can use different notification methods to develop
an application that shows how we can create basic and custom notifications. You will
also learn how you can incorporate and make use of Android's voice capabilities to
respond to notification messages that are contained within a notification.
At the end of the chapter, we will take a look at how we can use notification stacking
to display multiple notification messages within a notification.
[ 21 ]
Creating Notifications
Notifications in wear are the result of events that happen on the paired smartphone,
which are then mirrored on the wearable device, or contextual events like location-
aware events or time, and date-based reminders. Android notification messaging
works by communicating between the handheld device and wearable device over
Bluetooth. When the connection has been established, the Google Play Service
notification messages can be exchanged between the handheld device and the
wearable. An example of a notification message that has been sent from the Android
handheld device to the Android wearable can be seen in the following screenshot:
In the next sections, we will be taking a look at the different ways we can send
notifications and how we can respond to them.
[ 22 ]
Other documents randomly have
different content
This is the case with murderers. They could not be baptized for the
remission of sins for they had shed innocent blood.
The Lord once told me that what I asked for I should have. I have been
afraid to ask God to kill my enemies, lest some of them should,
peradventure, repent.
I asked a short time since for the Lord to deliver me out of the hands of
the Governor of Missouri, and if it needs must be to accomplish it, to
take him away; and the next news that came pouring down from there
was, that Governor Reynolds had shot himself. And I would now say,
"Beware, O earth, how you fight against the Saints of God and shed
innocent blood; for in the days of Elijah, his enemies came upon him,
and fire was called down from heaven and destroyed them.
The spirit of Elias is first, Elijah second, and Messiah last. Elias is a
forerunner to prepare the way, and the spirit and power of Elijah is to
come after, holding the keys of power, building the Temple to the
capstone, placing the seals of the Melchizedek Priesthood upon the
house of Israel, and making all things ready; then Messiah comes to
His Temple, which is last of all.
Messiah is above the spirit and power of Elijah, for He made the
world, and was that spiritual rock unto Moses in the wilderness. Elijah
was to come and prepare the way and build up the kingdom before the
coming of the great day of the Lord, although the spirit of Elias might
begin it.
I have asked of the Lord concerning His coming; and while asking the
Lord, He gave a sign and said, "In the days of Noah I set a bow in the
heavens as a sign and token that in any year that the bow should be
seen the Lord would not come; but there should be seed time and
harvest during that year: but whenever you see the bow withdrawn, it
shall be a token that there shall be famine, pestilence, and great
distress among the nations, and that the coming of the Messiah is not
far distant.
But I will take the responsibility upon myself to prophesy in the name
of the Lord, that Christ will not come this year, as Father Miller has
prophesied, for we have seen the bow; and I also prophesy, in the name
of the Lord, that Christ will not come in forty years; and if God ever
spoke by my mouth, He will not come in that length of time. Brethren,
when you go home, write this down, that it may be remembered.
Jesus Christ never did reveal to any man the precise time that He
would come. Go and read the Scriptures, and you cannot find anything
that specifies the exact hour He would come; and all that say so are
false teachers.
There are some important things concerning the office of the Messiah
in the organization of the world, which I will speak of hereafter, May
God Almighty bless you and pour out His Spirit upon you, is the
prayer of your unworthy servant. Amen.
At half-past three p.m., I met with the Twelve, Bishop Miller and the
Temple Committee, in the Nauvoo Mansion.
The following letter from Lyman Wight and others was read:—
To the First Presidency and the Quorum of the Twelve of the Church of
Christ of Latter-day Saints.
But under all these mighty clogs and hindrances, we have been able to
accomplish and have in progress, so that we can deliver in Nauvoo
about one million feet of lumber by the last of July next, which will be
a great deal more than what is necessary to build the Temple and the
Nauvoo House. Besides all this, we have made valuable improvements
here,—all the result of much labor done under trying circumstances.
We have recently ascertained that the lands from the falls of Black
River to its sources are the property of the Menomanee Indians, and
the general government having urged them to move off the lands in the
vicinity of Green Bay to their own lands. The Indians say they will,
provided the Government will remove all strange Indians and
trespassing white men off their lands; consequently, the agent and
superintendent of Indian Affairs are taking such steps as will stop all
further trespassing on the Indian lands, on the Wisconsin, Black and
Chippewa rivers, under the penalties of the laws relative to the cases.
We have thought it best to sell the mills here, if you think it expedient.
We feel greatly encouraged to spend and be spent in the cause of
Christ, according to the will of our Heavenly Father.
You will, therefore, after due deliberation, send us, by the hands of
Brother Young, such instructions as may be the result of your
deliberations.
Lyman Wight,
George Miller,
Phineas R. Bird,
Pierce Hawley,
John Young.
We wrote you last fall a full and complete description of this country
as high as the falls on Black River, without exaggeration, giving a
slight description of the Pinery.
We calculate the present prospect for lumber betwixt this and the last
of July next will be from eight to twelve hundred thousand feet, which
we deem will be all sufficient to finish the two houses, which will
accomplish the mission on which we started to this country.
This committee is therefore led to take a brief view of the south and
western part of North America, together with the Floridas, Texas, West
India Islands, and the adjacent islands to the Gulf of Mexico, together
with the Lamanites bordering on the United Territories from Green
Bay to the Mexican Gulf, all crying with one voice, through the
medium of their chiefs, Give us an understanding of your doctrine and
principles, for we perceive that your ways are equal, and your
righteousness far exceeds the righteousness of all the missionaries that
we have yet become acquainted with,—that your conduct with one
another is like that of ours, and that all your feasts and attendant
ceremonies are precisely like ours.
Your servants, the committee, have viewed the Colorado river, with all
its beautiful hills and valleys and fertile soil, with deep regret, when
viewing the countless thousands of inhabitants on either side thereof,
without the knowledge of God or the doctrine of the Church of Jesus
Christ of Latter-day Saints, and say in their hearts, Would it be
expedient to form a mission of those true and full-blooded
Ephraimites, who, from principle, and the love of the truth, have borne
the most extreme burdens, fatigue, and hunger, to prosecute the
mission, to procure lumber sufficient to build the two houses, to open
the door to all the regions which we have named, which regions have
never yet had an opportunity to hear the Gospel and to be made
acquainted with the plan of salvation? or shall they continue to suffer
the fatigues of hunger, wet and cold, in a rigid, inclement climate, for
the pitiful sum that it shall avail them, after undergoing those
hazardous perils? or shall they, like Timothy and Titus, with Paul,
hazard the perils of the sea and land through the Southern States and
West India Islands, and all the Lamanite world, go forth and proclaim
to them the Gospel of our Lord and Savior Jesus Christ, and teach
them to build up Zion?
Are there not thousands of the rich planters who would embrace the
Gospel, and, if they had a place to plant their slaves, give all the
proceeds of their yearly labor, if rightly taught, for building up the
kingdom, being directed by the President of the whole Church to make
the right application? We answer, Yes, we believe they would.
Your servants, the committee, are of the opinion that a concerted and
reciprocity of action between the North and the South would greatly
advance the building up of the kingdom.
This committee is of the opinion that they can choose soldiers for this
expedition who are as undeviating in the principles of the doctrine of
Christ and the Book of Mormon as the sun in his daily course, and as
indefatigable in their exertions in this cause as the earth is in its daily
revolution.
After having procured the lumber for those two houses, the committee
is of the opinion that the preaching of the Gospel and raising funds in
the south would be a far more speedy way of accomplishing the work
than any other that could be introduced at the present time.
We, your servants, therefore, will wait patiently the result of your
council, and submit ourselves to the same with all cheerfulness, our
only object being to advance the cause and kingdom of God, stand
ready to take hold wherever your wise council may consider it to be of
the most advantage.
This committee view with deep regret the many different teachings this
Church has received concerning the distribution of their property, such
as raising funds for the printing of tracts, evidences of the Book of
Mormon, and pamphlets of various descriptions, which we consider
has not advanced the cause in the least degree, but has tended directly
to sap the foundation of building the houses.
LYMAN WIGHT,
GEORGE MILLER,
PHINEAS R. BIRD,
PIERCE HAWLEY,
JOHN YOUNG,
Brigham Young, P. T.
The brethren went into council on the subject matter of the letters during the
evening.
Monday 11.—At home till nine; then spent the day in council in the lodge
room over Henry Miller's house.
Footnotes:
Tuesday, March 12, 1844.—At home in the morning. At eleven a.m., I told
Brother Cole I wanted the room over the store for more important purposes,
and wished him to remove the school to Henry Miller's house immediately;
which he did.
The brethren who were in council with me yesterday assembled there in the
afternoon and evening.
We, the mayor and recorder of said city, do hereby certify that Orson
Pratt, Esq., the bearer, a councilor in city council of said city, is sent as
an agent by the authorities of said city or corporation to transact such
business as he may deem expedient and beneficial for the community
which he represents; and as such agent and gentleman of principle and
character, he by us is recommended to the due consideration of all the
executive officers of the government, both houses of Congress, and
gentlemen generally of the United States.
In witness whereof we have hereunto set our hands and affixed the seal
of said corporation at the time and place aforesaid.
[CORPORATION SEAL.]
The plan proposed for carrying out the object of the meeting was by shares
of five dollars each.
The leading feature of the institution was to give employment to our own
mechanics, by supplying the raw material, and manufacturing all sorts of
domestic goods, and furnishing the necessaries and comforts of life on the
lowest possible terms.
Wednesday, 13.—In special council from nine to twelve a.m. Orson Hyde,
Wilford Woodruff and James Emmett were present, in addition to those of
the preceding day. Willard Richards was appointed historian, and William
Clayton clerk of the council.
It was decided that Amos Fielding should return to England, when I and my
brother Hyrum gave him the following letter of attorney:—
"This is to certify that the bearer thereof, our worthy brother Elder
Amos Fielding, hath been appointed by the First Presidency of the
Church of Jesus Christ of Latter-day Saints, our agent, to transact such
business as may be deemed necessary for the benefit of said Church,
and such as he shall see proper throughout the island of Great Britain.
In witness whereof we have hereunto set our hands and placed the
corporation seal of City of Nauvoo this 13th day of March, A. D. 1844.
[CORPORATION SEAL.]
JOSEPH SMITH,
HYRUM SMITH.
Thursday, 14.—In special council over the store from nine till one.
At two, went to see Brother John Wilkie. He had sent to me to come and see
him. He wanted to know what he should do. I told him of the order of
tithing, &c., and he wanted I should come again.
Being in a strait to raise money to assist the hands in the Pine country, I sent
Elders Brigham and Willard Richards to borrow some money from Mr.
Orme, who, it is believed, had a large sum of money lying idle, but they did
not get any.
"This day President Joseph Smith rode over to Brother John Wilkie's at
his special request, to give him some instructions relative to his duty in
regard to tithing and consecration.
Brother Wilkie has for a long time back been struggling with his
feelings, designing to do right, but laboring under many fears and
prejudices, in consequence of having in some degree given way to
believe the base reports circulated by individuals for the purpose of
injuring the authorities of the Church, and also from various other
causes. His faithful companion has persevered diligently, and with
fervent prayer has called upon God in his behalf, until she has realized
her utmost wishes.
May the Lord grant his Spirit and peace to abide upon Brother Wilkie
and his companion through the remainder of their days; may their
hearts expand and become enlarged to receive the fullness of the
blessings of the kingdom of heaven; may they have the light of eternal
truth continually springing up in them like a well of living water; may
they be shielded from the powers of Satan and the influence of
designing men, and their faith increase from day to day until they shall
have power to lay hold on the blessings of God and the gifts of the
Spirit until they are satisfied; and, finally, may they live to a good old
age; and when they have lived while they desire life, may they die in
peace and be received into the mansions of eternal life, and enjoy a
celestial glory forever and ever! Even so, amen.
The editors of the Times and Seasons published a short account of "Our
City and the Present Aspect of Affairs," which we insert.
Believing that our patrons and friends are pleased to hear of our
prosperity, we feel happy in apprising them of the same, through the
columns of our paper.
Almost every stranger that enters our city is excited with astonishment
that so much has been done in so short a time; but we flatter ourselves,
from the known industry, perseverance, and diligence of the Saints,
that by the return of another winter so much more will be
accomplished, that his astonishment will be increased to wonder and
admiration.
We are also pleased that we can inform our friends abroad that the
Saints here of late have taken hold of the work on the Temple with the
zeal and energy that in no small degree excites our admiration. Their
united efforts certainly speak to us that it is their determination that
this spacious edifice shall be enclosed, if not finished, this season.
And a word we would say to the Saints abroad, which is, that the
Temple is being built in compliance with a special commandment of
God not to a few individuals, but to all. Therefore we sincerely hope
you will contribute of your means as liberally as your circumstances
will allow, that the burden of the work may not rest upon a few, but
proportionately upon all.
Where is the true-hearted Saint that does not with joy and delight
contemplate the endowment of the servants of God and the blessings
He has promised to His people on condition that they speedily build
the Temple? Certainly you cannot reasonably expect to enjoy these
blessings if you refuse to contribute your share towards its erection.
The Female Relief Society had two meetings in the assembly room, as it
would not hold all at once, and sanctioned the "Voice of Innocence from
Nauvoo."
The wind continued very strong all day. In the evening, had a smart
snowstorm, which covered the ground, was succeeded by a frosty night.
Monday, 18.—The frost of last night was so severe as to form ice inside the
houses.
In the afternoon, heavy, driving rain. Northwest wind. Dull, cold day.
Wednesday, 20.—Severely cold northwest wind, with a snow and hail storm
until ten a.m. Afternoon dull. West wind.
Spent the morning and afternoon in the assembly room, studying the
languages.
We see from the Nauvoo Neighbor that General Joseph Smith, the
great Mormon Prophet, has become a candidate for the next
presidency. We do not know whether he intends to submit his claims to
the National Convention, or not; but, judging from the language of his
own organ, we conclude that he considers himself a full team for all of
them.
All that we have to say on this point is, that if superior talent, genius,
and intelligence, combined with virtue, integrity, and enlarged views,
are any guarantee to General Smith's being elected, we think that he
will be a "full team of himself."
A traveler, having visited Nauvoo for a few days, wrote to the Times
and Seasons—
I have been conversant with the great men of the age; and, last of all I
feel that I have met with the greatest, in the presence of your esteemed
Prophet, General Joseph Smith. From many reports, I had reason to
believe him a bigoted religionist, as ignorant of politics as the savages;
but, to my utter astonishment, on the short acquaintance, I have found
him as familiar in the cabinet of nations as with his Bible and in the
knowledge of that book I have not met with his equal in Europe or
America. Although I should beg leave to differ with him in some items
of faith, his nobleness of soul will not permit him to take offense at
me. No, sir; I find him open, frank, and generous,—as willing others
should enjoy their opinions as to enjoy his own.
Free from all bigotry and superstition, he dives into every subject, and
it seems as though the world was not large enough to satisfy his
capacious soul, and from his conversation one might suppose him as
well acquainted with other worlds as this.
So far as I can discover, General Smith is the nation's man, and the
man who will exalt the nation, if the people will give him the
opportunity; and all parties will find a friend in him so far as right is
concerned.
Thus, sir, you have a few leading items of my views of General Smith,
formed from personal acquaintance, which you are at liberty to dispose
of as you think proper. I anticipate the pleasure of renewing my
acquaintance with your citizens at a future day.
Yours respectfully,
A TRAVELER.
A writer in the Quincy Herald reflects very strongly upon the conduct of the
Quincy Whig, New York Tribune, and other newspapers, for publishing
slanderous falsehoods against the Saints.
At ten a.m., held Mayor's court, and afterwards read German in the reading
room.
Also called with William Clayton and Alexander Neibaur at Dr. Foster's. He
was gone to Appanoose, and Mrs. Foster was at Mr. Gilman's.
We went down there and saw her, [Mrs. Foster]. President Joseph
asked Sister Foster if she ever in her life knew him guilty of an
immoral or indecent act. She answered, "No." He then explained his
reasons for asking; which were, he had been informed that Dr. Foster
had stated that Joseph made propositions to his wife calculated to lead
her astray from the path of virtue; and then asked if ever he had used
any indecent or insulting language to her. She answered, "Never." He
further asked if he ever preached anything like the "plurality of wife"
doctrine to her other than what he had preached in public? She said,
"No." He asked her if he ever proposed to have illicit intercourse with
her, and especially when he took dinner during the doctor's absence.
She said, "No." After some further conversation on the subject, we left.
Mrs. Gillman was present all the time. President Joseph and Neibaur
then went on foot to the farm.
Sunday, 24.—At ten, a.m., met at the stand near the Temple. [The following
very brief outline of the speeches is from the journal of Wilford Woodruff]:
—
I once heard a man say, who was opposed to this work, "That it might
be true, but it gave Joseph Smith power." True, said I; but if his power
be subordinate to the power of God, it is right. If a man set up a
kingdom by the power of God, then let others seek power from the
same source. God sets up kingdoms and pulls down kingdoms: this
makes men mad who will not submit to the kingdom of God. We all
know the result of the power of Moses, who was the representative of
God.
Judging from what is past, how will it be when God sets up His
kingdom in the last days? Whether there is a conspiracy now, or not, I
don't know; but no doubt there will be, if not now, for it has always
been so. In the days of the Nephites, they had their Gadianton robbers.
I have not any doubt but that the apostates will join with the other
wicked powers to try to put down the power of God, and I am glad to
have the power of the kingdom of God tested; I care not what sacrifice
I am called to make for such a kingdom. If it is friends, wealth, or even
life, at the purchase of such a kingdom, it is cheap. Did the ancient
Apostles, Prophets, or Saints who died pay too much for that
kingdom? They did not. It is necessary that men be put in possession
of the knowledge and mysteries of the kingdom of God, in order to sin
as far as they wish, that they may go to the highest pitch. How often
men lay down their lives for their country and other purposes. How
much better, then, to die for the cause of Zion! Good and righteous
men will administer justice and rebuke evil. The Church should be
cleansed from bad men, and the Lord will take His own way to cleanse
the Church.
We should lift up our voice against wickedness of all kinds. But will
the rulers of our land do it? No, they will not; they will be cowards
until there is no man to fight, and then be brave. When Government
will not do it, some man should take the helm of government that will
do it. Will it be called treason, if the God of heaven should set up a
kingdom? May the Lord give you more and more of His Spirit, light
and intelligence, until you are cemented together in union and love.
Amen.
President Joseph Smith again arose and said—In relation to the power
over the minds of mankind which I hold, I would say, It is in
consequence of the power of truth in the doctrines which I have been
an instrument in the hands of God of presenting unto them, and not
because of any compulsion on my part. I wish to ask if ever I got any
of it unfairly? If I have not reproved you in the gate? I ask, Did I ever
exercise any compulsion over any man? Did I not give him the liberty
of disbelieving any doctrine I have preached, if he saw fit? Why do not
my enemies strike a blow at the doctrine? They cannot do it: it is truth,
and I defy all men to upset it. I am the voice of one crying in the
wilderness, "Repent ye of your sins and prepare the way for the
coming of the Son of Man; for the kingdom of God has come unto
you, and henceforth the ax is laid unto the root of the tree; and every
tree that bringeth not forth good fruit, God Almighty (and not Joe
Smith) shall hew it down and cast it into the fire."
After meeting, I rode out with Emma. The trees begin to bud forth.
Elder R. H. Kinnamon writes that during the last 22 months he has baptized
over 100 persons while on a mission in Virginia and North Carolina,
organized two branches in Virginia, and calls are continually made for
preaching in every direction.
Millions of wild pigeons flying north, and millions of gnats dancing in the
air. Dull day. At night thunder, lightning and rain.
Tuesday, 26.—Dull day. From nine to twelve, noon, in council; also from
two to five p.m.
The memorial drawn up by Dr. Richards was read, discussed, and approved
by the general council.
ORDINANCE.
PREAMBLE.
ebookgate.com