Testing and Securing Android Studio Applications
eBook - ePub

Testing and Securing Android Studio Applications

  1. 162 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Testing and Securing Android Studio Applications

About this book

Today, mobile applications are increasingly being used to access the Web. Mobile developers play a key role in how consumers access the Web with millions of people depending on them to create secure and functional applications. This book, beginning with the fundamentals of Android security, will guide you through the process of creating a secure and debugged application. We will look at the Android Studio development environment and take you through the steps needed to protect your local data and secure your network communications.

Initially covering the threats, risks, and vulnerabilities in software and in the Android environment, this book will then dig deeper, exploring different types of authentication methods that can be adopted in your Android application. You will be introduced to techniques and classes to test your application, before finally learning about supporting tools that will help you to improve your application.

By the end of this book, your Android application will be debugged and secure and you will be able to apply what you've learned to further application projects.

Trusted by 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Year
2014
Edition
1
eBook ISBN
9781783988808

Testing and Securing Android Studio Applications


Table of Contents

Testing and Securing Android Studio Applications
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to Software Security
Software security terms
Threats, vulnerabilities, and risks
Threat
Vulnerability
Risk
Secure code-design principles
Testing the basics
Summary
2. Security in Android Applications
The mobile environment
An overview of Android security
Permissions
Interapplication communication
Intents
Content providers
Summary
3. Monitoring Your Application
Debugging and DDMS
Threads
Method profiling
Heap
Allocation Tracker
Network Statistics
File Explorer
Emulator Control
System Information
Summary
4. Mitigating Vulnerabilities
Input validation
SQL injection
Permissions
Handling a user's data and credentials
Interapplication communication
Securing Intents
Securing the content providers
Summary
5. Preserving Data Privacy
Data privacy
Shared preferences
Files in the internal storage
Files in the external storage
The database storage
Encryption
The encryption methods
Generating a key
Using encryption to store data
Summary
6. Securing Communications
HTTPS
SSL and TLS
Server and client certificates
Keytool in the terminal
Android Studio
Code examples using HTTPS
Summary
7. Authentication Methods
Multifactor authentication
The knowledge factor
The possession factor
The inherence factor
Login implementations
AccountManager
Summary
8. Testing Your Application
Testing in Android
Testing the UI
The uiautomator API
The UiDevice class
The UiSelector class
The UiObject class
The UiCollection class
The UiScrollable class
The uiautomatorviewer tool
The UI test project
Running UI test cases
Summary
9. Unit and Functional Tests
Testing activities
The test case classes
Instrumentation
The test case methods
The Assert class and method
The ViewAsserts class
The MoreAsserts class
UI testing and TouchUtils
The mock object classes
Creating an activity test
Creating a unit test
The unit test setup
The clock test
The layout test
The activity Intent test
Creating a functional test
The functional test setup
The UI test
The activity Intent test
The state management test
Getting the results
Summary
10. Supporting Tools
Tools for unit testing
Spoon
Mockito
Android Mock
FEST Android
Robolectric
Tools for functional testing
Robotium
Espresso
Appium
Calabash
MonkeyTalk
Bot-bot
Monkey
Wireshark
Other tools
Genymotion
Summary
11. Further Considerations
What to test
Network access
Media availability
Change in orientation
Service and content provider testing
Developer options
Getting help
Summary
Index

Testing and Securing Android Studio Applications

Copyright © 2014 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, 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.
First published: August 2014
Production reference: 1190814
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-880-8
www.packtpub.com
Cover image by Ravaji Babu ()

Credits

Authors
Belén Cruz Zapata
Antonio Hernåndez Niñirola
Reviewers
Nico KĂŒchler
Anand Mohan
Ravi Shanker
Kevin Smith
Abhinava Srivastava
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Rebecca Youé
Content Development Editor
Parita Khedekar
Technical Editor
Mrunmayee Patil
Copy Editors
Roshni Banerjee
Adithi Shetty
Project Coordinators
Neha Thakur
Amey Sawant
Proofreader
Ameesha Green
Indexers
Mariammal Chettiyar
Rekha Nair
Tejal Soni
Priya Subramani
Graphics
Ronak Dhruv
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda

About the Authors

Belén Cruz Zapata received her engineering degree in Computer Science from the University of Murcia in Spain, with specialization in software technologies and intelligent and knowledge technologies. She has earned an MSc degree in Computer Science and is now working on her PhD degree in Software Engineering Research Group from the University of Murcia.
Belén is based in Spain; however, due to the field of her PhD, she is now collaborating with Université Mohammed V - Soussi in Rabat. Her research is focused on mobile technologies in general and also applies to medicine.
Belén has worked as a mobile developer for several platforms, such as Android, iOS, and the Web. She is the author of the book on Android Studio: Android Studio Application Development, Packt Publishing.
To follow her projects, she maintains a blog at http://www.belencruz.com and you can follow her on Twitter at @belen_cz....

Table of contents

  1. Testing and Securing Android Studio Applications

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Testing and Securing Android Studio Applications by Belen Cruz Zapata, Antonio Hernandez Ninirola in PDF and/or ePUB format, as well as other popular books in Computer Science & Cyber Security. We have over one million books available in our catalogue for you to explore.