Learn Spring for Android Application Development
Build robust Android applications with Kotlin 1.3 and Spring 5
S. M. Mohi Us Sunnat
Igor Kucherenko
BIRMINGHAM - MUMBAI
Learn Spring for Android Application Development
Copyright 2019 Packt Publishing
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 authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.
Commissioning Editor: Aaron Lazar
Acquisition Editor: Sandeep Mishra
Content Development Editor: Manjusha Mantri
Technical Editor: Riddesh Dawne
Copy Editor: Safis Editing
Language Support Editor : Storm Mann
Project Coordinator: Prajakta Naik
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Graphics: Jisha Chirayil
Production Coordinator: Arvindkumar Gupta
First published: January 2019
Production reference: 1310119
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78934-925-2
www.packtpub.com
To my beloved parents, Md. Montaz and Taslima Taz, for their benevolent support and countless sacrifices.
To my lovely wife, Chaity, who always supported me and provided motivation whenever I was in trouble.
S M Mohi Us Sunnat
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Packt.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.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.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.
Contributors
About the authors
S. M. Mohi Us Sunnat is a passionate Android developer and trainer with over 4 years' experience. He has developed applications using Kotlin as the principal programming language. He is the founder of DreamOgrammerS, a small IT company. He is the organizer of Droidcon Dhaka. He loves community engagement and works on a number of open source projects, including Mozilla Firefox and Brave. He is also the community leader of the Bangladesh Kotlin user group and the Dhaka Twitter developer community of Bangladesh.
Writing a book is harder than writing blogs and more gratifying than I could have ever imagined. None of this would have been possible without my family and friends. I will start by thanking my loving wife, Chaity, for her continuous support. She was as important to this book being completed as I was. A special thanks to my friends, Faysal, Hasib, Kiron, Jisan, Mirza, and Zibon. They encouraged me every time I struggled throughout this journey. And finally, my sincere gratitude to everyone on the PacktPub team who helped me so much, especially Manjusha Mantri, for her patience and trust in me. I will not forget all of this help and am indebted to you all.
Igor Kucherenko is an Android developer at Techery, a software development company that uses Kotlin as the main language for Android development. Currently, he lives in Ukraine, where he is a speaker in the Kotlin Dnipro community, which promotes Kotlin, and shares his knowledge with audiences at meetups. You can find his articles concerning Kotlin and Android development on Medium and in a blog for Yalantis, where he worked previously.
I'd like to thank my colleague for imparting his knowledge, and Packt for the opportunity to write this book, as well as my wife for her patience while I was writing it.
About the reviewers
Abid Khan is an application developer and test engineer with over 10 years of experience. He has worked with different programming languages, including C/C++ and Java, and is now working with Kotlin as a primary language for Android development. Abid is also the author of a book, Hands-On Object-Oriented Programming in Kotlin. He lives in Stockholm, Sweden, and spends most of his time reading books, learning new technologies, and blogging.
H. M.Mahedi Hasan Jisan is currently pursuing his master's degree in computer science at the University of Regina, Canada. He is working in the research field under the supervision of a professor . He completed his B.Sc. in computer science and engineering at BRAC University in 2017. He previously worked as a junior software engineer at Cramstack Ltd., from June 2017 to December 2018. Learn Spring for Android Application Development is the first book that he has worked on as a technical reviewer.
I would like to thank S M Mohi Us Sunnat, a writer of this book. He has previously helped me a lot with Android programming, and encouraged me to pursue my dreams. I would like to dedicate this book to my family and friends.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
This book is designed to develop both server and client for an application. We have used the Kotlin language for both the server and client sides. In this book, Spring will be the server-side application, and Android the client-side application. Our primary focus is on those areas that will be able to help a developer develop a secure application with the latest architecture. This book describes the basics of Kotlin and Spring, which will be of benefit if you are unfamiliar with these platforms. We also designed the chapters for implementing security and database in a project. This book delves into the use of Retrofit for handling HTTP requests and SQLite Room for storing data in an Android device. You will also be able to find a way of how to develop a robust, reactive project. Then, you will learn how to test a project using JUnit and Espresso for developing a less bug-prone and stable project.
Next page