Sample 11721
Sample 11721
ANDROID
Android
ISBN: 9789325977884
All rights reserved. No part of this publication which is material protected by this copyright notice may be reproduced
or transmitted or utilized or stored in any form or by any means now known or hereinafter invented, electronic, digital or
mechanical, including photocopying, scanning, recording or by any information storage or retrieval system, without prior
written permission from the publisher.
Information contained in this book has been published by VIKAS® Publishing House Pvt Ltd and has been obtained by
its Authors from sources believed to be reliable and are correct to the best of their knowledge. However, the Publisher
and its Authors shall in no event be liable for any errors, omissions or damages arising out of use of this information and
specifically disclaim any implied warranties or merchantability or fitness for any particular use. Disputes if any are subject
to Delhi Jurisdiction only.
Printed in India
iv
DEDICATED TO
BIBLE
RAMAYANA
HOLY KORAN
MAHABHARATA
GURU GRANTH SAHIB
AND ALL THE OTHER
HOLY BOOKS
So Android is a movement that has moved the data from laptop to hand held devices
like mobile. Competition for Android is there but is in the front runner in mobile technology
by a long distance. Good knowledge in basic Java will help you to understand and develop
the technology and Android apps. Many universities in India and across the world are now
teaching Android in their syllabus which shows the importance of this subject. This book
can be read by anyone who knows Java and XML concepts. This book is a step forward
to do a plain Android example. This book is written with lot of diagrams with explanations
which will help a student to understand fast. This book is also attached with a project, if any
programmer tries to run that project will be greatly benifitted to learn Android professionally.
It is always challenge to give a project in Android which I have tried to give. So it is a very
useful book both for beginners and professionals.
I shall be glad to hear from the users of the book so that the way forward to design a
new edition for me becomes easier. I can be reached at [email protected]
vii
ACKNOWLEDGEMENT
My acknowledgement goes to everyone who has come in my life: my Father-who
taught me how to work hard, my Mother- who taught us love in different forms, my wife-who
has taught me to be passionate and more romantic to the profession and given the internal
energy and support, my daughters-so good with all day chatting and vibrancy which gives
me the energy to do work, my brother-always helping me without any conditions, my
sister-for giving and loving me with unconditional love, my neice and nephew-give me
love like my daughters and sons.
ix
3. CREATE THE FIRST ANDROID APPLICATION
3.1 Directory Structure 39
x
6. ACTIVITY
6.1 Introduction 119
6.2 Intent 119
6.3 Intent _ filter 127
6.4 Activity life cycle 127
6.5 Broadcast Life cycle 130
6.6 Service 130
7. MULTIMEDIA
7.1 Android System Architecture 142
7.2 Play Audio and Video 144
7.2.1 Play Audio 144
7.3 Text to Speech 156
xi
10.4 Navigating to a Specific Location 211
10.4.1 Adding Markers 214
10.4.2 Getting the Location which was touched 218
10.4.3 Geocoding and Reverse Geocoding 220
10.4.4 Getting Location Data 223
10.4.5 Monitoring a Location 227
11. JSON
11.1 What is JSON? 230
11.2 XML and JSON 230
11.3 Use of JSON 231
11.4 Syntax and Rule of JSON 232
11.5 JSON Name/Value Pairs 232
11.6 JSON Values 232
11.7 JSON objects 233
11.8 JSON Arrays 234
11.9 How to JSON uses JavaScript syntax 234
11.10 Parsing JSON and XML 235
11.10.1 Parsing JSON Http Response 236
11.10.2 Parsing XML Http Response 236
xii
1 Introduction to
Android Operating System
• What is Android?
• Android Ecosystem
• Why Android?
• Android Version
• Features of Android
• Architecture of Android
• Stack Overview
Chapter Overview:
In this chapter, a new learner will able to understand the history of Android, the architecture,
framework and various tools which are used in Android framework. You will also learn about the
Android system overview with topics like Preferences and various supported File System in Android.
Operating Systems have developed a lot in last 15 years. It started from black and white phones to
smart phones or mini computers. Nowadays one of the most widely used mobile OS is ANDROID.
2 Android
Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich Miner, Nick Sears and
Chris White during 2003. After that it was acquired by Google in 2005.
20%
OFF